@@ -298,6 +298,9 @@ |
||
298 | 298 | $lines[] = '}'; |
299 | 299 | } |
300 | 300 | |
301 | + /** |
|
302 | + * @param string $variableName |
|
303 | + */ |
|
301 | 304 | private function exportJoinColumns(array $joinColumns, array &$lines, $variableName) |
302 | 305 | { |
303 | 306 | $lines[] = '$' . $variableName . ' = array();'; |
@@ -28,7 +28,6 @@ |
||
28 | 28 | use Doctrine\ORM\Mapping\ManyToOneAssociationMetadata; |
29 | 29 | use Doctrine\ORM\Mapping\OneToManyAssociationMetadata; |
30 | 30 | use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
31 | -use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
|
32 | 31 | |
33 | 32 | /** |
34 | 33 | * ClassMetadata exporter for PHP code. |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($metadata->inheritanceType) { |
65 | - $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::' . $metadata->inheritanceType . ');'; |
|
65 | + $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::'.$metadata->inheritanceType.');'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($metadata->customRepositoryClassName) { |
69 | - $lines[] = '$metadata->customRepositoryClassName = "' . $metadata->customRepositoryClassName . '";'; |
|
69 | + $lines[] = '$metadata->customRepositoryClassName = "'.$metadata->customRepositoryClassName.'";'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($metadata->table) { |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | $lines[] = '$table = new Mapping\TableMetadata();'; |
76 | 76 | $lines[] = null; |
77 | 77 | |
78 | - if (! empty($table->getSchema())) { |
|
79 | - $lines[] = '$table->setSchema("' . $table->getSchema() . '");'; |
|
78 | + if ( ! empty($table->getSchema())) { |
|
79 | + $lines[] = '$table->setSchema("'.$table->getSchema().'");'; |
|
80 | 80 | } |
81 | 81 | |
82 | - $lines[] = '$table->setName("' . $table->getName() . '");'; |
|
83 | - $lines[] = '$table->setOptions(' . $this->varExport($table->getOptions()) . ');'; |
|
82 | + $lines[] = '$table->setName("'.$table->getName().'");'; |
|
83 | + $lines[] = '$table->setOptions('.$this->varExport($table->getOptions()).');'; |
|
84 | 84 | |
85 | 85 | foreach ($table->getIndexes() as $index) { |
86 | - $lines[] = '$table->addIndex(' . $this->varExport($index) . ');'; |
|
86 | + $lines[] = '$table->addIndex('.$this->varExport($index).');'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | foreach ($table->getUniqueConstraints() as $constraint) { |
90 | - $lines[] = '$table->addUniqueConstraint(' . $this->varExport($constraint) . ');'; |
|
90 | + $lines[] = '$table->addUniqueConstraint('.$this->varExport($constraint).');'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $lines[] = null; |
@@ -99,51 +99,51 @@ discard block |
||
99 | 99 | |
100 | 100 | $lines[] = '$discrColumn = new Mapping\DiscriminatorColumnMetadata();'; |
101 | 101 | $lines[] = null; |
102 | - $lines[] = '$discrColumn->setColumnName("' . $discrColumn->getColumnName() . '");'; |
|
103 | - $lines[] = '$discrColumn->setType(Type::getType("' . $discrColumn->getTypeName() . '"));'; |
|
104 | - $lines[] = '$discrColumn->setTableName("' . $discrColumn->getTableName() . '");'; |
|
102 | + $lines[] = '$discrColumn->setColumnName("'.$discrColumn->getColumnName().'");'; |
|
103 | + $lines[] = '$discrColumn->setType(Type::getType("'.$discrColumn->getTypeName().'"));'; |
|
104 | + $lines[] = '$discrColumn->setTableName("'.$discrColumn->getTableName().'");'; |
|
105 | 105 | |
106 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
107 | - $lines[] = '$property->setColumnDefinition("' . $discrColumn->getColumnDefinition() . '");'; |
|
106 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
107 | + $lines[] = '$property->setColumnDefinition("'.$discrColumn->getColumnDefinition().'");'; |
|
108 | 108 | } |
109 | 109 | |
110 | - if (! empty($discrColumn->getLength())) { |
|
111 | - $lines[] = '$property->setLength(' . $discrColumn->getLength() . ');'; |
|
110 | + if ( ! empty($discrColumn->getLength())) { |
|
111 | + $lines[] = '$property->setLength('.$discrColumn->getLength().');'; |
|
112 | 112 | } |
113 | 113 | |
114 | - if (! empty($discrColumn->getScale())) { |
|
115 | - $lines[] = '$property->setScale(' . $discrColumn->getScale() . ');'; |
|
114 | + if ( ! empty($discrColumn->getScale())) { |
|
115 | + $lines[] = '$property->setScale('.$discrColumn->getScale().');'; |
|
116 | 116 | } |
117 | 117 | |
118 | - if (! empty($discrColumn->getPrecision())) { |
|
119 | - $lines[] = '$property->setPrecision(' . $discrColumn->getPrecision() . ');'; |
|
118 | + if ( ! empty($discrColumn->getPrecision())) { |
|
119 | + $lines[] = '$property->setPrecision('.$discrColumn->getPrecision().');'; |
|
120 | 120 | } |
121 | 121 | |
122 | - $lines[] = '$discrColumn->setOptions(' . $this->varExport($discrColumn->getOptions()) . ');'; |
|
123 | - $lines[] = '$discrColumn->setNullable(' . $this->varExport($discrColumn->isNullable()) . ');'; |
|
124 | - $lines[] = '$discrColumn->setUnique(' . $this->varExport($discrColumn->isUnique()) . ');'; |
|
122 | + $lines[] = '$discrColumn->setOptions('.$this->varExport($discrColumn->getOptions()).');'; |
|
123 | + $lines[] = '$discrColumn->setNullable('.$this->varExport($discrColumn->isNullable()).');'; |
|
124 | + $lines[] = '$discrColumn->setUnique('.$this->varExport($discrColumn->isUnique()).');'; |
|
125 | 125 | $lines[] = null; |
126 | 126 | $lines[] = '$metadata->setDiscriminatorColumn($discrColumn);'; |
127 | 127 | } |
128 | 128 | |
129 | 129 | if ($metadata->discriminatorMap) { |
130 | - $lines[] = '$metadata->setDiscriminatorMap(' . $this->varExport($metadata->discriminatorMap) . ');'; |
|
130 | + $lines[] = '$metadata->setDiscriminatorMap('.$this->varExport($metadata->discriminatorMap).');'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if ($metadata->changeTrackingPolicy) { |
134 | - $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . $metadata->changeTrackingPolicy . ');'; |
|
134 | + $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.$metadata->changeTrackingPolicy.');'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | if ($metadata->lifecycleCallbacks) { |
138 | 138 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
139 | 139 | foreach ($callbacks as $callback) { |
140 | - $lines[] = '$metadata->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
140 | + $lines[] = '$metadata->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | - if (! $metadata->isIdentifierComposite()) { |
|
146 | - $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::' . $metadata->generatorType . ');'; |
|
145 | + if ( ! $metadata->isIdentifierComposite()) { |
|
146 | + $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::'.$metadata->generatorType.');'; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | foreach ($metadata->getProperties() as $property) { |
@@ -166,30 +166,30 @@ discard block |
||
166 | 166 | ); |
167 | 167 | |
168 | 168 | $lines[] = null; |
169 | - $lines[] = '$property->setColumnName("' . $property->getColumnName() . '");'; |
|
170 | - $lines[] = '$property->setType(Type::getType("' . $property->getTypeName() . '"));'; |
|
171 | - $lines[] = '$property->setTableName("' . $property->getTableName() . '");'; |
|
169 | + $lines[] = '$property->setColumnName("'.$property->getColumnName().'");'; |
|
170 | + $lines[] = '$property->setType(Type::getType("'.$property->getTypeName().'"));'; |
|
171 | + $lines[] = '$property->setTableName("'.$property->getTableName().'");'; |
|
172 | 172 | |
173 | - if (! empty($property->getColumnDefinition())) { |
|
174 | - $lines[] = '$property->setColumnDefinition("' . $property->getColumnDefinition() . '");'; |
|
173 | + if ( ! empty($property->getColumnDefinition())) { |
|
174 | + $lines[] = '$property->setColumnDefinition("'.$property->getColumnDefinition().'");'; |
|
175 | 175 | } |
176 | 176 | |
177 | - if (! empty($property->getLength())) { |
|
178 | - $lines[] = '$property->setLength(' . $property->getLength() . ');'; |
|
177 | + if ( ! empty($property->getLength())) { |
|
178 | + $lines[] = '$property->setLength('.$property->getLength().');'; |
|
179 | 179 | } |
180 | 180 | |
181 | - if (! empty($property->getScale())) { |
|
182 | - $lines[] = '$property->setScale(' . $property->getScale() . ');'; |
|
181 | + if ( ! empty($property->getScale())) { |
|
182 | + $lines[] = '$property->setScale('.$property->getScale().');'; |
|
183 | 183 | } |
184 | 184 | |
185 | - if (! empty($property->getPrecision())) { |
|
186 | - $lines[] = '$property->setPrecision(' . $property->getPrecision() . ');'; |
|
185 | + if ( ! empty($property->getPrecision())) { |
|
186 | + $lines[] = '$property->setPrecision('.$property->getPrecision().');'; |
|
187 | 187 | } |
188 | 188 | |
189 | - $lines[] = '$property->setOptions(' . $this->varExport($property->getOptions()) . ');'; |
|
190 | - $lines[] = '$property->setPrimaryKey(' . $this->varExport($property->isPrimaryKey()) . ');'; |
|
191 | - $lines[] = '$property->setNullable(' . $this->varExport($property->isNullable()) . ');'; |
|
192 | - $lines[] = '$property->setUnique(' . $this->varExport($property->isUnique()) . ');'; |
|
189 | + $lines[] = '$property->setOptions('.$this->varExport($property->getOptions()).');'; |
|
190 | + $lines[] = '$property->setPrimaryKey('.$this->varExport($property->isPrimaryKey()).');'; |
|
191 | + $lines[] = '$property->setNullable('.$this->varExport($property->isNullable()).');'; |
|
192 | + $lines[] = '$property->setUnique('.$this->varExport($property->isUnique()).');'; |
|
193 | 193 | $lines[] = null; |
194 | 194 | $lines[] = '$metadata->addProperty($property);'; |
195 | 195 | } |
@@ -211,25 +211,25 @@ discard block |
||
211 | 211 | if ($association instanceof OneToOneAssociationMetadata) { |
212 | 212 | $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns'); |
213 | 213 | |
214 | - $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("' . $association->getName() . '");'; |
|
214 | + $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("'.$association->getName().'");'; |
|
215 | 215 | $lines[] = null; |
216 | 216 | $lines[] = '$association->setJoinColumns($joinColumns);'; |
217 | 217 | } else if ($association instanceof ManyToOneAssociationMetadata) { |
218 | 218 | $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns'); |
219 | 219 | |
220 | - $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("' . $association->getName() . '");'; |
|
220 | + $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("'.$association->getName().'");'; |
|
221 | 221 | $lines[] = null; |
222 | 222 | $lines[] = '$association->setJoinColumns($joinColumns);'; |
223 | 223 | } else if ($association instanceof OneToManyAssociationMetadata) { |
224 | - $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("' . $association->getName() . '");'; |
|
224 | + $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("'.$association->getName().'");'; |
|
225 | 225 | $lines[] = null; |
226 | - $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');'; |
|
226 | + $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');'; |
|
227 | 227 | } else if ($association instanceof ManyToManyAssociationMetadata) { |
228 | 228 | if ($association->getJoinTable()) { |
229 | 229 | $this->exportJoinTable($association->getJoinTable(), $lines); |
230 | 230 | } |
231 | 231 | |
232 | - $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("' . $association->getName() . '");'; |
|
232 | + $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("'.$association->getName().'");'; |
|
233 | 233 | $lines[] = null; |
234 | 234 | |
235 | 235 | if ($association->getJoinTable()) { |
@@ -237,26 +237,26 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | if ($association->getIndexedBy()) { |
240 | - $lines[] = '$association->setIndexedBy("' . $association->getIndexedBy() . '");'; |
|
240 | + $lines[] = '$association->setIndexedBy("'.$association->getIndexedBy().'");'; |
|
241 | 241 | } |
242 | 242 | |
243 | - $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');'; |
|
243 | + $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');'; |
|
244 | 244 | } |
245 | 245 | |
246 | - $lines[] = '$association->setTargetEntity("' . $association->getTargetEntity() . '");'; |
|
247 | - $lines[] = '$association->setFetchMode("' . $association->getFetchMode() . '");'; |
|
246 | + $lines[] = '$association->setTargetEntity("'.$association->getTargetEntity().'");'; |
|
247 | + $lines[] = '$association->setFetchMode("'.$association->getFetchMode().'");'; |
|
248 | 248 | |
249 | 249 | if ($association->getMappedBy()) { |
250 | - $lines[] = '$association->setMappedBy("' . $association->getMappedBy() . '");'; |
|
250 | + $lines[] = '$association->setMappedBy("'.$association->getMappedBy().'");'; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | if ($association->getInversedBy()) { |
254 | - $lines[] = '$association->setInversedBy("' . $association->getInversedBy() . '");'; |
|
254 | + $lines[] = '$association->setInversedBy("'.$association->getInversedBy().'");'; |
|
255 | 255 | } |
256 | 256 | |
257 | - $lines[] = '$association->setCascade(' . $this->varExport($cascade) . ');'; |
|
258 | - $lines[] = '$association->setOrphanRemoval(' . $this->varExport($association->isOrphanRemoval()) . ');'; |
|
259 | - $lines[] = '$association->setPrimaryKey(' . $this->varExport($association->isPrimaryKey()) . ');'; |
|
257 | + $lines[] = '$association->setCascade('.$this->varExport($cascade).');'; |
|
258 | + $lines[] = '$association->setOrphanRemoval('.$this->varExport($association->isOrphanRemoval()).');'; |
|
259 | + $lines[] = '$association->setPrimaryKey('.$this->varExport($association->isPrimaryKey()).');'; |
|
260 | 260 | $lines[] = null; |
261 | 261 | $lines[] = '$metadata->addProperty($association);'; |
262 | 262 | } |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | $lines[] = null; |
267 | 267 | $lines[] = '$joinTable = new Mapping\JoinTableMetadata();'; |
268 | 268 | $lines[] = null; |
269 | - $lines[] = '$joinTable->setName("' . $joinTable->getName() . '");'; |
|
269 | + $lines[] = '$joinTable->setName("'.$joinTable->getName().'");'; |
|
270 | 270 | |
271 | - if (! empty($joinTable->getSchema())) { |
|
272 | - $lines[] = '$joinTable->setSchema("' . $joinTable->getSchema() . '");'; |
|
271 | + if ( ! empty($joinTable->getSchema())) { |
|
272 | + $lines[] = '$joinTable->setSchema("'.$joinTable->getSchema().'");'; |
|
273 | 273 | } |
274 | 274 | |
275 | - $lines[] = '$joinTable->setOptions(' . $this->varExport($joinTable->getOptions()) . ');'; |
|
275 | + $lines[] = '$joinTable->setOptions('.$this->varExport($joinTable->getOptions()).');'; |
|
276 | 276 | |
277 | 277 | $this->exportJoinColumns($joinTable->getJoinColumns(), $lines, 'joinColumns'); |
278 | 278 | |
@@ -292,24 +292,24 @@ discard block |
||
292 | 292 | |
293 | 293 | private function exportJoinColumns(array $joinColumns, array &$lines, $variableName) |
294 | 294 | { |
295 | - $lines[] = '$' . $variableName . ' = array();'; |
|
295 | + $lines[] = '$'.$variableName.' = array();'; |
|
296 | 296 | |
297 | 297 | foreach ($joinColumns as $joinColumn) { |
298 | 298 | /** @var JoinColumnMetadata $joinColumn */ |
299 | 299 | $lines[] = '$joinColumn = new Mapping\JoinColumnMetadata();'; |
300 | 300 | $lines[] = null; |
301 | - $lines[] = '$joinColumn->setTableName("' . $joinColumn->getTableName() . '");'; |
|
302 | - $lines[] = '$joinColumn->setColumnName("' . $joinColumn->getColumnName() . '");'; |
|
303 | - $lines[] = '$joinColumn->setReferencedColumnName("' . $joinColumn->getReferencedColumnName() . '");'; |
|
304 | - $lines[] = '$joinColumn->setAliasedName("' . $joinColumn->getAliasedName() . '");'; |
|
305 | - $lines[] = '$joinColumn->setColumnDefinition("' . $joinColumn->getColumnDefinition() . '");'; |
|
306 | - $lines[] = '$joinColumn->setOnDelete("' . $joinColumn->getOnDelete() . '");'; |
|
307 | - $lines[] = '$joinColumn->setOptions(' . $this->varExport($joinColumn->getOptions()) . ');'; |
|
308 | - $lines[] = '$joinColumn->setNullable("' . $joinColumn->isNullable() . '");'; |
|
309 | - $lines[] = '$joinColumn->setUnique("' . $joinColumn->isUnique() . '");'; |
|
310 | - $lines[] = '$joinColumn->setPrimaryKey("' . $joinColumn->isPrimaryKey() . '");'; |
|
301 | + $lines[] = '$joinColumn->setTableName("'.$joinColumn->getTableName().'");'; |
|
302 | + $lines[] = '$joinColumn->setColumnName("'.$joinColumn->getColumnName().'");'; |
|
303 | + $lines[] = '$joinColumn->setReferencedColumnName("'.$joinColumn->getReferencedColumnName().'");'; |
|
304 | + $lines[] = '$joinColumn->setAliasedName("'.$joinColumn->getAliasedName().'");'; |
|
305 | + $lines[] = '$joinColumn->setColumnDefinition("'.$joinColumn->getColumnDefinition().'");'; |
|
306 | + $lines[] = '$joinColumn->setOnDelete("'.$joinColumn->getOnDelete().'");'; |
|
307 | + $lines[] = '$joinColumn->setOptions('.$this->varExport($joinColumn->getOptions()).');'; |
|
308 | + $lines[] = '$joinColumn->setNullable("'.$joinColumn->isNullable().'");'; |
|
309 | + $lines[] = '$joinColumn->setUnique("'.$joinColumn->isUnique().'");'; |
|
310 | + $lines[] = '$joinColumn->setPrimaryKey("'.$joinColumn->isPrimaryKey().'");'; |
|
311 | 311 | $lines[] = null; |
312 | - $lines[] = '$' . $variableName . '[] = $joinColumn;'; |
|
312 | + $lines[] = '$'.$variableName.'[] = $joinColumn;'; |
|
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | protected function varExport($var) |
322 | 322 | { |
323 | 323 | $export = var_export($var, true); |
324 | - $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export); |
|
324 | + $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export); |
|
325 | 325 | $export = str_replace(' ', ' ', $export); |
326 | 326 | $export = str_replace('array (', 'array(', $export); |
327 | 327 | $export = str_replace('array( ', 'array(', $export); |
@@ -21,9 +21,7 @@ |
||
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Tools\Pagination; |
23 | 23 | |
24 | -use Doctrine\DBAL\Types\Type; |
|
25 | 24 | use Doctrine\ORM\Mapping\AssociationMetadata; |
26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
27 | 25 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
28 | 26 | use Doctrine\ORM\Query; |
29 | 27 | use Doctrine\ORM\Query\TreeWalkerAdapter; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Tools\Pagination; |
6 | 6 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ($property instanceof AssociationMetadata) { |
74 | 74 | throw new \RuntimeException( |
75 | - "Paginating an entity with foreign key as identifier only works when using the Output Walkers. " . |
|
75 | + "Paginating an entity with foreign key as identifier only works when using the Output Walkers. ". |
|
76 | 76 | "Call Paginator#setUseOutputWalkers(true) before iterating the paginator." |
77 | 77 | ); |
78 | 78 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
101 | 101 | $this->createSelectExpressionItem($item->expression), |
102 | - '_dctrn_ord' . $this->aliasCounter++ |
|
102 | + '_dctrn_ord'.$this->aliasCounter++ |
|
103 | 103 | ); |
104 | 104 | } |
105 | 105 | } |
@@ -29,7 +29,6 @@ |
||
29 | 29 | use Doctrine\ORM\Mapping\FieldMetadata; |
30 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
31 | 31 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
32 | -use Doctrine\ORM\Query\QueryException; |
|
33 | 32 | |
34 | 33 | /** |
35 | 34 | * The PersisterHelper contains logic to infer binding types which is used in |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Utility; |
7 | 7 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | |
63 | 63 | // iterate over association mappings |
64 | 64 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
65 | - if (! ($association instanceof AssociationMetadata)) { |
|
65 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
66 | 66 | continue; |
67 | 67 | } |
68 | 68 | |
69 | 69 | // resolve join columns over to-one or to-many |
70 | 70 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
71 | 71 | |
72 | - if (! $association->isOwningSide()) { |
|
72 | + if ( ! $association->isOwningSide()) { |
|
73 | 73 | $association = $targetClass->getProperty($association->getMappedBy()); |
74 | 74 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
75 | 75 | } |
@@ -5,8 +5,6 @@ |
||
5 | 5 | namespace Doctrine\Tests\Mocks; |
6 | 6 | |
7 | 7 | use Doctrine\Common\Collections\Criteria; |
8 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
9 | -use Doctrine\ORM\Mapping\GeneratorType; |
|
10 | 8 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
11 | 9 | |
12 | 10 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\Mocks; |
6 | 6 |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | /** |
236 | 236 | * |
237 | - * @return kateglo\application\helpers\collections\ArrayCollection |
|
237 | + * @return ArrayCollection |
|
238 | 238 | */ |
239 | 239 | public function getTypes() |
240 | 240 | { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | /** |
339 | 339 | * |
340 | - * @param kateglo\application\models\Lemma $lemma |
|
340 | + * @param Lemma $lemma |
|
341 | 341 | * @return void |
342 | 342 | */ |
343 | 343 | public function addLemma(Lemma $lemma) |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | |
351 | 351 | /** |
352 | 352 | * |
353 | - * @param kateglo\application\models\Lemma $lemma |
|
353 | + * @param Lemma $lemma |
|
354 | 354 | * @return void |
355 | 355 | */ |
356 | 356 | public function removeLEmma(Lemma $lemma) |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * |
207 | 207 | * @return string |
208 | 208 | */ |
209 | - public function getLemma(){ |
|
209 | + public function getLemma() { |
|
210 | 210 | return $this->lemma; |
211 | 211 | } |
212 | 212 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function addType(Type $type) |
217 | 217 | { |
218 | - if (!$this->types->contains($type)) { |
|
218 | + if ( ! $this->types->contains($type)) { |
|
219 | 219 | $this->types[] = $type; |
220 | 220 | $type->addLemma($this); |
221 | 221 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public function addLemma(Lemma $lemma) |
344 | 344 | { |
345 | - if (!$this->lemmas->contains($lemma)) { |
|
345 | + if ( ! $this->lemmas->contains($lemma)) { |
|
346 | 346 | $this->lemmas[] = $lemma; |
347 | 347 | $lemma->addType($this); |
348 | 348 | } |
@@ -3,7 +3,6 @@ |
||
3 | 3 | declare(strict_types=1); |
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | -use Doctrine\Common\Util\Debug; |
|
7 | 6 | use Doctrine\ORM\ORMException; |
8 | 7 | use Doctrine\ORM\Query\QueryException; |
9 | 8 | use Doctrine\Tests\Models\Navigation\NavCountry; |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $this->putTripAroundEurope(); |
113 | 113 | |
114 | 114 | $dql = 'SELECT t, p, c ' |
115 | - . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
116 | - . 'INNER JOIN t.pois p ' |
|
117 | - . 'INNER JOIN p.country c' |
|
115 | + . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
116 | + . 'INNER JOIN t.pois p ' |
|
117 | + . 'INNER JOIN p.country c' |
|
118 | 118 | ; |
119 | 119 | |
120 | 120 | $tours = $this->em->createQuery($dql)->getResult(); |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | $this->putTripAroundEurope(); |
135 | 135 | |
136 | 136 | $dql = 'SELECT t ' |
137 | - . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
138 | - . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' |
|
139 | - . 'WHERE p MEMBER OF t.pois' |
|
137 | + . 'FROM Doctrine\Tests\Models\Navigation\NavTour t ' |
|
138 | + . ', Doctrine\Tests\Models\Navigation\NavPointOfInterest p ' |
|
139 | + . 'WHERE p MEMBER OF t.pois' |
|
140 | 140 | ; |
141 | 141 | |
142 | 142 | $query = $this->em->createQuery($dql); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 | use Doctrine\Common\Util\Debug; |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 | |
7 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
8 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
9 | 8 | use Doctrine\Tests\Models\CMS\CmsArticle; |
10 | 9 | use Doctrine\Tests\Models\CMS\CmsGroup; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->useModelSet('ddc2504'); |
44 | 44 | parent::setUp(); |
45 | 45 | |
46 | - $class = $this->em->getClassMetadata(CmsUser::class); |
|
46 | + $class = $this->em->getClassMetadata(CmsUser::class); |
|
47 | 47 | |
48 | 48 | $class->getProperty('groups')->setFetchMode(FetchMode::EXTRA_LAZY); |
49 | 49 | $class->getProperty('articles')->setFetchMode(FetchMode::EXTRA_LAZY); |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | $queryCount = $this->getCurrentQueryCount(); |
306 | 306 | self::assertFalse($user->articles->contains($article)); |
307 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
307 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
308 | 308 | self::assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); |
309 | 309 | |
310 | 310 | // Test One to Many existence with state managed |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | |
472 | 472 | $queryCount = $this->getCurrentQueryCount(); |
473 | 473 | self::assertTrue($group->users->contains($user)); |
474 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
474 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
475 | 475 | self::assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); |
476 | 476 | |
477 | 477 | $newUser = new CmsUser(); |
@@ -1251,7 +1251,7 @@ discard block |
||
1251 | 1251 | $user = new User(); |
1252 | 1252 | $userList = new UserList(); |
1253 | 1253 | |
1254 | - $user->name = 'ocramius'; |
|
1254 | + $user->name = 'ocramius'; |
|
1255 | 1255 | $userList->listName = 'PHP Developers to follow closely'; |
1256 | 1256 | |
1257 | 1257 | $user->addUserList($userList); |
@@ -6,8 +6,6 @@ |
||
6 | 6 | |
7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
9 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
10 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Tests a self referential many-to-many association mapping (from a model to the same model, without inheritance). |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 |
@@ -7,8 +7,6 @@ |
||
7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceCart; |
9 | 9 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
10 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
11 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Tests a unidirectional many-to-many association mapping (without inheritance). |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | 6 |