@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC\Orm\Interfaces; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC\Orm; |
| 4 | 4 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | private function keyValueFormat(array $keys, array $values): array |
| 110 | 110 | { |
| 111 | 111 | return array_map( |
| 112 | - function (string $key, string $placeholder) { |
|
| 112 | + function(string $key, string $placeholder) { |
|
| 113 | 113 | return sprintf('%s = %s', $key, $placeholder); |
| 114 | 114 | }, |
| 115 | 115 | array_keys($keys), |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC\Orm; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC\Orm; |
| 4 | 4 | |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | public function saveEntity(Entity $entity): PDOStatement |
| 54 | 54 | { |
| 55 | 55 | $data = $entity->getData(); |
| 56 | - $id = (int)$entity->id; |
|
| 56 | + $id = (int) $entity->id; |
|
| 57 | 57 | if ($id > 0 && $this->findById($id)) { |
| 58 | 58 | $result = $this->exec( |
| 59 | - (string)$this->getBuilder()->update($data)->byId($id), |
|
| 59 | + (string) $this->getBuilder()->update($data)->byId($id), |
|
| 60 | 60 | $this->getBuilder()->getPlaceholders() |
| 61 | 61 | ); |
| 62 | 62 | } else { |
| 63 | 63 | $result = $this->exec( |
| 64 | - (string)$this->getBuilder()->insert($data), |
|
| 64 | + (string) $this->getBuilder()->insert($data), |
|
| 65 | 65 | $this->getBuilder()->getPlaceholders() |
| 66 | 66 | ); |
| 67 | 67 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function findById(int $id)//: ?Entity |
| 77 | 77 | { |
| 78 | 78 | $entity = $this->getEntity( |
| 79 | - (string)$this->getBuilder()->select()->byId($id), |
|
| 79 | + (string) $this->getBuilder()->select()->byId($id), |
|
| 80 | 80 | $this->getBuilder()->getPlaceholders() |
| 81 | 81 | ); |
| 82 | 82 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function deleteEntity(Entity $entity): int |
| 138 | 138 | { |
| 139 | - return $this->exec((string)$this->getBuilder()->delete()->byId((int)$entity->getId()), |
|
| 139 | + return $this->exec((string) $this->getBuilder()->delete()->byId((int) $entity->getId()), |
|
| 140 | 140 | $this->getBuilder()->getPlaceholders())->rowCount(); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function findAll(): array |
| 147 | 147 | { |
| 148 | 148 | return $this->getEntity( |
| 149 | - (string)$this->getBuilder()->select(), |
|
| 149 | + (string) $this->getBuilder()->select(), |
|
| 150 | 150 | $this->getBuilder()->getPlaceholders() |
| 151 | 151 | ); |
| 152 | 152 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace DrMVC\Orm; |
| 4 | 4 | |