@@ -30,18 +30,18 @@ |
||
| 30 | 30 | if (is_callable($type)) { |
| 31 | 31 | $this->validateTypeFct = $type; |
| 32 | 32 | } else { |
| 33 | - $this->validateTypeFct = function ($object) use ($type) { |
|
| 33 | + $this->validateTypeFct = function($object) use ($type) { |
|
| 34 | 34 | return ($object instanceof $type); |
| 35 | 35 | }; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if ($equalsFct === null) { |
| 39 | 39 | if (is_callable($type)) { |
| 40 | - $this->equalsFct = function ($obj1, $obj2) { |
|
| 40 | + $this->equalsFct = function($obj1, $obj2) { |
|
| 41 | 41 | return $obj1 === $obj2; |
| 42 | 42 | }; |
| 43 | 43 | } else { |
| 44 | - $this->equalsFct = function ($obj1, $obj2) { |
|
| 44 | + $this->equalsFct = function($obj1, $obj2) { |
|
| 45 | 45 | return $obj1->equals($obj2); |
| 46 | 46 | }; |
| 47 | 47 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 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 | { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param Integer $key The key (index) of object in the collection. |
| 39 | 39 | * |
| 40 | - * @return false|object The deleted object or false if not found |
|
| 40 | + * @return boolean The deleted object or false if not found |
|
| 41 | 41 | * @throws \TypeError Throw when key is not an integer |
| 42 | 42 | */ |
| 43 | 43 | public function delete($key) |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function testWithBool() { |
| 13 | 13 | |
| 14 | - $typedArray = new TypedArray( function($obj){ return is_bool($obj);}); |
|
| 14 | + $typedArray = new TypedArray(function($obj) { return is_bool($obj); }); |
|
| 15 | 15 | $this->assertEquals(0, $typedArray->count()); |
| 16 | 16 | |
| 17 | 17 | $this->assertFalse($typedArray->add("test")); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $total = $typedArray->count(); |
| 34 | 34 | $typedArray->delete(0); |
| 35 | - $this->assertEquals($total -1 , $typedArray->count()); |
|
| 35 | + $this->assertEquals($total - 1, $typedArray->count()); |
|
| 36 | 36 | |
| 37 | 37 | $typedArray->contains(42); |
| 38 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @expectedException \TypeError |
| 42 | 42 | */ |
| 43 | 43 | public function testWithString() { |
| 44 | - $typedArray = new TypedArray( function($obj){ return is_string($obj);}); |
|
| 44 | + $typedArray = new TypedArray(function($obj) { return is_string($obj); }); |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | $this->assertFalse($typedArray->add(true)); |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function testWithCustomEqualsFunction() { |
| 93 | 93 | |
| 94 | - $isStringFct = function($obj){ return is_string($obj);}; |
|
| 95 | - $isEquals = function ($obj1, $obj2){ return (strcasecmp($obj1, $obj2) == 0);}; |
|
| 94 | + $isStringFct = function($obj) { return is_string($obj); }; |
|
| 95 | + $isEquals = function($obj1, $obj2) { return (strcasecmp($obj1, $obj2) == 0); }; |
|
| 96 | 96 | $typedArray = new TypedArray($isStringFct, $isEquals); |
| 97 | 97 | |
| 98 | 98 | $this->assertFalse($typedArray->add(true)); |