Completed
Push — master ( 8dcc19...0acb93 )
by Aleh
10s
created
src/Padawan/Framework/Complete/Resolver/NodeTypeResolver.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -145,6 +145,7 @@
 block discarded – undo
145 145
     }
146 146
 
147 147
     /**
148
+     * @param \PhpParser\Node $node
148 149
      * @return Chain
149 150
      */
150 151
     protected function createChain($node)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
         $chain = $this->createChain($node);
93 93
         $block = $chain;
94 94
         while ($block instanceof Chain) {
95
-            $this->logger->debug('looking for type of ' . $block->getName());
95
+            $this->logger->debug('looking for type of '.$block->getName());
96 96
             $event = new TypeResolveEvent($block, $type);
97 97
             $this->dispatcher->dispatch(self::BLOCK_START, $event);
98 98
             if ($block->getType() === 'var') {
Please login to merge, or discard this patch.
src/Padawan/Parser/Walker/ScopeWalker.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -88,6 +88,10 @@
 block discarded – undo
88 88
         }
89 89
         return $line >= $startLine;
90 90
     }
91
+
92
+    /**
93
+     * @param Node $node
94
+     */
91 95
     public function getNodeLines($node)
92 96
     {
93 97
         $startLine = $endLine = -1;
Please login to merge, or discard this patch.
src/Padawan/Framework/Application/Socket.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
             return;
30 30
         }
31 31
         $arrayForInput = ['command' => $request->command];
