@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getParamAnnotation(): ParamTag |
69 | 69 | { |
70 | - return new ParamTag($this->getSafeVariableName(), [ $this->getPhpType() ]); |
|
70 | + return new ParamTag($this->getSafeVariableName(), [$this->getPhpType()]); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | public function getVariableName(): string |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function getSafeVariableName(): string |
79 | 79 | { |
80 | - return '$' . StringUtils::getValidVariableName(ltrim($this->getVariableName(), '$')); |
|
80 | + return '$'.StringUtils::getValidVariableName(ltrim($this->getVariableName(), '$')); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | public function getSetterName(): string |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getPhpType(): string |
89 | 89 | { |
90 | - return '\\' . $this->beanNamespace . '\\' . $this->getClassName(); |
|
90 | + return '\\'.$this->beanNamespace.'\\'.$this->getClassName(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $referencedBeanName = $this->namingStrategy->getBeanClassName($this->foreignKey->getForeignTableName()); |
161 | 161 | |
162 | 162 | $getter = new MethodGenerator($getterName); |
163 | - $getter->setDocBlock(new DocBlockGenerator('Returns the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.')); |
|
163 | + $getter->setDocBlock(new DocBlockGenerator('Returns the '.$referencedBeanName.' object bound to this object via the '.implode(' and ', $this->foreignKey->getUnquotedLocalColumns()).' column.')); |
|
164 | 164 | |
165 | 165 | /*$types = [ $referencedBeanName ]; |
166 | 166 | if ($isNullable) { |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | } |
169 | 169 | $getter->getDocBlock()->setTag(new ReturnTag($types));*/ |
170 | 170 | |
171 | - $getter->setReturnType(($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName); |
|
171 | + $getter->setReturnType(($isNullable ? '?' : '').$this->beanNamespace.'\\'.$referencedBeanName); |
|
172 | 172 | $tdbmFk = ForeignKey::createFromFk($this->foreignKey); |
173 | 173 | |
174 | - $getter->setBody('return $this->getRef(' . var_export($tdbmFk->getCacheKey(), true) . ', ' . var_export($tableName, true) . ');'); |
|
174 | + $getter->setBody('return $this->getRef('.var_export($tdbmFk->getCacheKey(), true).', '.var_export($tableName, true).');'); |
|
175 | 175 | |
176 | 176 | if ($this->isGetterProtected()) { |
177 | 177 | $getter->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED); |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | |
180 | 180 | if (!$this->isReadOnly()) { |
181 | 181 | $setter = new MethodGenerator($setterName); |
182 | - $setter->setDocBlock(new DocBlockGenerator('The setter for the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.')); |
|
182 | + $setter->setDocBlock(new DocBlockGenerator('The setter for the '.$referencedBeanName.' object bound to this object via the '.implode(' and ', $this->foreignKey->getUnquotedLocalColumns()).' column.')); |
|
183 | 183 | |
184 | - $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName)); |
|
184 | + $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '').$this->beanNamespace.'\\'.$referencedBeanName)); |
|
185 | 185 | |
186 | 186 | $setter->setReturnType('void'); |
187 | 187 | |
188 | - $setter->setBody('$this->setRef(' . var_export($tdbmFk->getCacheKey(), true) . ', $object, ' . var_export($tableName, true) . ');'); |
|
188 | + $setter->setBody('$this->setRef('.var_export($tdbmFk->getCacheKey(), true).', $object, '.var_export($tableName, true).');'); |
|
189 | 189 | |
190 | 190 | if ($this->isSetterProtected()) { |
191 | 191 | $setter->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | /** @var Annotation\JsonFormat|null $jsonFormat */ |
225 | 225 | $jsonFormat = $this->findAnnotation(Annotation\JsonFormat::class); |
226 | 226 | if ($jsonFormat !== null) { |
227 | - $method = $jsonFormat->method ?? 'get' . ucfirst($jsonFormat->property); |
|
227 | + $method = $jsonFormat->method ?? 'get'.ucfirst($jsonFormat->property); |
|
228 | 228 | $format = "$method()"; |
229 | 229 | } else { |
230 | 230 | $stopRecursion = $this->findAnnotation(Annotation\JsonRecursive::class) ? '' : 'true'; |
@@ -280,10 +280,10 @@ discard block |
||
280 | 280 | } elseif ($descriptor instanceof ScalarBeanPropertyDescriptor) { |
281 | 281 | $rows[] = "'$indexName' => $propertyAccess->$columnGetterName()"; |
282 | 282 | } else { |
283 | - throw new TDBMException('PropertyDescriptor of class `' . get_class($descriptor) . '` cannot be serialized.'); |
|
283 | + throw new TDBMException('PropertyDescriptor of class `'.get_class($descriptor).'` cannot be serialized.'); |
|
284 | 284 | } |
285 | 285 | } |
286 | - return '[' . implode(', ', $rows) . ']'; |
|
286 | + return '['.implode(', ', $rows).']'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | private function getBeanPropertyDescriptor(string $column): AbstractBeanPropertyDescriptor |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | return $descriptor; |
297 | 297 | } |
298 | 298 | } |
299 | - throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`' . $column . '` not found in `' . $this->foreignBeanDescriptor->getTable()->getName() . '`'); |
|
299 | + throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`'.$column.'` not found in `'.$this->foreignBeanDescriptor->getTable()->getName().'`'); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public static function generateModelKey(ForeignKeyConstraint $remoteFk, ForeignKeyConstraint $localFk): string |
50 | 50 | { |
51 | - return $remoteFk->getLocalTableName() . "." . implode("__", $localFk->getUnquotedLocalColumns()); |
|
51 | + return $remoteFk->getLocalTableName().".".implode("__", $localFk->getUnquotedLocalColumns()); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function getPivotName(): string |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $join[] = sprintf('%s.%s = %s.%s', $mainTable, $column, $pivotTable, $this->joinLocalKeys[$key]); |
72 | 72 | } |
73 | 73 | |
74 | - return $mainTable . ' JOIN ' . $pivotTable . ' ON ' . implode(' AND ', $join); |
|
74 | + return $mainTable.' JOIN '.$pivotTable.' ON '.implode(' AND ', $join); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function getPivotWhere(): string |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $params = []; |
93 | 93 | foreach ($primaryKeys as $key => $primaryKeyValue) { |
94 | - $params['param' . $key] = $primaryKeyValue; |
|
94 | + $params['param'.$key] = $primaryKeyValue; |
|
95 | 95 | } |
96 | 96 | return $params; |
97 | 97 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function getConstructorProperties(): array |
216 | 216 | { |
217 | - $constructorProperties = array_filter($this->beanPropertyDescriptors, static function (AbstractBeanPropertyDescriptor $property) { |
|
217 | + $constructorProperties = array_filter($this->beanPropertyDescriptors, static function(AbstractBeanPropertyDescriptor $property) { |
|
218 | 218 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->isCompulsory() && !$property->isReadOnly(); |
219 | 219 | }); |
220 | 220 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | public function getPropertiesWithDefault(): array |
230 | 230 | { |
231 | 231 | $properties = $this->getPropertiesForTable($this->table); |
232 | - $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) { |
|
232 | + $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) { |
|
233 | 233 | return $property->hasDefault(); |
234 | 234 | }); |
235 | 235 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function getExposedProperties(): array |
245 | 245 | { |
246 | - $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
246 | + $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
247 | 247 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->getTable()->getName() === $this->table->getName(); |
248 | 248 | }); |
249 | 249 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | foreach ($beanPropertyDescriptors as $beanDescriptor) { |
350 | 350 | $name = $beanDescriptor->getGetterName(); |
351 | 351 | if (isset($names[$name])) { |
352 | - throw new TDBMException('Unsolvable name conflict while generating method name "' . $name . '"'); |
|
352 | + throw new TDBMException('Unsolvable name conflict while generating method name "'.$name.'"'); |
|
353 | 353 | } else { |
354 | 354 | $names[$name] = $beanDescriptor; |
355 | 355 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $assigns[] = $property->assignToDefaultCode()."\n"; |
399 | 399 | } |
400 | 400 | |
401 | - $body = $parentConstructorCode . implode('', $assigns); |
|
401 | + $body = $parentConstructorCode.implode('', $assigns); |
|
402 | 402 | |
403 | 403 | $constructor->setBody($body); |
404 | 404 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $this->descriptorsByMethodName[$name][] = $descriptor; |
473 | 473 | $descriptors = $this->descriptorsByMethodName[$name]; |
474 | 474 | if (count($descriptors) > 1) { |
475 | - $properties = array_filter($descriptors, function ($descriptor) { |
|
475 | + $properties = array_filter($descriptors, function($descriptor) { |
|
476 | 476 | return $descriptor instanceof AbstractBeanPropertyDescriptor; |
477 | 477 | }); |
478 | 478 | $renameProperties = count($properties) > 1; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | foreach ($this->getExposedProperties() as $beanPropertyDescriptor) { |
524 | 524 | $propertyCode = $beanPropertyDescriptor->getJsonSerializeCode(); |
525 | 525 | if (!empty($propertyCode)) { |
526 | - $body .= PHP_EOL . $propertyCode; |
|
526 | + $body .= PHP_EOL.$propertyCode; |
|
527 | 527 | } |
528 | 528 | } |
529 | 529 | |
@@ -531,11 +531,11 @@ discard block |
||
531 | 531 | foreach ($this->getMethodDescriptors() as $methodDescriptor) { |
532 | 532 | $methodCode = $methodDescriptor->getJsonSerializeCode(); |
533 | 533 | if (!empty($methodCode)) { |
534 | - $body .= PHP_EOL . $methodCode; |
|
534 | + $body .= PHP_EOL.$methodCode; |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
538 | - $body .= PHP_EOL . 'return $array;'; |
|
538 | + $body .= PHP_EOL.'return $array;'; |
|
539 | 539 | |
540 | 540 | $method->setBody($body); |
541 | 541 | |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | /** @var AddInterface[] $addInterfaceAnnotations */ |
631 | 631 | $addInterfaceAnnotations = $this->annotationParser->getTableAnnotations($this->table)->findAnnotations(AddInterface::class); |
632 | 632 | |
633 | - $interfaces = [ JsonSerializable::class ]; |
|
633 | + $interfaces = [JsonSerializable::class]; |
|
634 | 634 | foreach ($addInterfaceAnnotations as $annotation) { |
635 | 635 | $interfaces[] = $annotation->getName(); |
636 | 636 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } |
671 | 671 | } elseif ($methodDescriptor instanceof PivotTableMethodsDescriptor) { |
672 | 672 | $pivotTableMethodsDescriptors[] = $methodDescriptor; |
673 | - [ $getter, $adder, $remover, $has, $setter ] = $methodDescriptor->getCode(); |
|
673 | + [$getter, $adder, $remover, $has, $setter] = $methodDescriptor->getCode(); |
|
674 | 674 | $methods = $this->codeGeneratorListener->onBaseBeanManyToManyGenerated($getter, $adder, $remover, $has, $setter, $methodDescriptor, $this, $this->configuration, $class); |
675 | 675 | foreach ($methods as $method) { |
676 | 676 | if ($method) { |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | |
819 | 819 | $constructorMethod = new MethodGenerator( |
820 | 820 | '__construct', |
821 | - [ new ParameterGenerator('tdbmService', TDBMService::class) ], |
|
821 | + [new ParameterGenerator('tdbmService', TDBMService::class)], |
|
822 | 822 | MethodGenerator::FLAG_PUBLIC, |
823 | 823 | '$this->tdbmService = $tdbmService;', |
824 | 824 | 'Sets the TDBM service used by this DAO.' |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | |
831 | 831 | $saveMethod = new MethodGenerator( |
832 | 832 | 'save', |
833 | - [ new ParameterGenerator('obj', $beanClassName) ], |
|
833 | + [new ParameterGenerator('obj', $beanClassName)], |
|
834 | 834 | MethodGenerator::FLAG_PUBLIC, |
835 | 835 | '$this->tdbmService->save($obj);', |
836 | 836 | (new DocBlockGenerator( |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $findAllBody, |
865 | 865 | (new DocBlockGenerator("Get all $beanClassWithoutNameSpace records."))->setWordWrap(false) |
866 | 866 | ); |
867 | - $findAllMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
867 | + $findAllMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
868 | 868 | $findAllMethod = $this->codeGeneratorListener->onBaseDaoFindAllGenerated($findAllMethod, $this, $this->configuration, $class); |
869 | 869 | if ($findAllMethod !== null) { |
870 | 870 | $class->addMethodFromGenerator($findAllMethod); |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | |
879 | 879 | foreach ($primaryKeyColumns as $primaryKeyColumn) { |
880 | 880 | if ($primaryKeyColumn === $lazyLoadingParameterName) { |
881 | - throw new TDBMException('Primary Column name `' . $lazyLoadingParameterName . '` is not allowed.'); |
|
881 | + throw new TDBMException('Primary Column name `'.$lazyLoadingParameterName.'` is not allowed.'); |
|
882 | 882 | } |
883 | 883 | $phpType = TDBMDaoGenerator::dbalTypeToPhpType($this->table->getColumn($primaryKeyColumn)->getType()); |
884 | 884 | $parameters[] = new ParameterGenerator($primaryKeyColumn, $phpType); |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | 'getById', |
895 | 895 | $parameters, |
896 | 896 | MethodGenerator::FLAG_PUBLIC, |
897 | - "return \$this->tdbmService->findObjectByPk('$tableName', [" . implode(', ', $primaryKeyFilter) . "], [], \$$lazyLoadingParameterName);", |
|
897 | + "return \$this->tdbmService->findObjectByPk('$tableName', [".implode(', ', $primaryKeyFilter)."], [], \$$lazyLoadingParameterName);", |
|
898 | 898 | (new DocBlockGenerator( |
899 | 899 | "Get $beanClassWithoutNameSpace specified by its ID (its primary key).", |
900 | 900 | 'If the primary key does not exist, an exception is thrown.', |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | ] |
972 | 972 | ))->setWordWrap(false) |
973 | 973 | ); |
974 | - $findMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
974 | + $findMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
975 | 975 | $findMethod = $this->codeGeneratorListener->onBaseDaoFindGenerated($findMethod, $this, $this->configuration, $class); |
976 | 976 | if ($findMethod !== null) { |
977 | 977 | $class->addMethodFromGenerator($findMethod); |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | ] |
1014 | 1014 | ))->setWordWrap(false) |
1015 | 1015 | ); |
1016 | - $findFromSqlMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
1016 | + $findFromSqlMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
1017 | 1017 | $findFromSqlMethod = $this->codeGeneratorListener->onBaseDaoFindFromSqlGenerated($findFromSqlMethod, $this, $this->configuration, $class); |
1018 | 1018 | if ($findFromSqlMethod !== null) { |
1019 | 1019 | $class->addMethodFromGenerator($findFromSqlMethod); |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | ] |
1049 | 1049 | ))->setWordWrap(false) |
1050 | 1050 | ); |
1051 | - $findFromRawSqlMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
1051 | + $findFromRawSqlMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
1052 | 1052 | $findFromRawSqlMethod = $this->codeGeneratorListener->onBaseDaoFindFromRawSqlGenerated($findFromRawSqlMethod, $this, $this->configuration, $class); |
1053 | 1053 | if ($findFromRawSqlMethod !== null) { |
1054 | 1054 | $class->addMethodFromGenerator($findFromRawSqlMethod); |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | $class->setDocBlock((new DocBlockGenerator( |
1183 | 1183 | "The $baseClassName class will iterate over results of $beanClassWithoutNameSpace class.", |
1184 | 1184 | null, |
1185 | - [new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]'])] |
|
1185 | + [new Tag\MethodTag('getIterator', ['\\'.$beanClassName.'[]'])] |
|
1186 | 1186 | ))->setWordWrap(false)); |
1187 | 1187 | |
1188 | 1188 | $file = $this->codeGeneratorListener->onBaseResultIteratorGenerated($file, $this, $this->configuration); |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | } |
1239 | 1239 | } |
1240 | 1240 | } |
1241 | - usort($methods, static function (MethodGenerator $methodA, MethodGenerator $methodB) { |
|
1241 | + usort($methods, static function(MethodGenerator $methodA, MethodGenerator $methodB) { |
|
1242 | 1242 | return $methodA->getName() <=> $methodB->getName(); |
1243 | 1243 | }); |
1244 | 1244 | |
@@ -1387,11 +1387,11 @@ discard block |
||
1387 | 1387 | |
1388 | 1388 | if ($index->isUnique()) { |
1389 | 1389 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
1390 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
1391 | - $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName, 'null' ]); |
|
1390 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
1391 | + $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName, 'null']); |
|
1392 | 1392 | $method->setReturnType('?\\'.$beanNamespace.'\\'.$beanClassName); |
1393 | 1393 | |
1394 | - $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments). '.', null, $params); |
|
1394 | + $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments).'.', null, $params); |
|
1395 | 1395 | $docBlock->setWordWrap(false); |
1396 | 1396 | |
1397 | 1397 | $body = "\$filter = [ |
@@ -1400,12 +1400,12 @@ discard block |
||
1400 | 1400 | "; |
1401 | 1401 | } else { |
1402 | 1402 | $parameters[] = (new ParameterGenerator('orderBy'))->setDefaultValue(null); |
1403 | - $params[] = new ParamTag('orderBy', [ 'mixed' ], 'The order string'); |
|
1403 | + $params[] = new ParamTag('orderBy', ['mixed'], 'The order string'); |
|
1404 | 1404 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
1405 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
1405 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
1406 | 1406 | $parameters[] = (new ParameterGenerator('mode', '?int'))->setDefaultValue(null); |
1407 | - $params[] = new ParamTag('mode', [ 'int', 'null' ], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
1408 | - $method->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
1407 | + $params[] = new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
1408 | + $method->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
1409 | 1409 | |
1410 | 1410 | $docBlock = new DocBlockGenerator("Get a list of $beanClassName filtered by ".implode(', ', $commentArguments).".", null, $params); |
1411 | 1411 | $docBlock->setWordWrap(false); |
@@ -1722,17 +1722,17 @@ discard block |
||
1722 | 1722 | * @param string $indent |
1723 | 1723 | * @return string |
1724 | 1724 | */ |
1725 | - private function psr2VarExport($var, string $indent=''): string |
|
1725 | + private function psr2VarExport($var, string $indent = ''): string |
|
1726 | 1726 | { |
1727 | 1727 | if (is_array($var)) { |
1728 | 1728 | $indexed = array_keys($var) === range(0, count($var) - 1); |
1729 | 1729 | $r = []; |
1730 | 1730 | foreach ($var as $key => $value) { |
1731 | 1731 | $r[] = "$indent " |
1732 | - . ($indexed ? '' : $this->psr2VarExport($key) . ' => ') |
|
1732 | + . ($indexed ? '' : $this->psr2VarExport($key).' => ') |
|
1733 | 1733 | . $this->psr2VarExport($value, "$indent "); |
1734 | 1734 | } |
1735 | - return "[\n" . implode(",\n", $r) . "\n" . $indent . ']'; |
|
1735 | + return "[\n".implode(",\n", $r)."\n".$indent.']'; |
|
1736 | 1736 | } |
1737 | 1737 | return var_export($var, true); |
1738 | 1738 | } |