@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** {@inheritdoc} */ |
| 39 | 39 | public function fetch(Entity $self, EntityManager $entityManager) |
| 40 | 40 | { |
| 41 | - $key = array_map([$self, '__get' ], array_keys($this->reference)); |
|
| 41 | + $key = array_map([$self, '__get'], array_keys($this->reference)); |
|
| 42 | 42 | |
| 43 | 43 | if (in_array(null, $key)) { |
| 44 | 44 | return null; |
@@ -82,6 +82,6 @@ discard block |
||
| 82 | 82 | $expression[] = $alias . '.' . $myVar . ' = ' . $this->name . '.' . $hisVar; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true); |
|
| 85 | + call_user_func([$fetcher, $join], $this->class, implode(' AND ', $expression), $this->name, [], true); |
|
| 86 | 86 | } |
| 87 | 87 | } |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $this->tableName = $entityManager->escapeIdentifier($class::getTableName()); |
| 63 | 63 | $this->alias = 't0'; |
| 64 | - $this->columns = [ 't0.*' ]; |
|
| 65 | - $this->modifier = [ 'DISTINCT' ]; |
|
| 64 | + $this->columns = ['t0.*']; |
|
| 65 | + $this->modifier = ['DISTINCT']; |
|
| 66 | 66 | |
| 67 | 67 | $this->classMapping['byClass'][$class] = 't0'; |
| 68 | 68 | $this->classMapping['byAlias']['t0'] = $class; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $alias = $this->alias; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - call_user_func([ $class, 'getRelation' ], $relation)->addJoin($this, $join, $alias); |
|
| 186 | + call_user_func([$class, 'getRelation'], $relation)->addJoin($this, $join, $alias); |
|
| 187 | 187 | return $this; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | return null; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $class = $this->class; |
|
| 233 | + $class = $this->class; |
|
| 234 | 234 | $newEntity = new $class($data, $this->entityManager, true); |
| 235 | 235 | $entity = $this->entityManager->map($newEntity); |
| 236 | 236 | |
@@ -275,11 +275,11 @@ discard block |
||
| 275 | 275 | public function count() |
| 276 | 276 | { |
| 277 | 277 | // set the columns and reset after get query |
| 278 | - $this->columns = [ 'COUNT(DISTINCT t0.*)' ]; |
|
| 278 | + $this->columns = ['COUNT(DISTINCT t0.*)']; |
|
| 279 | 279 | $this->modifier = []; |
| 280 | 280 | $query = $this->getQuery(); |
| 281 | - $this->columns = [ 't0.*' ]; |
|
| 282 | - $this->modifier = [ 'DISTINCT' ]; |
|
| 281 | + $this->columns = ['t0.*']; |
|
| 282 | + $this->modifier = ['DISTINCT']; |
|
| 283 | 283 | |
| 284 | 284 | return (int) $this->entityManager->getConnection()->query($query)->fetchColumn(); |
| 285 | 285 | } |
@@ -182,7 +182,7 @@ |
||
| 182 | 182 | $em = $em ?: EntityManager::getInstance($class); |
| 183 | 183 | |
| 184 | 184 | /** @var m\Mock|EntityFetcher $fetcher */ |
| 185 | - $fetcher = m::mock(EntityFetcher::class, [ $em, $class ])->makePartial(); |
|
| 185 | + $fetcher = m::mock(EntityFetcher::class, [$em, $class])->makePartial(); |
|
| 186 | 186 | $expectation = $em->shouldReceive('fetch')->with($class)->andReturn($fetcher); |
| 187 | 187 | |
| 188 | 188 | /** @scrutinizer ignore-call */ |
@@ -384,8 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | return $useAutoIncrement && $entity::isAutoIncremented() ? |
| 387 | - $this->getDbal()->insertAndSyncWithAutoInc($entity) : |
|
| 388 | - $this->getDbal()->insertAndSync($entity); |
|
| 387 | + $this->getDbal()->insertAndSyncWithAutoInc($entity) : $this->getDbal()->insertAndSync($entity); |
|
| 389 | 388 | } |
| 390 | 389 | |
| 391 | 390 | /** |
@@ -501,7 +500,7 @@ discard block |
||
| 501 | 500 | return new EntityFetcher($this, $class); |
| 502 | 501 | } |
| 503 | 502 | |
| 504 | - $primaryKey = $this::buildPrimaryKey($class, (array)$primaryKey); |
|
| 503 | + $primaryKey = $this::buildPrimaryKey($class, (array) $primaryKey); |
|
| 505 | 504 | $checksum = $this::buildChecksum($primaryKey); |
| 506 | 505 | |
| 507 | 506 | if (isset($this->map[$class][$checksum])) { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return new EntityFetcherMock($this, $class); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $primaryKey = $this->buildPrimaryKey($class, (array)$primaryKey); |
|
| 23 | + $primaryKey = $this->buildPrimaryKey($class, (array) $primaryKey); |
|
| 24 | 24 | $checksum = $this->buildChecksum($primaryKey); |
| 25 | 25 | |
| 26 | 26 | if (isset($this->map[$class][$checksum])) { |