32
-        foreach($request->params as $key=>$value) {
33
-            $arrayForInput[$key] =  $value;
32
+        foreach ($request->params as $key=>$value) {
33
+            $arrayForInput[$key] = $value;
34 34
         }
35 35
         $input = new ArrayInput($arrayForInput);
36 36
         $command = $this->find($request->command);
Please login to merge, or discard this patch.
src/Padawan/Parser/UseParser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 class UseParser {
11 11
     /** @var Uses */
12 12
     private $uses;
13
-    public function parse(Use_ $node){
14
-        foreach($node->uses AS $use){
13
+    public function parse(Use_ $node) {
14
+        foreach ($node->uses AS $use) {
15 15
             $fqcn = $this->parseFQCN($use->name->toString());
16 16
             $this->uses->add($fqcn, $use->alias);
17 17
         }
@@ -21,44 +21,44 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @param string $type
23 23
      */
24
-    public function parseType($type){
24
+    public function parseType($type) {
25 25
         $pureFQCN = $this->parseFQCN($type);
26
-        if($pureFQCN->isScalar()){
26
+        if ($pureFQCN->isScalar()) {
27 27
             return $pureFQCN;
28 28
         }
29
-        if(strpos($type, '\\') === 0){
29
+        if (strpos($type, '\\') === 0) {
30 30
             return $pureFQCN;
31 31
         }
32 32
         $fqcn = $this->uses->find($type);
33
-        if(!empty($fqcn)){
33
+        if (!empty($fqcn)) {
34 34
             return $fqcn;
35 35
         }
36 36
         return $this->createFQCN($pureFQCN);
37 37
     }
38
-    public function getFQCN(Name $node = null){
39
-        if($node === null) {
38
+    public function getFQCN(Name $node = null) {
39
+        if ($node === null) {
40 40
             return $node;
41 41
         }
42
-        if($node->isFullyQualified()){
42
+        if ($node->isFullyQualified()) {
43 43
             return $this->parseFQCN($node->toString());
44 44
         }
45 45
         $fqcn = $this->uses->find($node->getFirst());
46
-        if($fqcn){
46
+        if ($fqcn) {
47 47
             return $fqcn;
48 48
         }
49 49
         return $this->createFQCN($node->toString());
50 50
     }
51
-    public function parseFQCN($fqcn){
51
+    public function parseFQCN($fqcn) {
52 52
         $fqcn = trim($fqcn, '\\');
53
-        if(empty($fqcn)){
53
+        if (empty($fqcn)) {
54 54
             return new FQCN('');
55 55
         }
56 56
         $parts = explode('\\', $fqcn);
57 57
         $name = array_pop($parts);
58 58
         $regex = '/(\w+)(\\[\\])?/';
59 59
         preg_match($regex, $name, $matches);
60
-        if(count($matches) === 0){
61
-            throw new \Exception("Could not parse FQCN for empty class name: " . $fqcn);
60
+        if (count($matches) === 0) {
61
+            throw new \Exception("Could not parse FQCN for empty class name: ".$fqcn);
62 62
         }
63 63
         $name = $matches[1];
64 64
         $isArray = count($matches) === 3 && $matches[2] = '[]';
Please login to merge, or discard this patch.
src/Padawan/Plugin/Loader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
                 explode("-", $part)
30 30
             ));
31 31
         }, $parts));
32
-        $className .= "\\" . $this->pluginClassName;
32
+        $className .= "\\".$this->pluginClassName;
33 33
         try {
34 34
             /** @var \Padawan\Plugin\PluginInterface */
35 35
             $plugin = $this->container->get($className);
Please login to merge, or discard this patch.
src/Padawan/Framework/Generator/IndexGenerator.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $end = microtime(1) - $start;
67 67
 
68 68
             $this->getLogger()->debug("Indexing: [$end]s");
69
-            $this->getLogger()->debug("Memory: " . memory_get_usage());
69
+            $this->getLogger()->debug("Memory: ".memory_get_usage());
70 70
             $globalTime += $end;
71 71
             ++$done;
72 72
             $process = floor($done / $all * 100);
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
         $this->getLogger()->debug(sprintf("Processing %s interfaces", count($scope->getInterfaces())));
120 120
         $this->getLogger()->debug(sprintf("Processing %s functions", count($scope->getFunctions())));
121 121
         foreach ($scope->getClasses() as $classData) {
122
-            $this->getLogger()->debug('Processing node ' . $classData->fqcn->toString());
122
+            $this->getLogger()->debug('Processing node '.$classData->fqcn->toString());
123 123
             $index->addFQCN($classData->fqcn);
124 124
             $index->addClass($classData);
125 125
         }
126 126
         foreach ($scope->getInterfaces() as $interfaceData) {
127
-            $this->getLogger()->debug('Processing node ' . $interfaceData->fqcn->toString());
127
+            $this->getLogger()->debug('Processing node '.$interfaceData->fqcn->toString());
128 128
             $index->addFQCN($interfaceData->fqcn);
129 129
             $index->addInterface($interfaceData);
130 130
         }
131 131
         foreach ($scope->getFunctions() as $functionData) {
132
-            $this->getLogger()->debug('Processing node ' . $functionData->name);
132
+            $this->getLogger()->debug('Processing node '.$functionData->name);
133 133
             $index->addFunction($functionData);
134 134
         }
135 135
     }
Please login to merge, or discard this patch.
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -102,6 +102,10 @@  discard block
 block discarded – undo
102 102
             );
103 103
         }
104 104
     }
105
+
106
+    /**
107
+     * @param string $content
108
+     */
105 109
     public function createScopeForFile(File $file, $content, Index $index, $rewrite = true)
106 110
     {
107 111
         $startParser = microtime(1);
@@ -114,6 +118,10 @@  discard block
 block discarded – undo
114 118
         $this->getLogger()->info("Parsing: [$end]s");
115 119
         return $scope;
116 120
     }
121
+
122
+    /**
123
+     * @param string $hash
124
+     */
117 125
     public function processFileScope(File $file, Index $index, FileScope $scope = null, $hash = null)
118 126
     {
119 127
         if (empty($scope)) {
Please login to merge, or discard this patch.
src/Padawan/Framework/Complete/Resolver/ContextResolver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
         if (strpos($badLine, '<?php') === false
124 124
             || strpos($badLine, '<?') === false
125 125
         ) {
126
-            $badLine = '<?php ' . $badLine;
126
+            $badLine = '<?php '.$badLine;
127 127
         }
128 128
         $badLine = str_replace(['elseif', 'else', 'catch'], '', $badLine);
129 129
         if ($wrapFunctionCall && $badLine[strlen($badLine) - 1] === '(') {
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -28,6 +28,10 @@  discard block
 block discarded – undo
28 28
         $this->logger = $logger;
29 29
         $this->useParser = $useParser;
30 30
     }
31
+
32
+    /**
33
+     * @param string $badLine
34
+     */
31 35
     public function getContext($badLine, Index $index, Scope $scope = null)
32 36
     {
33 37
         if (empty($scope)) {
@@ -118,6 +122,9 @@  discard block
 block discarded – undo
118 122
         return $token;
119 123
     }
120 124
 
125
+    /**
126
+     * @return string
127
+     */
121 128
     protected function prepareLine($badLine, $wrapFunctionCall = true)
122 129
     {
123 130
         if (strpos($badLine, '<?php') === false
Please login to merge, or discard this patch.
src/Padawan/Domain/Completer/StaticCompleter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             return [];
28 28
         }
29 29
         $index = $project->getIndex();
30
-        $this->logger->debug('Creating completion for ' . $fqcn->toString());
30
+        $this->logger->debug('Creating completion for '.$fqcn->toString());
31 31
         $class = $index->findClassByFQCN($fqcn);
32 32
         if (empty($class)) {
33 33
             $class = $index->findInterfaceByFQCN($fqcn);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $type = $prop->type instanceof FQCN ? $prop->type->toString() : 'mixed';
81 81
         return new Entry(
82
-            '$' . $prop->name,
82
+            '$'.$prop->name,
83 83
             $type
84 84
         );
85 85
     }
Please login to merge, or discard this patch.
src/Padawan/Domain/Completer/ObjectCompleter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
             return [];
28 28
         }
29 29
         $index = $project->getIndex();
30
-        $this->logger->debug('Creating completion for ' . $fqcn->toString());
30
+        $this->logger->debug('Creating completion for '.$fqcn->toString());
31 31
         $class = $index->findClassByFQCN($fqcn);
32 32
         if (empty($class)) {
33 33
             $class = $index->findInterfaceByFQCN($fqcn);
Please login to merge, or discard this patch.