@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** @var ClassDefinition $classDef */ |
| 40 | 40 | foreach ($this->classCollectionPreparation->process($this->reader) as $classDef) { |
| 41 | 41 | $classRendered = $this->renderer->render($classDef); |
| 42 | - $classname = $classDef->getNamespace().'\\'.$classDef->getName(); |
|
| 42 | + $classname = $classDef->getNamespace() . '\\' . $classDef->getName(); |
|
| 43 | 43 | |
| 44 | 44 | $this->writer->write($classname, $classRendered); |
| 45 | 45 | $this->logger->debug(sprintf('Generated class "%s"', $classname)); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | return $className; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - return $this->generateNamespace($className).'\\'.$this->generateClassnameShort($className); |
|
| 63 | + return $this->generateNamespace($className) . '\\' . $this->generateClassnameShort($className); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -76,10 +76,10 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if (1 === \count($exploded)) { |
| 79 | - return $className.ucfirst($this->classSuffix); |
|
| 79 | + return $className . ucfirst($this->classSuffix); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - return array_pop($exploded).ucfirst($this->classSuffix); |
|
| 82 | + return array_pop($exploded) . ucfirst($this->classSuffix); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $methodSuffix = $this->nameNormalizer->normalize($propertyName); |
| 42 | 42 | |
| 43 | 43 | $methodDef = new MethodDefinition(); |
| 44 | - $methodDef->setName('set'.ucfirst($methodSuffix)); |
|
| 44 | + $methodDef->setName('set' . ucfirst($methodSuffix)); |
|
| 45 | 45 | // $methodDef->setBody(sprintf("\$this->%s = $%s;\r\n\r\nreturn \$this;", $propertyName, $propertyName)); |
| 46 | 46 | |
| 47 | 47 | if ($propertyDefinition->isCollection()) { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $attributesMetaMethod->setTypesReturn(['array']); |
| 44 | 44 | $attributesMetaMethod->setVisibility('protected'); |
| 45 | 45 | $attributesMetaMethod->setBody( |
| 46 | - 'return '.var_export($metadataArray, true).';' |
|
| 46 | + 'return ' . var_export($metadataArray, true) . ';' |
|
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $classDefinition->addMethod($attributesMetaMethod); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $propertyName = $propertyDefinition->getName(); |
| 39 | 39 | $methodSuffix = $this->nameNormalizer->normalize($propertyName); |
| 40 | 40 | $methodDefinition = new MethodDefinition(); |
| 41 | - $methodDefinition->setName('get'.ucfirst($methodSuffix)); |
|
| 41 | + $methodDefinition->setName('get' . ucfirst($methodSuffix)); |
|
| 42 | 42 | $methodDefinition->setTypesReturn($propertyDefinition->getTypes()); |
| 43 | 43 | $methodDefinition->setVisibility('public'); |
| 44 | 44 | $methodDefinition->setBody(sprintf('return $this->%s;', $propertyName)); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | protected function addComment(ClassDefinition $classDefinition, string $comment, ?string $commentPrefix): void |
| 46 | 46 | { |
| 47 | - $text = $commentPrefix ? $commentPrefix.' '.$comment : $comment; |
|
| 47 | + $text = $commentPrefix ? $commentPrefix . ' ' . $comment : $comment; |
|
| 48 | 48 | |
| 49 | 49 | $classDefinition->addComment($text); |
| 50 | 50 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | public function getIterator(): \Traversable |
| 68 | 68 | { |
| 69 | - return (function () { |
|
| 69 | + return (function() { |
|
| 70 | 70 | foreach ($this->items as $item) { |
| 71 | 71 | yield $item; |
| 72 | 72 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function getIterator(): \Traversable |
| 65 | 65 | { |
| 66 | - return (function () { |
|
| 66 | + return (function() { |
|
| 67 | 67 | foreach ($this->attributesMetadata() as $attributeName => $meta) { |
| 68 | 68 | yield $attributeName => $this->offsetGet($attributeName); |
| 69 | 69 | } |
@@ -103,6 +103,6 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $actionName = $meta['actionName']; |
| 105 | 105 | |
| 106 | - return $this->{$method.$actionName}($value); |
|
| 106 | + return $this->{$method . $actionName}($value); |
|
| 107 | 107 | } |
| 108 | 108 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $this->createPath($path); |
| 43 | 43 | |
| 44 | - file_put_contents($path.\DIRECTORY_SEPARATOR.$file, $renderedClassData); |
|
| 44 | + file_put_contents($path . \DIRECTORY_SEPARATOR . $file, $renderedClassData); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | $path = rtrim($this->classFilePath, '\\'); |
| 60 | 60 | if (1 !== \count($classExploded)) { |
| 61 | 61 | $file = array_pop($explodedFile); |
| 62 | - $path = $path.'\\'.implode(\DIRECTORY_SEPARATOR, $explodedFile); |
|
| 62 | + $path = $path . '\\' . implode(\DIRECTORY_SEPARATOR, $explodedFile); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return [ |
| 66 | - 'file' => $file.'.php', |
|
| 66 | + 'file' => $file . '.php', |
|
| 67 | 67 | 'path' => str_replace('\\', '/', $path), |
| 68 | 68 | ]; |
| 69 | 69 | } |