@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | foreach ($this->relations as $localAlias => $remoteColumn) { |
137 | 137 | $this->queryBuilder->addColumn($this->getTable(), $remoteColumn, $localAlias); |
138 | 138 | } |
139 | - $this->queryBuilder->setLimits(0,1); |
|
139 | + $this->queryBuilder->setLimits(0, 1); |
|
140 | 140 | |
141 | 141 | // query itself |
142 | 142 | $lines = $this->database->query(strval($this->dialect->select($this->queryBuilder)), $this->queryBuilder->getParams()); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | // query itself |
194 | - $this->queryBuilder->setLimits(0,1); |
|
194 | + $this->queryBuilder->setLimits(0, 1); |
|
195 | 195 | $lines = $this->database->query(strval($this->dialect->select($this->queryBuilder)), $this->queryBuilder->getParams()); |
196 | 196 | if (empty($lines)) { |
197 | 197 | return false; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $entry = $record->getEntry($primaryKey); |
49 | 49 | if (in_array($entry->getType(), [IEntryType::TYPE_INTEGER, IEntryType::TYPE_FLOAT])) { |
50 | 50 | if (empty($entry->getData())) { |
51 | - $data = empty($records) ? 1 : intval(max(array_column($records, $primaryKey))) + 1 ; |
|
51 | + $data = empty($records) ? 1 : intval(max(array_column($records, $primaryKey))) + 1; |
|
52 | 52 | $entry->setData($data); |
53 | 53 | } |
54 | 54 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | foreach ($this->records as $knownKey => $knownRecord) { |
192 | - if ( !isset($toProcess[$knownKey]) ) { // not twice |
|
192 | + if (!isset($toProcess[$knownKey])) { // not twice |
|
193 | 193 | continue; |
194 | 194 | } |
195 | 195 | if ($usePks && !in_array($objectKey, $this->primaryKeys)) { // is not PK |
@@ -198,17 +198,17 @@ discard block |
||
198 | 198 | if ($wantFromStorage && !$knownRecord->getEntry($objectKey)->isFromStorage()) { // look through only values known in storage |
199 | 199 | continue; |
200 | 200 | } |
201 | - if ( !$knownRecord->offsetExists($objectKey) ) { // unknown relation key in record is not allowed into compare |
|
201 | + if (!$knownRecord->offsetExists($objectKey)) { // unknown relation key in record is not allowed into compare |
|
202 | 202 | // @codeCoverageIgnoreStart |
203 | 203 | unset($toProcess[$knownKey]); |
204 | 204 | continue; |
205 | 205 | } |
206 | 206 | // @codeCoverageIgnoreEnd |
207 | - if ( empty($knownRecord->offsetGet($objectKey)) ) { // empty input is not need to compare |
|
207 | + if (empty($knownRecord->offsetGet($objectKey))) { // empty input is not need to compare |
|
208 | 208 | unset($toProcess[$knownKey]); |
209 | 209 | continue; |
210 | 210 | } |
211 | - if ( strval($knownRecord->offsetGet($objectKey)) != strval($record->offsetGet($objectKey)) ) { |
|
211 | + if (strval($knownRecord->offsetGet($objectKey)) != strval($record->offsetGet($objectKey))) { |
|
212 | 212 | unset($toProcess[$knownKey]); |
213 | 213 | continue; |
214 | 214 | } |
@@ -294,6 +294,6 @@ discard block |
||
294 | 294 | foreach ($this->primaryKeys as $key) { |
295 | 295 | $toComplete[] = $record->offsetGet($key); |
296 | 296 | } |
297 | - return (count(array_filter($toComplete))) ? implode('_', $toComplete) : null ; |
|
297 | + return (count(array_filter($toComplete))) ? implode('_', $toComplete) : null; |
|
298 | 298 | } |
299 | 299 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | protected function correctTable(string $table): string |
400 | 400 | { |
401 | - return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table ; |
|
401 | + return empty($table) ? $this->basicRecord->getMapper()->getAlias() : $table; |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | protected function correctColumn(string $table, string $column) |
411 | 411 | { |
412 | - $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord ; |
|
412 | + $record = !empty($table) ? $this->recordLookup($table)->getRecord() : $this->basicRecord; |
|
413 | 413 | $relations = $record->getMapper()->getRelations(); |
414 | 414 | if (empty($relations[$column])) { |
415 | 415 | throw new MapperException(sprintf('Unknown relation key *%s* in mapper for table *%s*', $column, $table)); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $this->record = $record; |
28 | 28 | $this->parentAlias = $parentAlias; |
29 | 29 | $this->storeKey = $storeKey; |
30 | - $this->knownAs = empty($knownAs) ? $storeKey : $knownAs ; |
|
30 | + $this->knownAs = empty($knownAs) ? $storeKey : $knownAs; |
|
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | } |
36 | 36 | foreach ($this->recordsInJoin as $record) { |
37 | 37 | $foreignKeys = $record->getRecord()->getMapper()->getForeignKeys(); |
38 | - $fk = empty($knownAs) ? $storeKey : $knownAs ; |
|
38 | + $fk = empty($knownAs) ? $storeKey : $knownAs; |
|
39 | 39 | if (isset($foreignKeys[$fk])) { |
40 | 40 | $recordClassName = $foreignKeys[$fk]->getRemoteRecord(); |
41 | 41 | /** @var ARecord $thatRecord */ |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | // paging |
122 | 122 | return $limited |
123 | 123 | ? array_slice($results, intval($this->queryBuilder->getOffset()), $this->queryBuilder->getLimit()) |
124 | - : $results ; |
|
124 | + : $results; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $columnKey = $this->condition->getColumnKey(); |
210 | 210 | return is_array($columnKey) |
211 | 211 | ? $this->filterFromManyValues($this->condition->getOperation(), $result->offsetGet($this->condition->getColumnName()), $this->queryBuilder->getParams(), $columnKey) |
212 | - : $this->checkCondition($this->condition->getOperation(), $result->offsetGet($this->condition->getColumnName()), $this->queryBuilder->getParams()[$columnKey] ) |
|
212 | + : $this->checkCondition($this->condition->getOperation(), $result->offsetGet($this->condition->getColumnName()), $this->queryBuilder->getParams()[$columnKey]) |
|
213 | 213 | ; |
214 | 214 | } |
215 | 215 | |
@@ -283,6 +283,6 @@ discard block |
||
283 | 283 | $a = $resultA->offsetGet($this->sortingOrder->getColumnName()); |
284 | 284 | $b = $resultB->offsetGet($this->sortingOrder->getColumnName()); |
285 | 285 | |
286 | - return (IQueryBuilder::ORDER_ASC == $sortingDirection) ? $a <=> $b : $b <=> $a ; |
|
286 | + return (IQueryBuilder::ORDER_ASC == $sortingDirection) ? $a <=> $b : $b <=> $a; |
|
287 | 287 | } |
288 | 288 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | protected function parseProperty(string $property): array |
37 | 37 | { |
38 | 38 | $separated = explode(static::$propertySeparator, $property, 2); |
39 | - return ((false !== $separated) && (1 < count($separated)) && mb_strlen($separated[0]) && mb_strlen($separated[1]) ) |
|
39 | + return ((false !== $separated) && (1 < count($separated)) && mb_strlen($separated[0]) && mb_strlen($separated[1])) |
|
40 | 40 | ? $separated |
41 | 41 | : ['', $property] |
42 | 42 | ; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | /** @var int[] */ |
31 | 31 | protected static $types = [IEntryType::TYPE_BOOLEAN, IEntryType::TYPE_INTEGER, IEntryType::TYPE_FLOAT, IEntryType::TYPE_STRING, |
32 | - IEntryType::TYPE_SET, IEntryType::TYPE_ARRAY, IEntryType::TYPE_OBJECT]; |
|
32 | + IEntryType::TYPE_SET, IEntryType::TYPE_ARRAY, IEntryType::TYPE_OBJECT]; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Mapper constructor. |
@@ -115,7 +115,7 @@ |
||
115 | 115 | #[\ReturnTypeWillChange] |
116 | 116 | final public function current() |
117 | 117 | { |
118 | - return $this->valid() ? $this->offsetGet($this->key) : null ; |
|
118 | + return $this->valid() ? $this->offsetGet($this->key) : null; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | final public function next(): void |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @param Entry $entry |
18 | 18 | * @param mixed $value |
19 | 19 | */ |
20 | - protected function typedFill(Entry &$entry, $value): void |
|
20 | + protected function typedFill(Entry & $entry, $value): void |
|
21 | 21 | { |
22 | 22 | $entry->setData($this->typedFillSelection($entry, $value)); |
23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param mixed $dbValue |
28 | 28 | * @return bool|float|int|string |
29 | 29 | */ |
30 | - protected function typedFillSelection(Entry &$entry, $dbValue) |
|
30 | + protected function typedFillSelection(Entry & $entry, $dbValue) |
|
31 | 31 | { |
32 | 32 | switch ($entry->getType()) { |
33 | 33 | case IEntryType::TYPE_BOOLEAN: |