@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return null|ModelInterface |
47 | 47 | */ |
48 | - public function findOneBy(array $criteria = []) |
|
48 | + public function findOneBy(array $criteria = [ ]) |
|
49 | 49 | { |
50 | 50 | $qb = $this->connection->createQueryBuilder(); |
51 | 51 | $qb->select('*')->from($this->getTablename())->setMaxResults(1); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return ModelInterface[]|array |
73 | 73 | */ |
74 | - public function findBy(array $criteria = []): array |
|
74 | + public function findBy(array $criteria = [ ]): array |
|
75 | 75 | { |
76 | 76 | $qb = $this->connection->createQueryBuilder(); |
77 | 77 | $qb->select('*')->from($this->getTablename()); |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | |
84 | 84 | $rows = $qb->execute()->fetchAll(\PDO::FETCH_ASSOC); |
85 | 85 | |
86 | - if ([] === $rows) { |
|
87 | - return []; |
|
86 | + if ([ ] === $rows) { |
|
87 | + return [ ]; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** @var ModelInterface $modelClass */ |
91 | 91 | $modelClass = $this->getModelClass(); |
92 | 92 | |
93 | - $models = []; |
|
93 | + $models = [ ]; |
|
94 | 94 | foreach ($rows as $row) { |
95 | - $models[] = $modelClass::fromRow($row); |
|
95 | + $models[ ] = $modelClass::fromRow($row); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $models; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function update(ModelInterface $model) |
113 | 113 | { |
114 | - $this->connection->update($this->getTablename(), $model->toRow(), ['id' => $model->getId()]); |
|
114 | + $this->connection->update($this->getTablename(), $model->toRow(), [ 'id' => $model->getId() ]); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function delete(ModelInterface $model) |
121 | 121 | { |
122 | - $this->connection->delete($this->getTablename(), ['id' => $model->getId()]); |
|
122 | + $this->connection->delete($this->getTablename(), [ 'id' => $model->getId() ]); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |