@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return null|ModelInterface |
48 | 48 | */ |
49 | - public function findOneBy(array $criteria = []) |
|
49 | + public function findOneBy(array $criteria = [ ]) |
|
50 | 50 | { |
51 | 51 | $qb = $this->getFindByQueryBuilder($criteria)->setMaxResults(1); |
52 | 52 | |
@@ -66,20 +66,20 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return ModelInterface[]|array |
68 | 68 | */ |
69 | - public function findBy(array $criteria = []): array |
|
69 | + public function findBy(array $criteria = [ ]): array |
|
70 | 70 | { |
71 | 71 | $rows = $this->getFindByQueryBuilder($criteria)->execute()->fetchAll(\PDO::FETCH_ASSOC); |
72 | 72 | |
73 | - if ([] === $rows) { |
|
74 | - return []; |
|
73 | + if ([ ] === $rows) { |
|
74 | + return [ ]; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** @var ModelInterface $modelClass */ |
78 | 78 | $modelClass = $this->getModelClass(); |
79 | 79 | |
80 | - $models = []; |
|
80 | + $models = [ ]; |
|
81 | 81 | foreach ($rows as $row) { |
82 | - $models[] = $modelClass::fromRow($row); |
|
82 | + $models[ ] = $modelClass::fromRow($row); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | return $models; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return QueryBuilder |
92 | 92 | */ |
93 | - private function getFindByQueryBuilder(array $criteria = []): QueryBuilder |
|
93 | + private function getFindByQueryBuilder(array $criteria = [ ]): QueryBuilder |
|
94 | 94 | { |
95 | 95 | $qb = $this->connection->createQueryBuilder(); |
96 | 96 | $qb->select('*')->from($this->getTable()); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function update(ModelInterface $model) |
118 | 118 | { |
119 | - $this->connection->update($this->getTable(), $model->toRow(), ['id' => $model->getId()]); |
|
119 | + $this->connection->update($this->getTable(), $model->toRow(), [ 'id' => $model->getId() ]); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function delete(ModelInterface $model) |
126 | 126 | { |
127 | - $this->connection->delete($this->getTable(), ['id' => $model->getId()]); |
|
127 | + $this->connection->delete($this->getTable(), [ 'id' => $model->getId() ]); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |