@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model\Cache; |
| 6 | 6 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @var array |
| 11 | 11 | */ |
| 12 | - private $cache = []; |
|
| 12 | + private $cache = [ ]; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @param string $id |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function set(string $id, array $entry): ModelCacheInterface |
| 21 | 21 | { |
| 22 | - $this->cache[$id] = $entry; |
|
| 22 | + $this->cache[ $id ] = $entry; |
|
| 23 | 23 | |
| 24 | 24 | return $this; |
| 25 | 25 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | throw EntryNotFoundException::fromId($id); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - return $this->cache[$id]; |
|
| 50 | + return $this->cache[ $id ]; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function remove(string $id): ModelCacheInterface |
| 59 | 59 | { |
| 60 | - unset($this->cache[$id]); |
|
| 60 | + unset($this->cache[ $id ]); |
|
| 61 | 61 | |
| 62 | 62 | return $this; |
| 63 | 63 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model\Collection; |
| 6 | 6 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * @param ModelInterface[]|array $models |
| 23 | 23 | */ |
| 24 | - public function __construct(array $models = []) |
|
| 24 | + public function __construct(array $models = [ ]) |
|
| 25 | 25 | { |
| 26 | 26 | $models = $this->modelsWithIdKey($models); |
| 27 | 27 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | private function modelsWithIdKey(array $models): array |
| 38 | 38 | { |
| 39 | - $modelsWithIdKey = []; |
|
| 39 | + $modelsWithIdKey = [ ]; |
|
| 40 | 40 | foreach ($models as $model) { |
| 41 | 41 | if (!$model instanceof ModelInterface) { |
| 42 | 42 | throw new \InvalidArgumentException( |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | ); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $modelsWithIdKey[$model->getId()] = $model; |
|
| 47 | + $modelsWithIdKey[ $model->getId() ] = $model; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $modelsWithIdKey; |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function jsonSerialize(): array |
| 118 | 118 | { |
| 119 | - $serializedModels = []; |
|
| 119 | + $serializedModels = [ ]; |
|
| 120 | 120 | foreach ($this->models as $model) { |
| 121 | - $serializedModels[] = $model->jsonSerialize(); |
|
| 121 | + $serializedModels[ ] = $model->jsonSerialize(); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | return $serializedModels; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Chubbyphp\Model\Collection; |
| 6 | 6 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | private function modelsWithIdKey(array $models): array |
| 54 | 54 | { |
| 55 | - $modelsWithIdKey = []; |
|
| 55 | + $modelsWithIdKey = [ ]; |
|
| 56 | 56 | foreach ($models as $model) { |
| 57 | 57 | if (!$model instanceof ModelInterface) { |
| 58 | 58 | throw new \InvalidArgumentException( |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | ); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $modelsWithIdKey[$model->getId()] = $model; |
|
| 63 | + $modelsWithIdKey[ $model->getId() ] = $model; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $modelsWithIdKey; |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $this->loadModels(); |
| 152 | 152 | |
| 153 | - $serializedModels = []; |
|
| 153 | + $serializedModels = [ ]; |
|
| 154 | 154 | foreach ($this->models as $model) { |
| 155 | - $serializedModels[] = $model->jsonSerialize(); |
|
| 155 | + $serializedModels[ ] = $model->jsonSerialize(); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | return $serializedModels; |