@@ -68,17 +68,17 @@ discard block |
||
68 | 68 | |
69 | 69 | public function setBooks(iterable|null $books): self |
70 | 70 | { |
71 | - if(!$books) { |
|
71 | + if (!$books) { |
|
72 | 72 | $this->books = null; |
73 | 73 | |
74 | 74 | return $this; |
75 | 75 | } |
76 | 76 | |
77 | - if(!$this->books) { |
|
77 | + if (!$this->books) { |
|
78 | 78 | $this->books = new Collection(); |
79 | 79 | } |
80 | 80 | |
81 | - foreach($books as $item) { |
|
81 | + foreach ($books as $item) { |
|
82 | 82 | $this->books->add($item); |
83 | 83 | } |
84 | 84 | |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | |
116 | 116 | protected static function attributesMetadata(): array |
117 | 117 | { |
118 | - return array ( |
|
118 | + return array( |
|
119 | 119 | 'username' => |
120 | - array ( |
|
120 | + array( |
|
121 | 121 | 'type' => |
122 | - array ( |
|
122 | + array( |
|
123 | 123 | 0 => 'string', |
124 | 124 | 1 => 'int', |
125 | 125 | 2 => 'null', |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | 'actionName' => 'username', |
129 | 129 | ), |
130 | 130 | 'books' => |
131 | - array ( |
|
131 | + array( |
|
132 | 132 | 'type' => |
133 | - array ( |
|
133 | + array( |
|
134 | 134 | 0 => 'iterable', |
135 | 135 | 1 => 'null', |
136 | 136 | ), |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | 'actionName' => 'books', |
139 | 139 | ), |
140 | 140 | 'first_name' => |
141 | - array ( |
|
141 | + array( |
|
142 | 142 | 'type' => |
143 | - array ( |
|
143 | + array( |
|
144 | 144 | 0 => 'string', |
145 | 145 | 1 => 'int', |
146 | 146 | ), |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | 'actionName' => 'firstName', |
149 | 149 | ), |
150 | 150 | 'updatedAt' => |
151 | - array ( |
|
151 | + array( |
|
152 | 152 | 'type' => |
153 | - array ( |
|
153 | + array( |
|
154 | 154 | 0 => 'DateTimeInterface', |
155 | 155 | 1 => 'null', |
156 | 156 | ), |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | 'actionName' => 'updatedAt', |
159 | 159 | ), |
160 | 160 | 'someclass' => |
161 | - array ( |
|
161 | + array( |
|
162 | 162 | 'type' => |
163 | - array ( |
|
163 | + array( |
|
164 | 164 | 0 => 'Micro\\Library\\DTO\\Object\\AbstractDto', |
165 | 165 | 1 => 'null', |
166 | 166 | ), |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | 'actionName' => 'someclass', |
169 | 169 | ), |
170 | 170 | 'testMixed' => |
171 | - array ( |
|
171 | + array( |
|
172 | 172 | 'type' => |
173 | - array ( |
|
173 | + array( |
|
174 | 174 | 0 => 'mixed', |
175 | 175 | ), |
176 | 176 | 'required' => false, |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | |
59 | 59 | protected static function attributesMetadata(): array |
60 | 60 | { |
61 | - return array ( |
|
61 | + return array( |
|
62 | 62 | 'weight' => |
63 | - array ( |
|
63 | + array( |
|
64 | 64 | 'type' => |
65 | - array ( |
|
65 | + array( |
|
66 | 66 | 0 => 'int', |
67 | 67 | 1 => 'null', |
68 | 68 | ), |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | 'actionName' => 'weight', |
71 | 71 | ), |
72 | 72 | 'height' => |
73 | - array ( |
|
73 | + array( |
|
74 | 74 | 'type' => |
75 | - array ( |
|
75 | + array( |
|
76 | 76 | 0 => 'int', |
77 | 77 | 1 => 'null', |
78 | 78 | ), |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | 'actionName' => 'height', |
81 | 81 | ), |
82 | 82 | 'parent' => |
83 | - array ( |
|
83 | + array( |
|
84 | 84 | 'type' => |
85 | - array ( |
|
85 | + array( |
|
86 | 86 | 0 => 'Transfer\\Simple\\SimpleObjectTransfer', |
87 | 87 | 1 => 'null', |
88 | 88 | ), |
@@ -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 | } |