@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * Add an object to this collection |
| 21 | 21 | * @param object $object The object you want to add |
| 22 | 22 | * |
| 23 | - * @return True when added with success, else false |
|
| 23 | + * @return boolean when added with success, else false |
|
| 24 | 24 | */ |
| 25 | 25 | public function add($object) |
| 26 | 26 | { |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | if (is_string($type)) { // Collection of object |
| 40 | 40 | |
| 41 | - $this->validateTypeFct = function ($object) use ($type) { |
|
| 41 | + $this->validateTypeFct = function($object) use ($type) { |
|
| 42 | 42 | return ($object instanceof $type); |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 | if ($equalsFct === null) { |
| 46 | 46 | $arrayOfInterface = class_implements($type); |
| 47 | 47 | if (in_array("Ducatel\\PHPCollection\\Base\\Equatable", $arrayOfInterface)) { |
| 48 | - $this->equalsFct = function ($obj1, $obj2) { |
|
| 48 | + $this->equalsFct = function($obj1, $obj2) { |
|
| 49 | 49 | return $obj1->equals($obj2); |
| 50 | 50 | }; |
| 51 | 51 | } else { |
| 52 | - $this->equalsFct = function ($obj1, $obj2) { |
|
| 52 | + $this->equalsFct = function($obj1, $obj2) { |
|
| 53 | 53 | return $obj1 === $obj2; |
| 54 | 54 | }; |
| 55 | 55 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $this->validateTypeFct = $type; |
| 61 | 61 | |
| 62 | 62 | if ($equalsFct === null) { |
| 63 | - $this->equalsFct = function ($obj1, $obj2) { |
|
| 63 | + $this->equalsFct = function($obj1, $obj2) { |
|
| 64 | 64 | return $obj1 === $obj2; |
| 65 | 65 | }; |
| 66 | 66 | } else { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct() |
| 20 | 20 | { |
| 21 | - $isNumber = function ($obj) { |
|
| 21 | + $isNumber = function($obj) { |
|
| 22 | 22 | return is_numeric($obj); |
| 23 | 23 | }; |
| 24 | 24 | |
@@ -18,16 +18,16 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct(bool $caseSensitive = true) |
| 20 | 20 | { |
| 21 | - $isStringFct = function ($obj) { |
|
| 21 | + $isStringFct = function($obj) { |
|
| 22 | 22 | return is_string($obj); |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | if ($caseSensitive) { |
| 26 | - $isEquals = function ($obj1, $obj2) { |
|
| 26 | + $isEquals = function($obj1, $obj2) { |
|
| 27 | 27 | return (strcmp($obj1, $obj2) == 0); |
| 28 | 28 | }; |
| 29 | 29 | } else { |
| 30 | - $isEquals = function ($obj1, $obj2) { |
|
| 30 | + $isEquals = function($obj1, $obj2) { |
|
| 31 | 31 | return (strcasecmp($obj1, $obj2) == 0); |
| 32 | 32 | }; |
| 33 | 33 | } |