Skip to content

Commit a1f7a94

Browse files
author
MarkBaker
committed
Discard all usage of direct calls to the namespaced functions, because I'm so f***ing p***ed off with people complaining about the entries that they require in composer.json, and telling me how I'm making the world burn, and deliberately making the interwebz slow. Direct procedural access to functions and operations is being moved to a separate library, which will have this library as a dependency (more details to follow once I've created it and put all the documentation in place).
1 parent de98a4a commit a1f7a94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+154
-2131
lines changed

README.md

+4-27
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ $suffix = 'i';
7474

7575
$complexObject = new Complex\Complex($real, $imaginary, $suffix);
7676
```
77-
or
77+
or as an array
7878
```php
7979
$real = 1.23;
8080
$imaginary = -4.56;
@@ -84,7 +84,7 @@ $arguments = [$real, $imaginary, $suffix];
8484

8585
$complexObject = new Complex\Complex($arguments);
8686
```
87-
or
87+
or as a string
8888
```php
8989
$complexString = '1.23-4.56i';
9090

@@ -113,14 +113,6 @@ $complexString2 = '2.34+5.67i';
113113

114114
echo Complex\Operations::add($complexString1, $complexString2);
115115
```
116-
117-
or procedurally, you can pass all values to the appropriate (namespaced) function
118-
```php
119-
$complexString1 = '1.23-4.56i';
120-
$complexString2 = '2.34+5.67i';
121-
122-
echo Complex\add($complexString1, $complexString2);
123-
```
124116
If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
125117

126118
You can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
@@ -142,28 +134,13 @@ $complexString = '1.23-4.56i';
142134
echo Complex\Functions::sinh($complexString);
143135
```
144136

145-
or you can call the function as you would in procedural code, passing the Complex object as an argument
146-
```php
147-
$complexString = '1.23-4.56i';
148-
149-
$complexObject = new Complex\Complex($complexString);
150-
echo Complex\sinh($complexObject);
151-
```
152-
153-
When called procedurally using the function, you can pass in the argument as a Complex object, or as an array or string that will parse to a complex object.
154-
```php
155-
$complexString = '1.23-4.56i';
156-
157-
echo Complex\sinh($complexString);
158-
```
159-
160-
In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function procedurally
137+
In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function
161138

162139
```php
163140
$complexString = '1.23-4.56i';
164141

165142
$complexObject = new Complex\Complex($complexString);
166-
echo Complex\pow($complexObject, 2);
143+
echo Complex\Functions::pow($complexObject, 2);
167144
```
168145
or pass the additional argument when calling the method
169146
```php

classes/Autoloader.php

-53
This file was deleted.

classes/Bootstrap.php

-37
This file was deleted.

classes/src/functions/abs.php

-31
This file was deleted.

classes/src/functions/acos.php

-24
This file was deleted.

classes/src/functions/acosh.php

-24
This file was deleted.

classes/src/functions/acot.php

-25
This file was deleted.

classes/src/functions/acoth.php

-25
This file was deleted.

classes/src/functions/acsc.php

-25
This file was deleted.

classes/src/functions/acsch.php

-25
This file was deleted.

classes/src/functions/argument.php

-30
This file was deleted.

classes/src/functions/asec.php

-25
This file was deleted.

0 commit comments

Comments
 (0)