@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use phpDocumentor\Reflection\Fqsen; |
| 17 | 17 | use PhpParser\Node; |
| 18 | 18 | use PhpParser\Node\Const_; |
| 19 | -use PhpParser\Node\Name; |
|
| 20 | 19 | use PhpParser\Node\Stmt\Class_; |
| 21 | 20 | use PhpParser\Node\Stmt\ClassConst; |
| 22 | 21 | use PhpParser\Node\Stmt\ClassMethod; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | switch (get_class($node)) { |
| 77 | 77 | case Namespace_::class: |
| 78 | - $this->resetState('\\' . $node->name . '\\'); |
|
| 78 | + $this->resetState('\\'.$node->name.'\\'); |
|
| 79 | 79 | $node->fqsen = new Fqsen($this->buildName()); |
| 80 | 80 | break; |
| 81 | 81 | case Class_::class: |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | $node->fqsen = new Fqsen($this->buildName()); |
| 86 | 86 | break; |
| 87 | 87 | case Function_::class: |
| 88 | - $this->parts->push($node->name . '()'); |
|
| 88 | + $this->parts->push($node->name.'()'); |
|
| 89 | 89 | $node->fqsen = new Fqsen($this->buildName()); |
| 90 | 90 | break; |
| 91 | 91 | case ClassMethod::class: |
| 92 | - $this->parts->push('::' . $node->name . '()'); |
|
| 92 | + $this->parts->push('::'.$node->name.'()'); |
|
| 93 | 93 | $node->fqsen = new Fqsen($this->buildName()); |
| 94 | 94 | break; |
| 95 | 95 | case ClassConst::class: |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $node->fqsen = new Fqsen($this->buildName()); |
| 101 | 101 | break; |
| 102 | 102 | case PropertyProperty::class: |
| 103 | - $this->parts->push('::$' . $node->name); |
|
| 103 | + $this->parts->push('::$'.$node->name); |
|
| 104 | 104 | $node->fqsen = new Fqsen($this->buildName()); |
| 105 | 105 | break; |
| 106 | 106 | } |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | /** |
| 98 | 98 | * Returns the superclass this class is extending if available. |
| 99 | 99 | * |
| 100 | - * @return NUll|Fqsen |
|
| 100 | + * @return Class_ |
|
| 101 | 101 | */ |
| 102 | 102 | public function getParent() |
| 103 | 103 | { |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | * Gets Namespace from the project if it exists, otherwise returns a new namepace |
| 104 | 104 | * |
| 105 | 105 | * @param Project $project |
| 106 | - * @param $name |
|
| 106 | + * @param string $name |
|
| 107 | 107 | * @return Namespace_ |
| 108 | 108 | */ |
| 109 | 109 | private function getNamespaceByName(Project $project, $name) |
@@ -128,31 +128,31 @@ |
||
| 128 | 128 | private function buildNamespace(File $file, Namespace_ $namespace) |
| 129 | 129 | { |
| 130 | 130 | foreach ($file->getClasses() as $class) { |
| 131 | - if ($namespace->getFqsen() . '\\' . $class->getName() == $class->getFqsen()) { |
|
| 131 | + if ($namespace->getFqsen().'\\'.$class->getName() == $class->getFqsen()) { |
|
| 132 | 132 | $namespace->addClass($class->getFqsen()); |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | foreach ($file->getInterfaces() as $interface) { |
| 137 | - if ($namespace->getFqsen() . '\\' . $interface->getName() == $interface->getFqsen()) { |
|
| 137 | + if ($namespace->getFqsen().'\\'.$interface->getName() == $interface->getFqsen()) { |
|
| 138 | 138 | $namespace->addInterface($interface->getFqsen()); |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | foreach ($file->getFunctions() as $function) { |
| 143 | - if ($namespace->getFqsen() . '\\' . $function->getName() . '()' == $function->getFqsen()) { |
|
| 143 | + if ($namespace->getFqsen().'\\'.$function->getName().'()' == $function->getFqsen()) { |
|
| 144 | 144 | $namespace->addFunction($function->getFqsen()); |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | foreach ($file->getConstants() as $constant) { |
| 149 | - if ($namespace->getFqsen() . '::' . $constant->getName() == $constant->getFqsen()) { |
|
| 149 | + if ($namespace->getFqsen().'::'.$constant->getName() == $constant->getFqsen()) { |
|
| 150 | 150 | $namespace->addConstant($constant->getFqsen()); |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | foreach ($file->getTraits() as $trait) { |
| 155 | - if ($namespace->getFqsen() . '\\' . $trait->getName() == $trait->getFqsen()) { |
|
| 155 | + if ($namespace->getFqsen().'\\'.$trait->getName() == $trait->getFqsen()) { |
|
| 156 | 156 | $namespace->addTrait($trait->getFqsen()); |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -99,7 +99,6 @@ |
||
| 99 | 99 | /** |
| 100 | 100 | * Calculates the price for this specific component. |
| 101 | 101 | * |
| 102 | - * @param float[] $...additionalPrices Additional costs may be passed |
|
| 103 | 102 | * |
| 104 | 103 | * @return float |
| 105 | 104 | */ |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use Mockery as m; |
| 17 | 17 | use phpDocumentor\Reflection\Fqsen; |
| 18 | 18 | use phpDocumentor\Reflection\Php\StrategyContainer; |
| 19 | -use phpDocumentor\Reflection\Types\Context; |
|
| 20 | 19 | use PhpParser\Comment\Doc; |
| 21 | 20 | use PhpParser\Node\Const_; |
| 22 | 21 | use PhpParser\Node\Expr\Variable; |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | use Mockery as m; |
| 19 | 19 | use phpDocumentor\Reflection\Php\StrategyContainer; |
| 20 | 20 | use phpDocumentor\Reflection\PrettyPrinter; |
| 21 | -use phpDocumentor\Reflection\Types\Context; |
|
| 22 | 21 | use PhpParser\Comment\Doc; |
| 23 | 22 | use PhpParser\Node\Scalar\String_; |
| 24 | 23 | use PhpParser\Node\Stmt\Class_ as ClassNode; |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use Mockery as m; |
| 17 | 17 | use phpDocumentor\Reflection\Fqsen; |
| 18 | 18 | use phpDocumentor\Reflection\Php\StrategyContainer; |
| 19 | -use phpDocumentor\Reflection\Types\Context; |
|
| 20 | 19 | use PhpParser\Comment\Doc; |
| 21 | 20 | use PhpParser\Node\Name; |
| 22 | 21 | use PhpParser\Node\Stmt\ClassMethod; |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Create a project map (similar to a sitemap) of project. |
|
| 4 | - * |
|
| 5 | - * The Reflection component is capable of analyzing one or more files into a hierarchy of objects representing the |
|
| 6 | - * structure of your project. It does this by analyzing the source code of each individual file using the |
|
| 7 | - * `analyze()` method in the Analyzer class. |
|
| 8 | - * |
|
| 9 | - * Because the Analyzer class requires a whole series of objects that interact together a factory method `create()` |
|
| 10 | - * is available. This method instantiates all objects and provides a reasonable default to start using the Analyzer. |
|
| 11 | - * |
|
| 12 | - * There is also a Service Provider (`\phpDocumentor\Descriptor\ServiceProvider`) that can be used with either Silex |
|
| 13 | - * or Cilex instead of using the factory method; this will make it easier to plug in your own features if you want to. |
|
| 14 | - */ |
|
| 3 | + * Create a project map (similar to a sitemap) of project. |
|
| 4 | + * |
|
| 5 | + * The Reflection component is capable of analyzing one or more files into a hierarchy of objects representing the |
|
| 6 | + * structure of your project. It does this by analyzing the source code of each individual file using the |
|
| 7 | + * `analyze()` method in the Analyzer class. |
|
| 8 | + * |
|
| 9 | + * Because the Analyzer class requires a whole series of objects that interact together a factory method `create()` |
|
| 10 | + * is available. This method instantiates all objects and provides a reasonable default to start using the Analyzer. |
|
| 11 | + * |
|
| 12 | + * There is also a Service Provider (`\phpDocumentor\Descriptor\ServiceProvider`) that can be used with either Silex |
|
| 13 | + * or Cilex instead of using the factory method; this will make it easier to plug in your own features if you want to. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | // use Composer's autoloader to allow the application to automatically load all classes on request. |
| 17 | 17 | use phpDocumentor\Reflection\Php\Project; |
@@ -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 | } |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | namespace phpDocumentor\Reflection\Php; |
| 15 | 15 | |
| 16 | 16 | use phpDocumentor\Reflection\NodeVisitor\ElementNameResolver; |
| 17 | -use PhpParser\Lexer; |
|
| 18 | 17 | use PhpParser\NodeTraverser; |
| 19 | 18 | use PhpParser\NodeVisitor\NameResolver; |
| 20 | 19 | use PhpParser\Parser; |