@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $hydrationModeName = $input->getOption('hydrate'); |
61 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . \strtoupper(\str_replace('-', '_', $hydrationModeName)); |
|
61 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.\strtoupper(\str_replace('-', '_', $hydrationModeName)); |
|
62 | 62 | |
63 | - if (! \defined($hydrationMode)) { |
|
63 | + if ( ! \defined($hydrationMode)) { |
|
64 | 64 | throw new RuntimeException(\sprintf( |
65 | 65 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
66 | 66 | $hydrationModeName |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $firstResult = $input->getOption('first-result'); |
72 | 72 | |
73 | 73 | if ($firstResult !== null) { |
74 | - if (! \is_numeric($firstResult)) { |
|
74 | + if ( ! \is_numeric($firstResult)) { |
|
75 | 75 | throw new LogicException("Option 'first-result' must contain an integer value"); |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $maxResult = $input->getOption('max-result'); |
82 | 82 | |
83 | 83 | if ($maxResult !== null) { |
84 | - if (! \is_numeric($maxResult)) { |
|
84 | + if ( ! \is_numeric($maxResult)) { |
|
85 | 85 | throw new LogicException("Option 'max-result' must contain an integer value"); |
86 | 86 | } |
87 | 87 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $resultSet = $query->execute([], \constant($hydrationMode)); |
98 | 98 | |
99 | - $dumper = new CliDumper(static function (string $payload) use ($output) : void { |
|
99 | + $dumper = new CliDumper(static function(string $payload) use ($output) : void { |
|
100 | 100 | $output->write($payload); |
101 | 101 | }); |
102 | 102 | $dumper->dump((new VarCloner())->cloneVar($resultSet)); |
@@ -57,19 +57,19 @@ |
||
57 | 57 | $destPath = $em->getConfiguration()->getProxyDir(); |
58 | 58 | } |
59 | 59 | |
60 | - if (! \is_dir($destPath)) { |
|
60 | + if ( ! \is_dir($destPath)) { |
|
61 | 61 | \mkdir($destPath, 0775, true); |
62 | 62 | } |
63 | 63 | |
64 | 64 | $destPath = \realpath($destPath); |
65 | 65 | |
66 | - if (! \file_exists($destPath)) { |
|
66 | + if ( ! \file_exists($destPath)) { |
|
67 | 67 | throw new InvalidArgumentException( |
68 | 68 | \sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $em->getConfiguration()->getProxyDir()) |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - if (! \is_writable($destPath)) { |
|
72 | + if ( ! \is_writable($destPath)) { |
|
73 | 73 | throw new InvalidArgumentException( |
74 | 74 | \sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath) |
75 | 75 | ); |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | ->getMetadataDriverImpl() |
145 | 145 | ->getAllClassNames(); |
146 | 146 | |
147 | - if (! $entityClassNames) { |
|
147 | + if ( ! $entityClassNames) { |
|
148 | 148 | throw new InvalidArgumentException( |
149 | - 'You do not have any mapped Doctrine ORM entities according to the current configuration. ' . |
|
149 | + 'You do not have any mapped Doctrine ORM entities according to the current configuration. '. |
|
150 | 150 | 'If you have entities or mapping files you should check your mapping configuration for errors.' |
151 | 151 | ); |
152 | 152 | } |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | |
172 | 172 | $matches = \array_filter( |
173 | 173 | $this->getMappedEntities($entityManager), |
174 | - static function ($mappedEntity) use ($entityName) { |
|
175 | - return \preg_match('{' . \preg_quote($entityName) . '}', $mappedEntity); |
|
174 | + static function($mappedEntity) use ($entityName) { |
|
175 | + return \preg_match('{'.\preg_quote($entityName).'}', $mappedEntity); |
|
176 | 176 | } |
177 | 177 | ); |
178 | 178 | |
179 | - if (! $matches) { |
|
179 | + if ( ! $matches) { |
|
180 | 180 | throw new InvalidArgumentException(\sprintf( |
181 | 181 | 'Could not find any mapped Entity classes matching "%s"', |
182 | 182 | $entityName |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | $output[] = $this->formatField( |
230 | 230 | \sprintf(' %s', $parentClass->getParent()), |
231 | - ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes) |
|
231 | + ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes) |
|
232 | 232 | ); |
233 | 233 | } |
234 | 234 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | if (\is_bool($value)) { |
256 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
256 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | if (empty($value)) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $name = Cache::DEFAULT_QUERY_REGION_NAME; |
76 | 76 | } |
77 | 77 | |
78 | - if (! $cache instanceof Cache) { |
|
78 | + if ( ! $cache instanceof Cache) { |
|
79 | 79 | throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
80 | 80 | } |
81 | 81 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $queryCache = $cache->getQueryCache($name); |
84 | 84 | $queryRegion = $queryCache->getRegion(); |
85 | 85 | |
86 | - if (! $queryRegion instanceof DefaultRegion) { |
|
86 | + if ( ! $queryRegion instanceof DefaultRegion) { |
|
87 | 87 | throw new InvalidArgumentException(\sprintf( |
88 | 88 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
89 | 89 | \is_object($queryRegion) ? \get_class($queryRegion) : \gettype($queryRegion) |
@@ -73,18 +73,18 @@ |
||
73 | 73 | $entityId = $input->getArgument('entity-id'); |
74 | 74 | $cache = $em->getCache(); |
75 | 75 | |
76 | - if (! $cache instanceof Cache) { |
|
76 | + if ( ! $cache instanceof Cache) { |
|
77 | 77 | throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
78 | 78 | } |
79 | 79 | |
80 | - if (! $entityClass && ! $input->getOption('all')) { |
|
80 | + if ( ! $entityClass && ! $input->getOption('all')) { |
|
81 | 81 | throw new InvalidArgumentException('Invalid argument "--entity-class"'); |
82 | 82 | } |
83 | 83 | |
84 | 84 | if ($input->getOption('flush')) { |
85 | 85 | $entityRegion = $cache->getEntityCacheRegion($entityClass); |
86 | 86 | |
87 | - if (! $entityRegion instanceof DefaultRegion) { |
|
87 | + if ( ! $entityRegion instanceof DefaultRegion) { |
|
88 | 88 | throw new InvalidArgumentException(\sprintf( |
89 | 89 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
90 | 90 | \is_object($entityRegion) ? \get_class($entityRegion) : \gettype($entityRegion) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $ownerId = $input->getArgument('owner-id'); |
76 | 76 | $cache = $em->getCache(); |
77 | 77 | |
78 | - if (! $cache instanceof Cache) { |
|
78 | + if ( ! $cache instanceof Cache) { |
|
79 | 79 | throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
80 | 80 | } |
81 | 81 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | if ($input->getOption('flush')) { |
87 | 87 | $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc); |
88 | 88 | |
89 | - if (! $collectionRegion instanceof DefaultRegion) { |
|
89 | + if ( ! $collectionRegion instanceof DefaultRegion) { |
|
90 | 90 | throw new InvalidArgumentException(\sprintf( |
91 | 91 | 'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".', |
92 | 92 | \is_object($collectionRegion) ? \get_class($collectionRegion) : \gettype($collectionRegion) |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $metadata = $it->current(); |
61 | 61 | |
62 | 62 | foreach ($this->filter as $filter) { |
63 | - $pregResult = \preg_match('/' . $filter . '/', $metadata->getClassName()); |
|
63 | + $pregResult = \preg_match('/'.$filter.'/', $metadata->getClassName()); |
|
64 | 64 | |
65 | 65 | if ($pregResult === false) { |
66 | 66 | throw new RuntimeException( |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public static function fromClassAndAssociation(string $class, string $associationName) : self |
14 | 14 | { |
15 | 15 | return new self(\sprintf( |
16 | - 'Cannot match on %s::%s with a non-object value. Matching objects by id is ' . |
|
16 | + 'Cannot match on %s::%s with a non-object value. Matching objects by id is '. |
|
17 | 17 | 'not compatible with matching on an in-memory collection, which compares objects by reference.', |
18 | 18 | $class, |
19 | 19 | $associationName |
@@ -247,7 +247,7 @@ |
||
247 | 247 | |
248 | 248 | // 2) Build insert table records into temporary table |
249 | 249 | $dql = ' SELECT t0.' . \implode(', t0.', $rootClass->getIdentifierFieldNames()) |
250 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
250 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
251 | 251 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
252 | 252 | |
253 | 253 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // the entire collection with a new would trigger this operation. |
34 | 34 | $association = $collection->getMapping(); |
35 | 35 | |
36 | - if (! $association->isOrphanRemoval()) { |
|
36 | + if ( ! $association->isOrphanRemoval()) { |
|
37 | 37 | // Handling non-orphan removal should never happen, as @OneToMany |
38 | 38 | // can only be inverse side. For owning side one to many, it is |
39 | 39 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $association = $collection->getMapping(); |
67 | 67 | |
68 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
68 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
69 | 69 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
70 | 70 | } |
71 | 71 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $association = $collection->getMapping(); |
116 | 116 | |
117 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
117 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
118 | 118 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
119 | 119 | } |
120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function contains(PersistentCollection $collection, $element) |
138 | 138 | { |
139 | - if (! $this->isValidEntityState($element)) { |
|
139 | + if ( ! $this->isValidEntityState($element)) { |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 | |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | { |
161 | 161 | $association = $collection->getMapping(); |
162 | 162 | |
163 | - if (! $association->isOrphanRemoval()) { |
|
163 | + if ( ! $association->isOrphanRemoval()) { |
|
164 | 164 | // no-op: this is not the owning side, therefore no operations should be applied |
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
168 | - if (! $this->isValidEntityState($element)) { |
|
168 | + if ( ! $this->isValidEntityState($element)) { |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
206 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . \implode(' = ? AND ', $columns) . ' = ?'; |
|
206 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.\implode(' = ? AND ', $columns).' = ?'; |
|
207 | 207 | |
208 | 208 | return $this->conn->executeUpdate($statement, $parameters); |
209 | 209 | } |
@@ -240,17 +240,17 @@ discard block |
||
240 | 240 | ]; |
241 | 241 | } |
242 | 242 | |
243 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
244 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
243 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
244 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
245 | 245 | |
246 | 246 | $this->conn->executeUpdate($statement); |
247 | 247 | |
248 | 248 | // 2) Build insert table records into temporary table |
249 | - $dql = ' SELECT t0.' . \implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
250 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
249 | + $dql = ' SELECT t0.'.\implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
250 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
251 | 251 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
252 | 252 | |
253 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
253 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
254 | 254 | $parameters = \array_values($sourcePersister->getIdentifier($collection->getOwner())); |
255 | 255 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
256 | 256 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | // 4) Delete records on each table in the hierarchy |
266 | 266 | $hierarchyClasses = \array_merge( |
267 | 267 | \array_map( |
268 | - function ($className) { |
|
268 | + function($className) { |
|
269 | 269 | return $this->em->getClassMetadata($className); |
270 | 270 | }, |
271 | 271 | \array_reverse($targetClass->getSubClasses()) |