@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @return ModelInterface[]array |
| 27 | 27 | */ |
| 28 | - public function findBy(array $criteria = []): array; |
|
| 28 | + public function findBy(array $criteria = [ ]): array; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @param array $criteria |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @throws NotUniqueException |
| 36 | 36 | */ |
| 37 | - public function findOneBy(array $criteria = []); |
|
| 37 | + public function findOneBy(array $criteria = [ ]); |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * @param ModelInterface $model |
@@ -40,6 +40,7 @@ discard block |
||
| 40 | 40 | * @param ModelInterface $model |
| 41 | 41 | * |
| 42 | 42 | * @throws AlreadyKnownException |
| 43 | + * @return void |
|
| 43 | 44 | */ |
| 44 | 45 | public function insert(ModelInterface $model); |
| 45 | 46 | |
@@ -47,6 +48,7 @@ discard block |
||
| 47 | 48 | * @param ModelInterface $model |
| 48 | 49 | * |
| 49 | 50 | * @throws UnknownException |
| 51 | + * @return void |
|
| 50 | 52 | */ |
| 51 | 53 | public function update(ModelInterface $model); |
| 52 | 54 | |
@@ -54,6 +56,7 @@ discard block |
||
| 54 | 56 | * @param ModelInterface $model |
| 55 | 57 | * |
| 56 | 58 | * @throws UnknownException |
| 59 | + * @return void |
|
| 57 | 60 | */ |
| 58 | 61 | public function delete(ModelInterface $model); |
| 59 | 62 | } |
@@ -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 | /** |