@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class InvalidOperationException |
| 39 | 39 | * @package Platine\Collection\Exception |
| 40 | 40 | */ |
| 41 | -class InvalidOperationException extends Exception |
|
| 42 | -{ |
|
| 41 | +class InvalidOperationException extends Exception { |
|
| 43 | 42 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @package Platine\Collection |
| 52 | 52 | * @template T |
| 53 | 53 | */ |
| 54 | -interface MergeableInterface |
|
| 55 | -{ |
|
| 54 | +interface MergeableInterface { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * Merge with the given collection |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * Class IterableInterface |
| 51 | 51 | * @package Platine\Collection |
| 52 | 52 | */ |
| 53 | -interface IterableInterface |
|
| 54 | -{ |
|
| 53 | +interface IterableInterface { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * Loop on each collection element with the given callback |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @package Platine\Collection |
| 52 | 52 | * @template T |
| 53 | 53 | */ |
| 54 | -interface SortableInterface |
|
| 55 | -{ |
|
| 54 | +interface SortableInterface { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * Sort the collection |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * Class CollectionInterface |
| 51 | 51 | * @package Platine\Collection |
| 52 | 52 | */ |
| 53 | -interface CollectionInterface |
|
| 54 | -{ |
|
| 53 | +interface CollectionInterface { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * Add element to the collection |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class TypeCheck |
| 53 | 53 | * @package Platine\Collection |
| 54 | 54 | */ |
| 55 | -class TypeCheck |
|
| 56 | -{ |
|
| 55 | +class TypeCheck { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * Class MapInterface |
| 51 | 51 | * @package Platine\Collection\Map |
| 52 | 52 | */ |
| 53 | -interface MapInterface |
|
| 54 | -{ |
|
| 53 | +interface MapInterface { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * Add element to the collection |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class Pair |
| 51 | 51 | * @package Platine\Collection\Map |
| 52 | 52 | */ |
| 53 | -class Pair |
|
| 54 | -{ |
|
| 53 | +class Pair { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | * @param mixed $key |
| 71 | 70 | * @param mixed $value |
| 72 | 71 | */ |
| 73 | - public function __construct($key, $value) |
|
| 74 | - { |
|
| 72 | + public function __construct($key, $value) { |
|
| 75 | 73 | $this->key = $key; |
| 76 | 74 | $this->value = $value; |
| 77 | 75 | } |
@@ -80,8 +78,7 @@ discard block |
||
| 80 | 78 | * |
| 81 | 79 | * @return mixed |
| 82 | 80 | */ |
| 83 | - public function getKey() |
|
| 84 | - { |
|
| 81 | + public function getKey() { |
|
| 85 | 82 | return $this->key; |
| 86 | 83 | } |
| 87 | 84 | |
@@ -89,8 +86,7 @@ discard block |
||
| 89 | 86 | * |
| 90 | 87 | * @return mixed |
| 91 | 88 | */ |
| 92 | - public function getValue() |
|
| 93 | - { |
|
| 89 | + public function getValue() { |
|
| 94 | 90 | return $this->value; |
| 95 | 91 | } |
| 96 | 92 | |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * Class Stack |
| 55 | 55 | * @package Platine\Collection\Stack |
| 56 | 56 | */ |
| 57 | -class Stack implements Countable |
|
| 58 | -{ |
|
| 57 | +class Stack implements Countable { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | * Create new instance |
| 74 | 73 | * @param string $type |
| 75 | 74 | */ |
| 76 | - public function __construct(string $type) |
|
| 77 | - { |
|
| 75 | + public function __construct(string $type) { |
|
| 78 | 76 | $this->data = []; |
| 79 | 77 | $this->type = $type; |
| 80 | 78 | } |
@@ -108,8 +106,7 @@ discard block |
||
| 108 | 106 | /** |
| 109 | 107 | * @return mixed |
| 110 | 108 | */ |
| 111 | - public function peek() |
|
| 112 | - { |
|
| 109 | + public function peek() { |
|
| 113 | 110 | if ($this->isEmpty()) { |
| 114 | 111 | throw new InvalidOperationException('The collection is empty'); |
| 115 | 112 | } |
@@ -121,8 +118,7 @@ discard block |
||
| 121 | 118 | * |
| 122 | 119 | * @return mixed |
| 123 | 120 | */ |
| 124 | - public function pop() |
|
| 125 | - { |
|
| 121 | + public function pop() { |
|
| 126 | 122 | return array_pop($this->data); |
| 127 | 123 | } |
| 128 | 124 | |
@@ -132,8 +128,7 @@ discard block |
||
| 132 | 128 | * @param mixed $value |
| 133 | 129 | * @return mixed |
| 134 | 130 | */ |
| 135 | - public function push($value) |
|
| 136 | - { |
|
| 131 | + public function push($value) { |
|
| 137 | 132 | TypeCheck::isValueOf( |
| 138 | 133 | $value, |
| 139 | 134 | $this->type, |