@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 202 | - 'SET ' . implode(',', $set) . ' ' . |
|
| 203 | - 'WHERE ' . implode(' AND ', $where); |
|
| 202 | + 'SET ' . implode(',', $set) . ' ' . |
|
| 203 | + 'WHERE ' . implode(' AND ', $where); |
|
| 204 | 204 | $this->entityManager->getConnection()->query($statement); |
| 205 | 205 | |
| 206 | 206 | return $this->entityManager->sync($entity, true); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 227 | - 'WHERE ' . implode(' AND ', $where); |
|
| 227 | + 'WHERE ' . implode(' AND ', $where); |
|
| 228 | 228 | $this->entityManager->getConnection()->query($statement); |
| 229 | 229 | |
| 230 | 230 | return true; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $cols = array_combine($cols, array_map([$this, 'escapeIdentifier'], $cols)); |
| 252 | 252 | |
| 253 | 253 | $statement = 'INSERT INTO ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 254 | - '(' . implode(',', $cols) . ') VALUES '; |
|
| 254 | + '(' . implode(',', $cols) . ') VALUES '; |
|
| 255 | 255 | |
| 256 | 256 | $statement .= implode(',', array_map(function ($values) use ($cols) { |
| 257 | 257 | $result = []; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function escapeValue($value) |
| 98 | 98 | { |
| 99 | 99 | $type = is_object($value) ? get_class($value) : gettype($value); |
| 100 | - $method = [ $this, 'escape' . ucfirst($type) ]; |
|
| 100 | + $method = [$this, 'escape' . ucfirst($type)]; |
|
| 101 | 101 | |
| 102 | 102 | if (is_callable($method)) { |
| 103 | 103 | return call_user_func($method, $value); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $var = $entity::getPrimaryKeyVars()[0]; |
| 280 | 280 | $column = $entity::getColumnName($var); |
| 281 | 281 | |
| 282 | - $entity->setOriginalData(array_merge($entity->getData(), [ $column => $value ])); |
|
| 282 | + $entity->setOriginalData(array_merge($entity->getData(), [$column => $value])); |
|
| 283 | 283 | $entity->__set($var, $value); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -297,8 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $query = "SELECT * FROM " . $this->escapeIdentifier($entity::getTableName()) . " WHERE "; |
| 299 | 299 | $query .= count($cols) > 1 ? |
| 300 | - '(' . implode(',', array_map([$this, 'escapeIdentifier'], $cols)) . ')' : |
|
| 301 | - $this->escapeIdentifier($cols[0]); |
|
| 300 | + '(' . implode(',', array_map([$this, 'escapeIdentifier'], $cols)) . ')' : $this->escapeIdentifier($cols[0]); |
|
| 302 | 301 | $query .= ' IN ('; |
| 303 | 302 | $pKeys = []; |
| 304 | 303 | foreach ($entities as $entity) { |
@@ -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 | /** |
@@ -502,7 +501,7 @@ discard block |
||
| 502 | 501 | } |
| 503 | 502 | |
| 504 | 503 | if (!is_array($primaryKey)) { |
| 505 | - $primaryKey = [ $primaryKey ]; |
|
| 504 | + $primaryKey = [$primaryKey]; |
|
| 506 | 505 | } |
| 507 | 506 | |
| 508 | 507 | /** @noinspection PhpUndefinedMethodInspection */ |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | public function describe($schemaTable) |
| 65 | 65 | { |
| 66 | 66 | $table = explode($this->identifierDivider, $schemaTable); |
| 67 | - list($schema, $table) = count($table) === 2 ? $table : [ 'public', $table[0] ]; |
|
| 67 | + list($schema, $table) = count($table) === 2 ? $table : ['public', $table[0]]; |
|
| 68 | 68 | |
| 69 | 69 | $query = new QueryBuilder('INFORMATION_SCHEMA.COLUMNS', '', $this->entityManager); |
| 70 | 70 | $query->where('table_name', $table)->andWhere('table_schema', $schema); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function ormInitMock($options = [], $driver = 'mysql') |
| 33 | 33 | { |
| 34 | 34 | /** @var EntityManager|m\Mock $em */ |
| 35 | - $em = m::mock(EntityManager::class, [ $options ])->makePartial(); |
|
| 35 | + $em = m::mock(EntityManager::class, [$options])->makePartial(); |
|
| 36 | 36 | /** @var \PDO|m\Mock $pdo */ |
| 37 | 37 | $pdo = m::mock(\PDO::class); |
| 38 | 38 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $em = $em ?: EntityManager::getInstance($class); |
| 139 | 139 | |
| 140 | 140 | /** @var m\Mock|EntityFetcher $fetcher */ |
| 141 | - $fetcher = m::mock(EntityFetcher::class, [ $em, $class ])->makePartial(); |
|
| 141 | + $fetcher = m::mock(EntityFetcher::class, [$em, $class])->makePartial(); |
|
| 142 | 142 | $em->shouldReceive('fetch')->with($class)->once()->andReturn($fetcher); |
| 143 | 143 | |
| 144 | 144 | /** @scrutinizer ignore-call */ |