@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | ['The', 'Dude'] |
| 18 | 18 | ]; |
| 19 | 19 | |
| 20 | -foreach($people as $person) {
|
|
| 20 | +foreach ($people as $person) {
|
|
| 21 | 21 | $parameters = array( |
| 22 | 22 | ':firstname' => $person[0], |
| 23 | 23 | ':lastname' => $person[1] |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // And now we can query the DB |
| 60 | 60 | $people = $queryAdapter->executeQuery('SELECT firstname, lastname FROM people', Person::class);
|
| 61 | 61 | |
| 62 | -foreach($people as $person) {
|
|
| 62 | +foreach ($people as $person) {
|
|
| 63 | 63 | /** @var Person $person */ |
| 64 | 64 | printf('%s %s%s', $person->getFirstname(), $person->getLastname(), PHP_EOL);
|
| 65 | 65 | } |
| 66 | 66 | \ No newline at end of file |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | $methods = $entityReflection->getMethods(\ReflectionMethod::IS_PUBLIC); |
| 13 | 13 | |
| 14 | 14 | $entityFields = []; |
| 15 | - foreach($methods as $method) {
|
|
| 15 | + foreach ($methods as $method) {
|
|
| 16 | 16 | $methodName = $method->getName(); |
| 17 | 17 | |
| 18 | - if(!strpos($methodName, 'get') === 0) {
|
|
| 18 | + if (!strpos($methodName, 'get') === 0) {
|
|
| 19 | 19 | continue; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | $entityFields[lcfirst(substr($methodName, 3))] = [ |
| 23 | - 'type' => $method->getReturnType() === NULL ? 'string' : (string)$method->getReturnType() |
|
| 23 | + 'type' => $method->getReturnType() === NULL ? 'string' : (string) $method->getReturnType() |
|
| 24 | 24 | ]; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | namespace Agares\MicroORM; |
| 4 | 4 | |
| 5 | 5 | class EntityMapper implements EntityMapperInterface |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * {@inheritdoc}
|
| 19 | - */ |
|
| 19 | + */ |
|
| 20 | 20 | public function executeCommand(string $command, array $parameters = array()) |
| 21 | 21 | {
|
| 22 | 22 | $this->executeParameterisedQuery($command, $parameters); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | {
|
| 37 | 37 | $statement = $this->pdo->prepare($query); |
| 38 | 38 | |
| 39 | - foreach($parameters as $name => $value) {
|
|
| 39 | + foreach ($parameters as $name => $value) {
|
|
| 40 | 40 | $statement->bindValue($name, $value); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | {
|
| 31 | 31 | $queryResult = $this->dbAdapter->executeQuery($query, $parameters); |
| 32 | 32 | $entities = []; |
| 33 | - foreach($queryResult as $resultItem) {
|
|
| 33 | + foreach ($queryResult as $resultItem) {
|
|
| 34 | 34 | $entities[] = $this->entityMapper->map($resultItem, $entityClassName); |
| 35 | 35 | } |
| 36 | 36 | |