@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function getDatabasePlatform() |
| 36 | 36 | { |
| 37 | - if (! $this->platformMock) { |
|
| 37 | + if ( ! $this->platformMock) { |
|
| 38 | 38 | $this->platformMock = new DatabasePlatformMock(); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | public function quote($input, $type = null) |
| 117 | 117 | { |
| 118 | 118 | if (is_string($input)) { |
| 119 | - return "'" . $input . "'"; |
|
| 119 | + return "'".$input."'"; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | return $input; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | while ($worker->work()) { |
| 38 | 38 | if ($worker->returnCode() !== GEARMAN_SUCCESS) { |
| 39 | - echo 'return_code: ' . $worker->returnCode() . "\n"; |
|
| 39 | + echo 'return_code: '.$worker->returnCode()."\n"; |
|
| 40 | 40 | break; |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function findWithLock($job) |
| 63 | 63 | { |
| 64 | - return $this->process($job, static function ($fixture, $em) { |
|
| 64 | + return $this->process($job, static function($fixture, $em) { |
|
| 65 | 65 | $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']); |
| 66 | 66 | }); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public function dqlWithLock($job) |
| 70 | 70 | { |
| 71 | - return $this->process($job, static function ($fixture, $em) { |
|
| 71 | + return $this->process($job, static function($fixture, $em) { |
|
| 72 | 72 | /** @var Doctrine\ORM\Query $query */ |
| 73 | 73 | $query = $em->createQuery($fixture['dql']); |
| 74 | 74 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function lock($job) |
| 82 | 82 | { |
| 83 | - return $this->process($job, static function ($fixture, $em) { |
|
| 83 | + return $this->process($job, static function($fixture, $em) { |
|
| 84 | 84 | $entity = $em->find($fixture['entityName'], $fixture['entityId']); |
| 85 | 85 | |
| 86 | 86 | $em->lock($entity, $fixture['lockMode']); |
@@ -89,18 +89,18 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | protected function processWorkload($job) |
| 91 | 91 | { |
| 92 | - echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n"; |
|
| 92 | + echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n"; |
|
| 93 | 93 | |
| 94 | 94 | $workload = $job->workload(); |
| 95 | 95 | $workload = unserialize($workload); |
| 96 | 96 | |
| 97 | - if (! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
| 97 | + if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) { |
|
| 98 | 98 | throw new InvalidArgumentException('Missing Database parameters'); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $this->em = $this->createEntityManager($workload['conn']); |
| 102 | 102 | |
| 103 | - if (! isset($workload['fixture'])) { |
|
| 103 | + if ( ! isset($workload['fixture'])) { |
|
| 104 | 104 | throw new InvalidArgumentException('Missing Fixture parameters'); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | protected function createEntityManager($conn) |
| 111 | 111 | { |
| 112 | 112 | $config = new Configuration(); |
| 113 | - $config->setProxyDir(__DIR__ . '/../../../Proxies'); |
|
| 113 | + $config->setProxyDir(__DIR__.'/../../../Proxies'); |
|
| 114 | 114 | $config->setProxyNamespace('MyProject\Proxies'); |
| 115 | 115 | $config->setAutoGenerateProxyClasses(true); |
| 116 | 116 | |
| 117 | - $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']); |
|
| 117 | + $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']); |
|
| 118 | 118 | $config->setMetadataDriverImpl($annotDriver); |
| 119 | 119 | |
| 120 | 120 | $cache = new ArrayCache(); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $driver = new DatabaseDriver($sm); |
| 64 | 64 | |
| 65 | 65 | foreach ($driver->getAllClassNames() as $className) { |
| 66 | - if (! in_array(strtolower($className), $classNames, true)) { |
|
| 66 | + if ( ! in_array(strtolower($className), $classNames, true)) { |
|
| 67 | 67 | continue; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if (count($metadatas) !== count($classNames)) { |
| 78 | - $this->fail("Have not found all classes matching the names '" . implode(', ', $classNames) . "' only tables " . implode(', ', array_keys($metadatas))); |
|
| 78 | + $this->fail("Have not found all classes matching the names '".implode(', ', $classNames)."' only tables ".implode(', ', array_keys($metadatas))); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $metadatas; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | if ($entityManager !== self::$entityManager) { |
| 81 | 81 | throw new RuntimeException( |
| 82 | - 'Trying to use PersistentObject with different EntityManager instances. ' . |
|
| 82 | + 'Trying to use PersistentObject with different EntityManager instances. '. |
|
| 83 | 83 | 'Was PersistentObject::setEntityManager() called?' |
| 84 | 84 | ); |
| 85 | 85 | } |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $property = $this->cm->getProperty($field); |
| 106 | 106 | |
| 107 | - if (! $property) { |
|
| 108 | - throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
| 107 | + if ( ! $property) { |
|
| 108 | + throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | switch (true) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $targetClassName = $property->getTargetEntity(); |
| 118 | 118 | |
| 119 | 119 | if ($args[0] !== null && ! ($args[0] instanceof $targetClassName)) { |
| 120 | - throw new InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'"); |
|
| 120 | + throw new InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $this->{$field} = $args[0]; |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $property = $this->cm->getProperty($field); |
| 145 | 145 | |
| 146 | - if (! $property) { |
|
| 147 | - throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
| 146 | + if ( ! $property) { |
|
| 147 | + throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $this->{$field}; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $mappedByField = $property->getMappedBy(); |
| 167 | 167 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
| 168 | 168 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
| 169 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
| 169 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
| 170 | 170 | |
| 171 | 171 | $targetObject->{$setterMethodName}($this); |
| 172 | 172 | } |
@@ -188,21 +188,21 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $property = $this->cm->getProperty($field); |
| 190 | 190 | |
| 191 | - if (! $property) { |
|
| 192 | - throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'"); |
|
| 191 | + if ( ! $property) { |
|
| 192 | + throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
| 196 | - throw new BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getClassName()); |
|
| 195 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
| 196 | + throw new BadMethodCallException('There is no method add'.$field.'() on '.$this->cm->getClassName()); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | $targetClassName = $property->getTargetEntity(); |
| 200 | 200 | |
| 201 | - if (! ($args[0] instanceof $targetClassName)) { |
|
| 202 | - throw new InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'"); |
|
| 201 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
| 202 | + throw new InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - if (! ($this->{$field} instanceof Collection)) { |
|
| 205 | + if ( ! ($this->{$field} instanceof Collection)) { |
|
| 206 | 206 | $this->{$field} = new ArrayCollection($this->{$field} ?: []); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if (! self::$entityManager) { |
|
| 227 | + if ( ! self::$entityManager) { |
|
| 228 | 228 | throw new RuntimeException('No runtime entity manager set. Call PersistentObject#setEntityManager().'); |
| 229 | 229 | } |
| 230 | 230 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | case 'add': |
| 255 | 255 | return $this->add($field, $args); |
| 256 | 256 | default: |
| 257 | - throw new BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getClassName()); |
|
| 257 | + throw new BadMethodCallException('There is no method '.$method.' on '.$this->cm->getClassName()); |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | // association (table). Without initializing the collection. |
| 332 | 332 | $removed = parent::remove($key); |
| 333 | 333 | |
| 334 | - if (! $removed) { |
|
| 334 | + if ( ! $removed) { |
|
| 335 | 335 | return $removed; |
| 336 | 336 | } |
| 337 | 337 | |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | public function removeElement($element) |
| 354 | 354 | { |
| 355 | - if (! $this->initialized && |
|
| 355 | + if ( ! $this->initialized && |
|
| 356 | 356 | $this->association !== null && |
| 357 | 357 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 358 | 358 | if ($this->collection->contains($element)) { |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | $removed = parent::removeElement($element); |
| 368 | 368 | |
| 369 | - if (! $removed) { |
|
| 369 | + if ( ! $removed) { |
|
| 370 | 370 | return $removed; |
| 371 | 371 | } |
| 372 | 372 | |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | */ |
| 388 | 388 | public function containsKey($key) |
| 389 | 389 | { |
| 390 | - if (! $this->initialized && |
|
| 390 | + if ( ! $this->initialized && |
|
| 391 | 391 | $this->association !== null && |
| 392 | 392 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 393 | 393 | $this->association->getIndexedBy()) { |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | public function contains($element) |
| 406 | 406 | { |
| 407 | - if (! $this->initialized && |
|
| 407 | + if ( ! $this->initialized && |
|
| 408 | 408 | $this->association !== null && |
| 409 | 409 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 410 | 410 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -420,11 +420,11 @@ discard block |
||
| 420 | 420 | */ |
| 421 | 421 | public function get($key) |
| 422 | 422 | { |
| 423 | - if (! $this->initialized && |
|
| 423 | + if ( ! $this->initialized && |
|
| 424 | 424 | $this->association !== null && |
| 425 | 425 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 426 | 426 | $this->association->getIndexedBy()) { |
| 427 | - if (! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 427 | + if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 428 | 428 | return $this->em->find($this->typeClass->getClassName(), $key); |
| 429 | 429 | } |
| 430 | 430 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | public function count() |
| 441 | 441 | { |
| 442 | - if (! $this->initialized && |
|
| 442 | + if ( ! $this->initialized && |
|
| 443 | 443 | $this->association !== null && |
| 444 | 444 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 445 | 445 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | */ |
| 504 | 504 | public function offsetSet($offset, $value) |
| 505 | 505 | { |
| 506 | - if (! isset($offset)) { |
|
| 506 | + if ( ! isset($offset)) { |
|
| 507 | 507 | $this->add($value); |
| 508 | 508 | |
| 509 | 509 | return; |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | public function slice($offset, $length = null) |
| 600 | 600 | { |
| 601 | - if (! $this->initialized && |
|
| 601 | + if ( ! $this->initialized && |
|
| 602 | 602 | ! $this->isDirty && |
| 603 | 603 | $this->association !== null && |
| 604 | 604 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function __construct(Region $region, $directory, $lockLifetime) |
| 54 | 54 | { |
| 55 | - if (! is_dir($directory) && ! @mkdir($directory, 0775, true)) { |
|
| 55 | + if ( ! is_dir($directory) && ! @mkdir($directory, 0775, true)) { |
|
| 56 | 56 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $directory)); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (! is_writable($directory)) { |
|
| 59 | + if ( ! is_writable($directory)) { |
|
| 60 | 60 | throw new InvalidArgumentException(sprintf('The directory "%s" is not writable.', $directory)); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $filename = $this->getLockFileName($key); |
| 74 | 74 | |
| 75 | - if (! is_file($filename)) { |
|
| 75 | + if ( ! is_file($filename)) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $time = $this->getLockTime($filename); |
| 80 | 80 | $content = $this->getLockContent($filename); |
| 81 | 81 | |
| 82 | - if (! $content || ! $time) { |
|
| 82 | + if ( ! $content || ! $time) { |
|
| 83 | 83 | @unlink($filename); |
| 84 | 84 | |
| 85 | 85 | return false; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | private function getLockFileName(CacheKey $key) |
| 106 | 106 | { |
| 107 | - return $this->directory . DIRECTORY_SEPARATOR . $key->hash . '.' . self::LOCK_EXTENSION; |
|
| 107 | + return $this->directory.DIRECTORY_SEPARATOR.$key->hash.'.'.self::LOCK_EXTENSION; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $lock = Lock::createLockRead(); |
| 226 | 226 | $filename = $this->getLockFileName($key); |
| 227 | 227 | |
| 228 | - if (! @file_put_contents($filename, $lock->value, LOCK_EX)) { |
|
| 228 | + if ( ! @file_put_contents($filename, $lock->value, LOCK_EX)) { |
|
| 229 | 229 | return null; |
| 230 | 230 | } |
| 231 | 231 | chmod($filename, 0664); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $association = $collection->getMapping(); |
| 39 | 39 | |
| 40 | - if (! $association->isOwningSide()) { |
|
| 40 | + if ( ! $association->isOwningSide()) { |
|
| 41 | 41 | return; // ignore inverse side |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** @var JoinColumnMetadata $joinColumn */ |
| 50 | 50 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 51 | 51 | |
| 52 | - if (! $joinColumn->getType()) { |
|
| 52 | + if ( ! $joinColumn->getType()) { |
|
| 53 | 53 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $association = $collection->getMapping(); |
| 71 | 71 | |
| 72 | - if (! $association->isOwningSide()) { |
|
| 72 | + if ( ! $association->isOwningSide()) { |
|
| 73 | 73 | return; // ignore inverse side |
| 74 | 74 | } |
| 75 | 75 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $association = $collection->getMapping(); |
| 102 | 102 | |
| 103 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 103 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 104 | 104 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 145 | 145 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 146 | 146 | |
| 147 | - if (! $joinColumn->getType()) { |
|
| 147 | + if ( ! $joinColumn->getType()) { |
|
| 148 | 148 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | }*/ |
| 177 | 177 | |
| 178 | 178 | $sql = 'SELECT COUNT(*)' |
| 179 | - . ' FROM ' . $joinTableName . ' t' |
|
| 179 | + . ' FROM '.$joinTableName.' t' |
|
| 180 | 180 | . $joinTargetEntitySQL |
| 181 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 181 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 182 | 182 | |
| 183 | 183 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 184 | 184 | } |
@@ -201,13 +201,13 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $association = $collection->getMapping(); |
| 203 | 203 | |
| 204 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 204 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 205 | 205 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 209 | 209 | |
| 210 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 210 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 211 | 211 | |
| 212 | 212 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 213 | 213 | } |
@@ -217,13 +217,13 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function contains(PersistentCollection $collection, $element) |
| 219 | 219 | { |
| 220 | - if (! $this->isValidEntityState($element)) { |
|
| 220 | + if ( ! $this->isValidEntityState($element)) { |
|
| 221 | 221 | return false; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, true); |
| 225 | 225 | |
| 226 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 226 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 227 | 227 | |
| 228 | 228 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 229 | 229 | } |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | public function removeElement(PersistentCollection $collection, $element) |
| 235 | 235 | { |
| 236 | - if (! $this->isValidEntityState($element)) { |
|
| 236 | + if ( ! $this->isValidEntityState($element)) { |
|
| 237 | 237 | return false; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, false); |
| 241 | 241 | |
| 242 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 242 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 243 | 243 | |
| 244 | 244 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 245 | 245 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $onConditions = $this->getOnConditionSQL($association); |
| 258 | 258 | $whereClauses = $params = $types = []; |
| 259 | 259 | |
| 260 | - if (! $association->isOwningSide()) { |
|
| 260 | + if ( ! $association->isOwningSide()) { |
|
| 261 | 261 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 262 | 262 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
| 263 | 263 | } else { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 270 | 270 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 271 | 271 | |
| 272 | - if (! $joinColumn->getType()) { |
|
| 272 | + if ( ! $joinColumn->getType()) { |
|
| 273 | 273 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em)); |
| 274 | 274 | } |
| 275 | 275 | |
@@ -297,11 +297,11 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
| 299 | 299 | |
| 300 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
| 301 | - . ' FROM ' . $tableName . ' te' |
|
| 302 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
| 300 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
| 301 | + . ' FROM '.$tableName.' te' |
|
| 302 | + . ' JOIN '.$joinTableName.' t ON' |
|
| 303 | 303 | . implode(' AND ', $onConditions) |
| 304 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 304 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 305 | 305 | |
| 306 | 306 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 307 | 307 | $sql .= $this->getLimitSql($criteria); |
@@ -336,8 +336,8 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | // A join is needed if there is filtering on the target entity |
| 338 | 338 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
| 339 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 340 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 339 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 340 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 341 | 341 | |
| 342 | 342 | return [$joinSql, $filterSql]; |
| 343 | 343 | } |
@@ -358,18 +358,18 @@ discard block |
||
| 358 | 358 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 359 | 359 | |
| 360 | 360 | if ($filterExpr) { |
| 361 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 361 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - if (! $filterClauses) { |
|
| 365 | + if ( ! $filterClauses) { |
|
| 366 | 366 | return ''; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | $filterSql = implode(' AND ', $filterClauses); |
| 370 | 370 | |
| 371 | 371 | return isset($filterClauses[1]) |
| 372 | - ? '(' . $filterSql . ')' |
|
| 372 | + ? '('.$filterSql.')' |
|
| 373 | 373 | : $filterSql; |
| 374 | 374 | } |
| 375 | 375 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 397 | 397 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 398 | 398 | |
| 399 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
| 399 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | return $conditions; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 421 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /** |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 474 | 474 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 475 | 475 | |
| 476 | - if (! $joinColumn->getType()) { |
|
| 476 | + if ( ! $joinColumn->getType()) { |
|
| 477 | 477 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 478 | 478 | } |
| 479 | 479 | |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 487 | 487 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 488 | 488 | |
| 489 | - if (! $joinColumn->getType()) { |
|
| 489 | + if ( ! $joinColumn->getType()) { |
|
| 490 | 490 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 491 | 491 | } |
| 492 | 492 | |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 538 | 538 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 539 | 539 | |
| 540 | - if (! $joinColumn->getType()) { |
|
| 540 | + if ( ! $joinColumn->getType()) { |
|
| 541 | 541 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 542 | 542 | } |
| 543 | 543 | |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 551 | 551 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 552 | 552 | |
| 553 | - if (! $joinColumn->getType()) { |
|
| 553 | + if ( ! $joinColumn->getType()) { |
|
| 554 | 554 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 555 | 555 | } |
| 556 | 556 | |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 635 | 635 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
| 636 | 636 | |
| 637 | - if (! $owningAssociation->isOwningSide()) { |
|
| 637 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 638 | 638 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
| 639 | 639 | $joinTable = $owningAssociation->getJoinTable(); |
| 640 | 640 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
| 649 | - $quotedJoinTable = $joinTableName . ' t'; |
|
| 649 | + $quotedJoinTable = $joinTableName.' t'; |
|
| 650 | 650 | $whereClauses = []; |
| 651 | 651 | $params = []; |
| 652 | 652 | $types = []; |
@@ -660,11 +660,11 @@ discard block |
||
| 660 | 660 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 661 | 661 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 662 | 662 | |
| 663 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
| 663 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 667 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 667 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 668 | 668 | $indexByProperty = $targetClass->getProperty($indexBy); |
| 669 | 669 | |
| 670 | 670 | switch (true) { |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 688 | 688 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 689 | 689 | |
| 690 | - if (! $joinColumn->getType()) { |
|
| 690 | + if ( ! $joinColumn->getType()) { |
|
| 691 | 691 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 692 | 692 | } |
| 693 | 693 | |
@@ -696,13 +696,13 @@ discard block |
||
| 696 | 696 | $types[] = $joinColumn->getType(); |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | - if (! $joinNeeded) { |
|
| 699 | + if ( ! $joinNeeded) { |
|
| 700 | 700 | foreach ($joinColumns as $joinColumn) { |
| 701 | 701 | /** @var JoinColumnMetadata $joinColumn */ |
| 702 | 702 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 703 | 703 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 704 | 704 | |
| 705 | - if (! $joinColumn->getType()) { |
|
| 705 | + if ( ! $joinColumn->getType()) { |
|
| 706 | 706 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 707 | 707 | } |
| 708 | 708 | |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
| 717 | 717 | |
| 718 | 718 | if ($filterSql) { |
| 719 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 719 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 720 | 720 | $whereClauses[] = $filterSql; |
| 721 | 721 | } |
| 722 | 722 | } |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | $association = $collection->getMapping(); |
| 740 | 740 | $owningAssociation = $association; |
| 741 | 741 | |
| 742 | - if (! $association->isOwningSide()) { |
|
| 742 | + if ( ! $association->isOwningSide()) { |
|
| 743 | 743 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
| 744 | 744 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
| 745 | 745 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -765,11 +765,11 @@ discard block |
||
| 765 | 765 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 766 | 766 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 767 | 767 | |
| 768 | - if (! $joinColumn->getType()) { |
|
| 768 | + if ( ! $joinColumn->getType()) { |
|
| 769 | 769 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 772 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 773 | 773 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
| 774 | 774 | $types[] = $joinColumn->getType(); |
| 775 | 775 | } |
@@ -779,11 +779,11 @@ discard block |
||
| 779 | 779 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 780 | 780 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 781 | 781 | |
| 782 | - if (! $joinColumn->getType()) { |
|
| 782 | + if ( ! $joinColumn->getType()) { |
|
| 783 | 783 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 786 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 787 | 787 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
| 788 | 788 | $types[] = $joinColumn->getType(); |
| 789 | 789 | } |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
| 795 | 795 | |
| 796 | 796 | if ($filterSql) { |
| 797 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 797 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 798 | 798 | $whereClauses[] = $filterSql; |
| 799 | 799 | } |
| 800 | 800 | } |
@@ -839,10 +839,10 @@ discard block |
||
| 839 | 839 | $property = $targetClass->getProperty($name); |
| 840 | 840 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 841 | 841 | |
| 842 | - $orderBy[] = $columnName . ' ' . $direction; |
|
| 842 | + $orderBy[] = $columnName.' '.$direction; |
|
| 843 | 843 | } |
| 844 | 844 | |
| 845 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 845 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | return ''; |
@@ -79,11 +79,11 @@ |
||
| 79 | 79 | |
| 80 | 80 | switch ($comparison->getOperator()) { |
| 81 | 81 | case Comparison::CONTAINS: |
| 82 | - return '%' . $value . '%'; |
|
| 82 | + return '%'.$value.'%'; |
|
| 83 | 83 | case Comparison::STARTS_WITH: |
| 84 | - return $value . '%'; |
|
| 84 | + return $value.'%'; |
|
| 85 | 85 | case Comparison::ENDS_WITH: |
| 86 | - return '%' . $value; |
|
| 86 | + return '%'.$value; |
|
| 87 | 87 | default: |
| 88 | 88 | return $value; |
| 89 | 89 | } |