@@ -22,16 +22,16 @@ |
||
22 | 22 | $projectFactory = \phpDocumentor\Reflection\Php\ProjectFactory::createInstance(); |
23 | 23 | |
24 | 24 | // Create an array of files to analize. |
25 | -$files = [ new \phpDocumentor\Reflection\File\LocalFile('tests/example.file.php') ]; |
|
25 | +$files = [new \phpDocumentor\Reflection\File\LocalFile('tests/example.file.php')]; |
|
26 | 26 | |
27 | 27 | //create a new project 'MyProject' containing all elements in the files. |
28 | 28 | /** @var Project $project */ |
29 | 29 | $project = $projectFactory->create('MyProject', $files); |
30 | 30 | |
31 | 31 | // As an example of what you can do, let's list all class names in the file 'tests/example.file.php'. |
32 | -echo 'List all classes in the example source file: ' . PHP_EOL; |
|
32 | +echo 'List all classes in the example source file: '.PHP_EOL; |
|
33 | 33 | |
34 | 34 | /** @var \phpDocumentor\Reflection\Php\Class_ $class */ |
35 | 35 | foreach ($project->getFiles()['tests/example.file.php']->getClasses() as $class) { |
36 | - echo '- ' . $class->getFqsen() . PHP_EOL; |
|
36 | + echo '- '.$class->getFqsen().PHP_EOL; |
|
37 | 37 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | { |
57 | 57 | $this->nodesFactory = $nodesFactory; |
58 | 58 | |
59 | - $lastCallable = function ($command) { |
|
59 | + $lastCallable = function($command) { |
|
60 | 60 | return $this->createFile($command); |
61 | 61 | }; |
62 | 62 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | ); |
35 | 35 | } |
36 | 36 | |
37 | - $lastCallable = function ($command) use ($middleware, $lastCallable) { |
|
37 | + $lastCallable = function($command) use ($middleware, $lastCallable) { |
|
38 | 38 | return $middleware->execute($command, $lastCallable); |
39 | 39 | }; |
40 | 40 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $classElement = new ClassElement( |
63 | 63 | $object->fqsen, |
64 | 64 | $docBlock, |
65 | - $object->extends ? new Fqsen('\\' . $object->extends) : null, |
|
65 | + $object->extends ? new Fqsen('\\'.$object->extends) : null, |
|
66 | 66 | $object->isAbstract(), |
67 | 67 | $object->isFinal(), |
68 | 68 | new Location($object->getLine()) |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (isset($object->implements)) { |
72 | 72 | foreach ($object->implements as $interfaceClassName) { |
73 | 73 | $classElement->addInterface( |
74 | - new Fqsen('\\' . $interfaceClassName->toString()) |
|
74 | + new Fqsen('\\'.$interfaceClassName->toString()) |
|
75 | 75 | ); |
76 | 76 | } |
77 | 77 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | switch (get_class($stmt)) { |
82 | 82 | case TraitUse::class: |
83 | 83 | foreach ($stmt->traits as $use) { |
84 | - $classElement->addUsedTrait(new Fqsen('\\' . $use->toString())); |
|
84 | + $classElement->addUsedTrait(new Fqsen('\\'.$use->toString())); |
|
85 | 85 | } |
86 | 86 | break; |
87 | 87 | case PropertyNode::class: |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context); |
59 | 59 | $parents = []; |
60 | 60 | foreach ($object->extends as $extend) { |
61 | - $parents['\\' . (string) $extend] = new Fqsen('\\' . (string) $extend); |
|
61 | + $parents['\\'.(string)$extend] = new Fqsen('\\'.(string)$extend); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $interface = new InterfaceElement($object->fqsen, $parents, $docBlock, new Location($object->getLine())); |
@@ -72,7 +72,7 @@ |
||
72 | 72 | break; |
73 | 73 | case TraitUse::class: |
74 | 74 | foreach ($stmt->traits as $use) { |
75 | - $trait->addUsedTrait(new Fqsen('\\' . $use->toString())); |
|
75 | + $trait->addUsedTrait(new Fqsen('\\'.$use->toString())); |
|
76 | 76 | } |
77 | 77 | break; |
78 | 78 | } |
@@ -56,9 +56,9 @@ |
||
56 | 56 | if ($object->getReturnType() !== null) { |
57 | 57 | $typeResolver = new TypeResolver(); |
58 | 58 | if ($object->getReturnType() instanceof NullableType) { |
59 | - $typeString = '?' . $object->getReturnType()->type; |
|
59 | + $typeString = '?'.$object->getReturnType()->type; |
|
60 | 60 | } else { |
61 | - $typeString = (string) $object->getReturnType(); |
|
61 | + $typeString = (string)$object->getReturnType(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $returnType = $typeResolver->resolve($typeString, $context); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function addInterface(Fqsen $interface): void |
134 | 134 | { |
135 | - $this->implements[(string) $interface] = $interface; |
|
135 | + $this->implements[(string)$interface] = $interface; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function addConstant(Constant $constant): void |
152 | 152 | { |
153 | - $this->constants[(string) $constant->getFqsen()] = $constant; |
|
153 | + $this->constants[(string)$constant->getFqsen()] = $constant; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function addMethod(Method $method): void |
170 | 170 | { |
171 | - $this->methods[(string) $method->getFqsen()] = $method; |
|
171 | + $this->methods[(string)$method->getFqsen()] = $method; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function addProperty(Property $property): void |
188 | 188 | { |
189 | - $this->properties[(string) $property->getFqsen()] = $property; |
|
189 | + $this->properties[(string)$property->getFqsen()] = $property; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function addUsedTrait(Fqsen $fqsen): void |
206 | 206 | { |
207 | - $this->usedTraits[(string) $fqsen] = $fqsen; |
|
207 | + $this->usedTraits[(string)$fqsen] = $fqsen; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function addNamespace(Fqsen $fqsen): void |
108 | 108 | { |
109 | - $this->namespaces[(string) $fqsen] = $fqsen; |
|
109 | + $this->namespaces[(string)$fqsen] = $fqsen; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function addConstant(Constant $constant): void |
141 | 141 | { |
142 | - $this->constants[(string) $constant->getFqsen()] = $constant; |
|
142 | + $this->constants[(string)$constant->getFqsen()] = $constant; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function addFunction(Function_ $function): void |
159 | 159 | { |
160 | - $this->functions[(string) $function->getFqsen()] = $function; |
|
160 | + $this->functions[(string)$function->getFqsen()] = $function; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function addClass(Class_ $class): void |
177 | 177 | { |
178 | - $this->classes[(string) $class->getFqsen()] = $class; |
|
178 | + $this->classes[(string)$class->getFqsen()] = $class; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function addInterface(Interface_ $interface): void |
195 | 195 | { |
196 | - $this->interfaces[(string) $interface->getFqsen()] = $interface; |
|
196 | + $this->interfaces[(string)$interface->getFqsen()] = $interface; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function addTrait(Trait_ $trait): void |
213 | 213 | { |
214 | - $this->traits[(string) $trait->getFqsen()] = $trait; |
|
214 | + $this->traits[(string)$trait->getFqsen()] = $trait; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |