Completed
Pull Request — develop (#144)
by Jaap
08:03
created
tests/example.file.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,6 @@
 block discarded – undo
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
          */
Please login to merge, or discard this patch.
example.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Factory/File.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -155,6 +155,7 @@
 block discarded – undo
155 155
 
156 156
     /**
157 157
      * @param Node[] $nodes
158
+     * @param StrategyContainer $strategies
158 159
      */
159 160
     protected function createFileDocBlock(
160 161
         ?Doc $docBlock = null,
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 use phpDocumentor\Reflection\Php\Factory\File\CreateCommand;
21 21
 use phpDocumentor\Reflection\Php\File as FileElement;
22 22
 use phpDocumentor\Reflection\Php\NodesFactory;
23
-use phpDocumentor\Reflection\Php\ProjectFactoryStrategy;
24 23
 use phpDocumentor\Reflection\Php\StrategyContainer;
25 24
 use phpDocumentor\Reflection\Types\Context;
26 25
 use phpDocumentor\Reflection\Types\NamespaceNodeToContext;
Please login to merge, or discard this patch.
tests/component/ProjectNamespaceTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 
15 15
 use Mockery as m;
16 16
 use phpDocumentor\Reflection\File\LocalFile;
17
-use phpDocumentor\Reflection\Php\Factory\File;
18 17
 use phpDocumentor\Reflection\Php\ProjectFactory;
19 18
 use PHPUnit\Framework\TestCase;
20 19
 
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Factory/Class_.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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:
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Factory/Trait_.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Factory/Method.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Namespace_.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function addClass(Fqsen $class): void
69 69
     {
70
-        $this->classes[(string) $class] = $class;
70
+        $this->classes[(string)$class] = $class;
71 71
     }
72 72
 
73 73
     /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function addConstant(Fqsen $contant): void
87 87
     {
88
-        $this->constants[(string) $contant] = $contant;
88
+        $this->constants[(string)$contant] = $contant;
89 89
     }
90 90
 
91 91
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function addFunction(Fqsen $function): void
105 105
     {
106
-        $this->functions[(string) $function] = $function;
106
+        $this->functions[(string)$function] = $function;
107 107
     }
108 108
 
109 109
     /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function addInterface(Fqsen $interface): void
123 123
     {
124
-        $this->interfaces[(string) $interface] = $interface;
124
+        $this->interfaces[(string)$interface] = $interface;
125 125
     }
126 126
 
127 127
     /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function addTrait(Fqsen $trait): void
141 141
     {
142
-        $this->traits[(string) $trait] = $trait;
142
+        $this->traits[(string)$trait] = $trait;
143 143
     }
144 144
 
145 145
     /**
Please login to merge, or discard this patch.
src/phpDocumentor/Reflection/Php/Factory/Function_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.