@@ -15,7 +15,6 @@ |
||
15 | 15 | use Mockery as m; |
16 | 16 | use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; |
17 | 17 | use phpDocumentor\Reflection\Php\StrategyContainer; |
18 | -use phpDocumentor\Reflection\Types\Context; |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * Base test case for all strategies, to be sure that they check if the can handle objects before handeling them. |
@@ -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; |
@@ -13,19 +13,16 @@ |
||
13 | 13 | |
14 | 14 | namespace phpDocumentor\Reflection\Php\Factory; |
15 | 15 | |
16 | -use InvalidArgumentException; |
|
17 | 16 | use phpDocumentor\Reflection\Element; |
18 | 17 | use phpDocumentor\Reflection\Fqsen; |
19 | 18 | use phpDocumentor\Reflection\Php\Class_ as ClassElement; |
20 | 19 | use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; |
21 | 20 | use phpDocumentor\Reflection\Php\StrategyContainer; |
22 | 21 | use phpDocumentor\Reflection\Types\Context; |
23 | -use PhpParser\Node; |
|
24 | 22 | use PhpParser\Node\Stmt\Class_ as ClassNode; |
25 | 23 | use PhpParser\Node\Stmt\ClassConst; |
26 | 24 | use PhpParser\Node\Stmt\ClassMethod; |
27 | 25 | use PhpParser\Node\Stmt\Property as PropertyNode; |
28 | -use PhpParser\Comment\Doc; |
|
29 | 26 | use PhpParser\Node\Stmt\TraitUse; |
30 | 27 | |
31 | 28 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $classElement = new ClassElement( |
64 | 64 | $object->fqsen, |
65 | 65 | $docBlock, |
66 | - $object->extends ? new Fqsen('\\' . $object->extends) : null, |
|
66 | + $object->extends ? new Fqsen('\\'.$object->extends) : null, |
|
67 | 67 | $object->isAbstract(), |
68 | 68 | $object->isFinal() |
69 | 69 | ); |
@@ -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: |
@@ -12,13 +12,11 @@ |
||
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\Php\Factory; |
14 | 14 | |
15 | -use InvalidArgumentException; |
|
16 | 15 | use phpDocumentor\Reflection\Php\Method as MethodDescriptor; |
17 | 16 | use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; |
18 | 17 | use phpDocumentor\Reflection\Php\StrategyContainer; |
19 | 18 | use phpDocumentor\Reflection\Php\Visibility; |
20 | 19 | use phpDocumentor\Reflection\Types\Context; |
21 | -use PhpParser\Comment\Doc; |
|
22 | 20 | use PhpParser\Node\Stmt\ClassMethod; |
23 | 21 | |
24 | 22 | /** |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of phpDocumentor. |
|
4 | - * |
|
5 | - * For the full copyright and license information, please view the LICENSE |
|
6 | - * file that was distributed with this source code. |
|
7 | - * |
|
8 | - * @copyright 2010-2015 Mike van Riel<[email protected]> |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * This file is part of phpDocumentor. |
|
4 | + * |
|
5 | + * For the full copyright and license information, please view the LICENSE |
|
6 | + * file that was distributed with this source code. |
|
7 | + * |
|
8 | + * @copyright 2010-2015 Mike van Riel<[email protected]> |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\Php\Factory; |
14 | 14 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @param ClassConstantIterator $object object to convert to an Element |
63 | 63 | * @param StrategyContainer $strategies used to convert nested objects. |
64 | 64 | * @param Context $context of the created object |
65 | - * @return Constant |
|
65 | + * @return ConstantElement |
|
66 | 66 | */ |
67 | 67 | protected function doCreate($object, StrategyContainer $strategies, Context $context = null) |
68 | 68 | { |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use phpDocumentor\Reflection\Php\StrategyContainer; |
19 | 19 | use phpDocumentor\Reflection\PrettyPrinter; |
20 | 20 | use phpDocumentor\Reflection\Types\Context; |
21 | -use PhpParser\Comment\Doc; |
|
22 | 21 | |
23 | 22 | /** |
24 | 23 | * Strategy to convert ClassConstantIterator to ConstantElement |
@@ -12,14 +12,11 @@ |
||
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\Php\Factory; |
14 | 14 | |
15 | -use InvalidArgumentException; |
|
16 | -use phpDocumentor\Reflection\Fqsen; |
|
17 | 15 | use phpDocumentor\Reflection\Php\Factory; |
18 | 16 | use phpDocumentor\Reflection\Php\Function_ as FunctionDescriptor; |
19 | 17 | use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; |
20 | 18 | use phpDocumentor\Reflection\Php\StrategyContainer; |
21 | 19 | use phpDocumentor\Reflection\Types\Context; |
22 | -use PhpParser\Comment\Doc; |
|
23 | 20 | use PhpParser\Node\Stmt\Function_ as FunctionNode; |
24 | 21 | |
25 | 22 | /** |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of phpDocumentor. |
|
4 | - * |
|
5 | - * For the full copyright and license information, please view the LICENSE |
|
6 | - * file that was distributed with this source code. |
|
7 | - * |
|
8 | - * @copyright 2010-2015 Mike van Riel<[email protected]> |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * This file is part of phpDocumentor. |
|
4 | + * |
|
5 | + * For the full copyright and license information, please view the LICENSE |
|
6 | + * file that was distributed with this source code. |
|
7 | + * |
|
8 | + * @copyright 2010-2015 Mike van Riel<[email protected]> |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\Php\Factory; |
14 | 14 |
@@ -12,14 +12,11 @@ |
||
12 | 12 | |
13 | 13 | |
14 | 14 | namespace phpDocumentor\Reflection\Php\Factory; |
15 | -use InvalidArgumentException; |
|
16 | 15 | use phpDocumentor\Reflection\Element; |
17 | 16 | use phpDocumentor\Reflection\Fqsen; |
18 | 17 | use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; |
19 | 18 | use phpDocumentor\Reflection\Php\StrategyContainer; |
20 | 19 | use phpDocumentor\Reflection\Types\Context; |
21 | -use PhpParser\Comment\Doc; |
|
22 | -use PhpParser\Node; |
|
23 | 20 | use PhpParser\Node\Stmt\ClassConst; |
24 | 21 | use PhpParser\Node\Stmt\ClassMethod; |
25 | 22 | use PhpParser\Node\Stmt\Interface_ as InterfaceNode; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context); |
61 | 61 | $parents = array(); |
62 | 62 | foreach ($object->extends as $extend) { |
63 | - $parents['\\' . (string)$extend] = new Fqsen('\\' . (string)$extend); |
|
63 | + $parents['\\'.(string)$extend] = new Fqsen('\\'.(string)$extend); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $interface = new InterfaceElement($object->fqsen, $parents, $docBlock); |