@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | ) ? $connection->getConfiguration()->getSchemaAssetsFilter() : null; |
169 | 169 | |
170 | 170 | //Disable foreign key checks |
171 | - if($platform instanceof AbstractMySQLPlatform) { |
|
171 | + if ($platform instanceof AbstractMySQLPlatform) { |
|
172 | 172 | $connection->executeQuery('SET foreign_key_checks = 0;'); |
173 | 173 | } |
174 | 174 | |
175 | 175 | foreach ($orderedTables as $tbl) { |
176 | 176 | // If we have a filter expression, check it and skip if necessary |
177 | - if (! $emptyFilterExpression && ! preg_match($filterExpr, $tbl)) { |
|
177 | + if (!$emptyFilterExpression && !preg_match($filterExpr, $tbl)) { |
|
178 | 178 | continue; |
179 | 179 | } |
180 | 180 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | // Support schema asset filters as presented in |
187 | - if (is_callable($schemaAssetsFilter) && ! $schemaAssetsFilter($tbl)) { |
|
187 | + if (is_callable($schemaAssetsFilter) && !$schemaAssetsFilter($tbl)) { |
|
188 | 188 | continue; |
189 | 189 | } |
190 | 190 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | //Reenable foreign key checks |
205 | - if($platform instanceof AbstractMySQLPlatform) { |
|
205 | + if ($platform instanceof AbstractMySQLPlatform) { |
|
206 | 206 | $connection->executeQuery('SET foreign_key_checks = 1;'); |
207 | 207 | } |
208 | 208 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $tableIdentifier = new Identifier($tableName); |
213 | 213 | |
214 | - return 'ALTER TABLE '. $tableIdentifier->getQuotedName($platform) .' AUTO_INCREMENT = 1;'; |
|
214 | + return 'ALTER TABLE '.$tableIdentifier->getQuotedName($platform).' AUTO_INCREMENT = 1;'; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $sorter = new TopologicalSorter(); |
225 | 225 | |
226 | 226 | foreach ($classes as $class) { |
227 | - if (! $sorter->hasNode($class->name)) { |
|
227 | + if (!$sorter->hasNode($class->name)) { |
|
228 | 228 | $sorter->addNode($class->name, $class); |
229 | 229 | } |
230 | 230 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $parentClass = $em->getClassMetadata($parentClass); |
234 | 234 | $parentClassName = $parentClass->getName(); |
235 | 235 | |
236 | - if (! $sorter->hasNode($parentClassName)) { |
|
236 | + if (!$sorter->hasNode($parentClassName)) { |
|
237 | 237 | $sorter->addNode($parentClassName, $parentClass); |
238 | 238 | } |
239 | 239 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | foreach ($class->associationMappings as $assoc) { |
244 | - if (! $assoc['isOwningSide']) { |
|
244 | + if (!$assoc['isOwningSide']) { |
|
245 | 245 | continue; |
246 | 246 | } |
247 | 247 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | assert($targetClass instanceof ClassMetadata); |
250 | 250 | $targetClassName = $targetClass->getName(); |
251 | 251 | |
252 | - if (! $sorter->hasNode($targetClassName)) { |
|
252 | + if (!$sorter->hasNode($targetClassName)) { |
|
253 | 253 | $sorter->addNode($targetClassName, $targetClass); |
254 | 254 | } |
255 | 255 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $parentClass = $em->getClassMetadata($parentClass); |
262 | 262 | $parentClassName = $parentClass->getName(); |
263 | 263 | |
264 | - if (! $sorter->hasNode($parentClassName)) { |
|
264 | + if (!$sorter->hasNode($parentClassName)) { |
|
265 | 265 | $sorter->addNode($parentClassName, $parentClass); |
266 | 266 | } |
267 | 267 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | foreach ($classes as $class) { |
286 | 286 | foreach ($class->associationMappings as $assoc) { |
287 | - if (! $assoc['isOwningSide'] || $assoc['type'] !== ClassMetadataInfo::MANY_TO_MANY) { |
|
287 | + if (!$assoc['isOwningSide'] || $assoc['type'] !== ClassMetadataInfo::MANY_TO_MANY) { |
|
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | |
298 | 298 | private function getTableName(ClassMetadata $class, AbstractPlatform $platform): string |
299 | 299 | { |
300 | - if (isset($class->table['schema']) && ! method_exists($class, 'getSchemaName')) { |
|
301 | - return $class->table['schema'] . '.' . |
|
300 | + if (isset($class->table['schema']) && !method_exists($class, 'getSchemaName')) { |
|
301 | + return $class->table['schema'].'.'. |
|
302 | 302 | $this->em->getConfiguration() |
303 | 303 | ->getQuoteStrategy() |
304 | 304 | ->getTableName($class, $platform); |
@@ -315,8 +315,8 @@ discard block |
||
315 | 315 | ClassMetadata $class, |
316 | 316 | AbstractPlatform $platform |
317 | 317 | ): string { |
318 | - if (isset($assoc['joinTable']['schema']) && ! method_exists($class, 'getSchemaName')) { |
|
319 | - return $assoc['joinTable']['schema'] . '.' . |
|
318 | + if (isset($assoc['joinTable']['schema']) && !method_exists($class, 'getSchemaName')) { |
|
319 | + return $assoc['joinTable']['schema'].'.'. |
|
320 | 320 | $this->em->getConfiguration() |
321 | 321 | ->getQuoteStrategy() |
322 | 322 | ->getJoinTableName($assoc, $class, $platform); |
@@ -329,6 +329,6 @@ discard block |
||
329 | 329 | { |
330 | 330 | $tableIdentifier = new Identifier($tableName); |
331 | 331 | |
332 | - return 'DELETE FROM ' . $tableIdentifier->getQuotedName($platform); |
|
332 | + return 'DELETE FROM '.$tableIdentifier->getQuotedName($platform); |
|
333 | 333 | } |
334 | 334 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function buildForm(FormBuilderInterface $builder, array $options): void |
73 | 73 | { |
74 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (PreSubmitEvent $event) { |
|
74 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(PreSubmitEvent $event) { |
|
75 | 75 | //When the data contains non-digit characters, we assume that the user entered a new element. |
76 | 76 | //In that case we add the new element to our choice_loader |
77 | 77 | |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | }); |
90 | 90 | |
91 | 91 | $builder->addModelTransformer(new CallbackTransformer( |
92 | - function ($value) use ($options) { |
|
92 | + function($value) use ($options) { |
|
93 | 93 | return $this->modelTransform($value, $options); |
94 | - }, function ($value) use ($options) { |
|
94 | + }, function($value) use ($options) { |
|
95 | 95 | return $this->modelReverseTransform($value, $options); |
96 | 96 | })); |
97 | 97 | } |
@@ -102,29 +102,29 @@ discard block |
||
102 | 102 | $resolver->setDefaults([ |
103 | 103 | 'allow_add' => false, |
104 | 104 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
105 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
106 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
107 | - 'choice_value' => function (?AbstractStructuralDBElement $element) { |
|
105 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
106 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
107 | + 'choice_value' => function(?AbstractStructuralDBElement $element) { |
|
108 | 108 | if ($element === null) { |
109 | 109 | return null; |
110 | 110 | } |
111 | 111 | |
112 | 112 | return (string) $element->getID() ?? $element->getFullPath('->'); |
113 | 113 | }, //Use the element id as option value and for comparing items |
114 | - 'choice_loader' => function (Options $options) { |
|
114 | + 'choice_loader' => function(Options $options) { |
|
115 | 115 | return new StructuralEntityChoiceLoader($options, $this->builder, $this->em); |
116 | 116 | }, |
117 | - 'choice_label' => function (Options $options) { |
|
118 | - return function ($choice, $key, $value) use ($options) { |
|
117 | + 'choice_label' => function(Options $options) { |
|
118 | + return function($choice, $key, $value) use ($options) { |
|
119 | 119 | return $this->generateChoiceLabels($choice, $key, $value, $options); |
120 | 120 | }; |
121 | 121 | }, |
122 | - 'choice_attr' => function (Options $options) { |
|
123 | - return function ($choice, $key, $value) use ($options) { |
|
122 | + 'choice_attr' => function(Options $options) { |
|
123 | + return function($choice, $key, $value) use ($options) { |
|
124 | 124 | return $this->generateChoiceAttr($choice, $key, $value, $options); |
125 | 125 | }; |
126 | 126 | }, |
127 | - 'group_by' => function (AbstractStructuralDBElement $element) |
|
127 | + 'group_by' => function(AbstractStructuralDBElement $element) |
|
128 | 128 | { |
129 | 129 | //Show entities that are not added to DB yet separately from other entities |
130 | 130 | if ($element->getID() === null) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ]); |
138 | 138 | |
139 | 139 | //Set the constraints for the case that allow add is enabled (we then have to check that the new element is valid) |
140 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
140 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
141 | 141 | if ($options['allow_add']) { |
142 | 142 | $value[] = new Valid(); |
143 | 143 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | $resolver->setDefault('controller', 'elements--structural-entity-select'); |
151 | 151 | |
152 | - $resolver->setDefault('attr', function (Options $options) { |
|
152 | + $resolver->setDefault('attr', function(Options $options) { |
|
153 | 153 | $tmp = [ |
154 | 154 | 'data-controller' => $options['controller'], |
155 | 155 | 'data-allow-add' => $options['allow_add'] ? 'true' : 'false', |