@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function getColumnsForTable($tableIdentifier) |
61 | 61 | { |
62 | - return array_filter($this->columnInfoList, function (ColumnInfo $columnInfo) use ($tableIdentifier) { |
|
62 | + return array_filter($this->columnInfoList, function(ColumnInfo $columnInfo) use ($tableIdentifier) { |
|
63 | 63 | return ($columnInfo->getTableInfo()->getIdentifier() === $tableIdentifier); |
64 | 64 | }); |
65 | 65 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | parent::__construct($connection); |
26 | 26 | if ($entityFactory) { |
27 | - $this->setupResult('setRowFactory', function (array $data) use ($entityFactory, $entityMapping) { |
|
27 | + $this->setupResult('setRowFactory', function(array $data) use ($entityFactory, $entityMapping) { |
|
28 | 28 | return $entityFactory->createEntity($entityMapping->getEntityClassName(), $data); |
29 | 29 | }); |
30 | 30 | } |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | |
87 | 87 | $additionalTables = []; |
88 | 88 | if ($additionalTableList !== null) { |
89 | - $additionalTables = array_filter($tables, function (TableInfo $tableInfo) use ($additionalTableList) { |
|
89 | + $additionalTables = array_filter($tables, function(TableInfo $tableInfo) use ($additionalTableList) { |
|
90 | 90 | return in_array($tableInfo->getIdentifier(), $additionalTableList); |
91 | 91 | }); |
92 | 92 | } |
93 | 93 | |
94 | - $innerJoinTables = array_filter($tables, function (TableInfo $tableInfo) { |
|
94 | + $innerJoinTables = array_filter($tables, function(TableInfo $tableInfo) { |
|
95 | 95 | return (strtolower(substr($tableInfo->getSqlJoinCode(), 0, 5)) === 'inner'); |
96 | 96 | }); |
97 | 97 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | // tables that should not be important to select correct row (ie. left joins) |
123 | 123 | /** @var TableInfo[] $optionalTables */ |
124 | - $optionalTables = array_filter($this->entityMapping->getTables(), function (TableInfo $tableInfo) { |
|
124 | + $optionalTables = array_filter($this->entityMapping->getTables(), function(TableInfo $tableInfo) { |
|
125 | 125 | return (strtolower(substr($tableInfo->getSqlJoinCode(), 0, 4)) === 'left'); |
126 | 126 | }); |
127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | foreach ($optionalTables as $tableInfo) { |
131 | 131 | $propertyInfoList = $this->entityMapping->getColumnsForTable($tableInfo->getIdentifier()); |
132 | 132 | |
133 | - $tablePropertyNames = array_map(function (ColumnInfo $columnInfo) { |
|
133 | + $tablePropertyNames = array_map(function(ColumnInfo $columnInfo) { |
|
134 | 134 | return $columnInfo->getPropertyName(); |
135 | 135 | }, $propertyInfoList); |
136 | 136 |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | private function addPKToFluent(IEntity $entity, $tableName, $columns, \Dibi\Fluent $fluent) |
251 | 251 | { |
252 | 252 | /** @var ColumnInfo[] $pkColumns */ |
253 | - $pkColumns = array_filter($columns, function (ColumnInfo $columnInfo) { |
|
253 | + $pkColumns = array_filter($columns, function(ColumnInfo $columnInfo) { |
|
254 | 254 | return $columnInfo->isPrimaryKey(); |
255 | 255 | }); |
256 | 256 | if (!count($pkColumns)) { |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | protected function getEntityPropertyValue(IEntity $entity, ColumnInfo $property) |
322 | 322 | { |
323 | 323 | $propName = $property->getPropertyName(); |
324 | - $getterPk = \Closure::bind(function () use ($propName) { |
|
324 | + $getterPk = \Closure::bind(function() use ($propName) { |
|
325 | 325 | return $this->{$propName}; |
326 | 326 | }, $entity, get_class($entity)); |
327 | 327 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | { |
338 | 338 | $columnInfoListToUpdate = array_filter( |
339 | 339 | $columnInfos, |
340 | - function (ColumnInfo $columnInfo) use ($changedProperties) { |
|
340 | + function(ColumnInfo $columnInfo) use ($changedProperties) { |
|
341 | 341 | // never update a PK |
342 | 342 | if ($columnInfo->isPrimaryKey()) { |
343 | 343 | return false; |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | $tableInfos = $mapping->getTables(); |
371 | 371 | if (!is_null($tables)) { |
372 | 372 | // grab TableInfo of given $tables |
373 | - $tableInfos = array_map(function ($tableName) use ($tableInfos, $entity) { |
|
374 | - if (!isset($tableInfos[ $tableName ])) { |
|
373 | + $tableInfos = array_map(function($tableName) use ($tableInfos, $entity) { |
|
374 | + if (!isset($tableInfos[$tableName])) { |
|
375 | 375 | throw new UnableToSaveException(sprintf('Unable to save entity: `%s`, unknown table `%s`', |
376 | 376 | get_class($entity), $tableName)); |
377 | 377 | } |
378 | 378 | |
379 | - return $tableInfos[ $tableName ]; |
|
379 | + return $tableInfos[$tableName]; |
|
380 | 380 | }, $tables); |
381 | 381 | } |
382 | 382 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | /** @var ColumnInfo[] $columnInfos */ |
394 | 394 | $columnInfos = []; |
395 | 395 | foreach ($mapping->getColumnsForTable($tableInfo->getIdentifier()) as $columnInfo) { |
396 | - $columnInfos[ $columnInfo->getPropertyName() ] = $columnInfo; |
|
396 | + $columnInfos[$columnInfo->getPropertyName()] = $columnInfo; |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | return $columnInfos; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | // ... then we can find DB mapping for those properties |
419 | 419 | $changedColumnInfos = array_filter( |
420 | 420 | $columnInfos, |
421 | - function (ColumnInfo $columnInfo) use ($changedProperties) { |
|
421 | + function(ColumnInfo $columnInfo) use ($changedProperties) { |
|
422 | 422 | return in_array($columnInfo->getPropertyName(), $changedProperties); |
423 | 423 | } |
424 | 424 | ); |