@@ -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 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | private function addPKToFluent(IEntity $entity, $tableName, $columns, \DibiFluent $fluent) |
246 | 246 | { |
247 | 247 | /** @var ColumnInfo[] $pkColumns */ |
248 | - $pkColumns = array_filter($columns, function (ColumnInfo $columnInfo) { |
|
248 | + $pkColumns = array_filter($columns, function(ColumnInfo $columnInfo) { |
|
249 | 249 | return $columnInfo->isPrimaryKey(); |
250 | 250 | }); |
251 | 251 | if (!count($pkColumns)) { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | protected function getEntityPropertyValue(IEntity $entity, ColumnInfo $property) |
317 | 317 | { |
318 | 318 | $propName = $property->getPropertyName(); |
319 | - $getterPk = \Closure::bind(function () use ($propName) { |
|
319 | + $getterPk = \Closure::bind(function() use ($propName) { |
|
320 | 320 | return $this->{$propName}; |
321 | 321 | }, $entity, get_class($entity)); |
322 | 322 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | { |
333 | 333 | $columnInfoListToUpdate = array_filter( |
334 | 334 | $columnInfos, |
335 | - function (ColumnInfo $columnInfo) use ($changedProperties) { |
|
335 | + function(ColumnInfo $columnInfo) use ($changedProperties) { |
|
336 | 336 | // never update a PK |
337 | 337 | if ($columnInfo->isPrimaryKey()) { |
338 | 338 | return false; |
@@ -365,13 +365,13 @@ discard block |
||
365 | 365 | $tableInfos = $mapping->getTables(); |
366 | 366 | if (!is_null($tables)) { |
367 | 367 | // grab TableInfo of given $tables |
368 | - $tableInfos = array_map(function ($tableName) use ($tableInfos, $entity) { |
|
369 | - if (!isset($tableInfos[ $tableName ])) { |
|
368 | + $tableInfos = array_map(function($tableName) use ($tableInfos, $entity) { |
|
369 | + if (!isset($tableInfos[$tableName])) { |
|
370 | 370 | throw new UnableToSaveException(sprintf('Unable to save entity: `%s`, unknown table `%s`', |
371 | 371 | get_class($entity), $tableName)); |
372 | 372 | } |
373 | 373 | |
374 | - return $tableInfos[ $tableName ]; |
|
374 | + return $tableInfos[$tableName]; |
|
375 | 375 | }, $tables); |
376 | 376 | } |
377 | 377 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | /** @var ColumnInfo[] $columnInfos */ |
389 | 389 | $columnInfos = []; |
390 | 390 | foreach ($mapping->getColumnsForTable($tableInfo->getIdentifier()) as $columnInfo) { |
391 | - $columnInfos[ $columnInfo->getPropertyName() ] = $columnInfo; |
|
391 | + $columnInfos[$columnInfo->getPropertyName()] = $columnInfo; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | return $columnInfos; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | // ... then we can find DB mapping for those properties |
414 | 414 | $changedColumnInfos = array_filter( |
415 | 415 | $columnInfos, |
416 | - function (ColumnInfo $columnInfo) use ($changedProperties) { |
|
416 | + function(ColumnInfo $columnInfo) use ($changedProperties) { |
|
417 | 417 | return in_array($columnInfo->getPropertyName(), $changedProperties); |
418 | 418 | } |
419 | 419 | ); |
@@ -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 |