Completed
Push — master ( f32f45...e7b229 )
by Arne
45:20 queued 19:37
created
src/collector/backend/parser/UnitCollectingVisitor.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -234,6 +234,9 @@  discard block
 block discarded – undo
234 234
 
235 235
         }
236 236
 
237
+        /**
238
+         * @param string $traitName
239
+         */
237 240
         private function getTraitUse($traitName) {
238 241
             if (!$this->unit->usesTrait($traitName)) {
239 242
                 throw new ParseErrorException(
@@ -336,7 +339,7 @@  discard block
 block discarded – undo
336 339
 
337 340
         /**
338 341
          * @param MethodObject $method
339
-         * @param array                                $params
342
+         * @param \PhpParser\Node\Param[]                                $params
340 343
          */
341 344
         private function processMethodParams(MethodObject $method, array $params) {
342 345
             foreach($params as $param) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             if ($node->getType() != 'Stmt_Trait' && $node->extends !== NULL) {
179 179
                 if (is_array($node->extends)) {
180 180
                     $extendsArray = $node->extends;
181
-                    foreach ($extendsArray as $extends) {
181
+                    foreach($extendsArray as $extends) {
182 182
                         $this->unit->addExtends(implode('\\', $extends->parts));
183 183
                     }
184 184
                 } else {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         private function processTraitUse(NodeType\TraitUse $node) {
197 197
             foreach($node->traits as $trait) {
198
-                $traitUse = $this->unit->addTrait( (string)$trait );
198
+                $traitUse = $this->unit->addTrait((string)$trait);
199 199
                 $traitUse->setStartLine($node->getAttribute('startLine'));
200 200
                 $traitUse->setEndLine($node->getAttribute('endLine'));
201 201
             }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                     if ($adaptation->trait instanceof FullyQualified) {
206 206
                         $traitUse = $this->getTraitUse((string)$adaptation->trait);
207 207
                     } else if (count($node->traits) === 1) {
208
-                        $traitUse = $this->getTraitUse( (string)$node->traits[0]);
208
+                        $traitUse = $this->getTraitUse((string)$node->traits[0]);
209 209
                     } else {
210 210
                         $traitUse = $this->unit->getAmbiguousTraitUse();
211 211
                     }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                 return;
286 286
             }
287 287
 
288
-            if (in_array($returnType, ['void','float','int','string','bool','callable','array'])) {
288
+            if (in_array($returnType, ['void', 'float', 'int', 'string', 'bool', 'callable', 'array'])) {
289 289
                 $returnTypeObject = $method->setReturnType($returnType);
290 290
                 $returnTypeObject->setNullable(false);
291 291
                 return;
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
             throw new ParseErrorException(
319 319
                 sprintf("Unexpected return type definition %s",
320 320
                     get_class($returnType)
321
-                ),ParseErrorException::UnexpectedExpr);
321
+                ), ParseErrorException::UnexpectedExpr);
322 322
         }
323 323
 
324 324
         private function processInlineComments(MethodObject $method, array $stmts) {
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
             }
409 409
 
410 410
             if ($type instanceof \PhpParser\Node\Name\FullyQualified) {
411
-                $variable->setType( (string)$type);
411
+                $variable->setType((string)$type);
412 412
                 return;
413 413
             }
414 414
 
415 415
             $type = (string)$type;
416 416
             if (isset($this->aliasMap[$type])) {
417 417
                 $type = $this->aliasMap[$type];
418
-            } elseif ($type[0]!=='\\') {
419
-                $type = $this->namespace . '\\' . $type;
418
+            } elseif ($type[0] !== '\\') {
419
+                $type = $this->namespace.'\\'.$type;
420 420
             }
421 421
             $variable->setType($type);
422 422
         }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
                 return array(
457 457
                     'type' => '{unknown}',
458 458
                     'value' => '',
459
-                    'constant' => implode('\\', $expr->class->parts) . '::' . $expr->name
459
+                    'constant' => implode('\\', $expr->class->parts).'::'.$expr->name
460 460
                 );
461 461
             }
462 462
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 
502 502
                 return array(
503 503
                     'type' => 'expression',
504
-                    'value' => substr($code,0,-1)
504
+                    'value' => substr($code, 0, -1)
505 505
                 );
506 506
 
507 507
             }
Please login to merge, or discard this patch.
src/collector/project/AbstractUnitObject.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             if (!$file) {
155 155
                 return '';
156 156
             }
157
-            return new FileInfo($file->getAttribute('path') . '/' . $file->getAttribute('file'));
157
+            return new FileInfo($file->getAttribute('path').'/'.$file->getAttribute('file'));
158 158
         }
159 159
 
160 160
         /**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
          * @throws UnitObjectException
225 225
          */
226 226
         public function getExtends() {
227
-            if(!$this->hasExtends()) {
227
+            if (!$this->hasExtends()) {
228 228
                 throw new UnitObjectException('This unit does not extend any unit', UnitObjectException::NoExtends);
229 229
             }
230 230
             $result = array();
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             $node = $this->rootNode->queryOne('phpdox:ambiguous[@type="trait-alias"]');
341 341
             if (!$node) {
342 342
                 $node = $this->rootNode->appendElementNS(self::XMLNS, 'ambiguous');
343
-                $node->setAttribute('type','trait-alias');
343
+                $node->setAttribute('type', 'trait-alias');
344 344
             }
345 345
             return new TraitUseObject($node);
346 346
         }
@@ -452,34 +452,34 @@  discard block
 block discarded – undo
452 452
                 $parent->parentNode->removeChild($parent);
453 453
             }
454 454
 
455
-            $parent = $this->rootNode->appendElementNS( self::XMLNS, $container);
455
+            $parent = $this->rootNode->appendElementNS(self::XMLNS, $container);
456 456
             $parent->setAttribute('full', $unit->getName());
457 457
             $parent->setAttribute('namespace', $unit->getNamespace());
458 458
             $parent->setAttribute('name', $unit->getLocalName());
459 459
 
460 460
             if ($unit->hasExtends()) {
461 461
                 foreach($unit->getExtends() as $name) {
462
-                    $extends = $parent->appendElementNS( self::XMLNS, 'extends');
462
+                    $extends = $parent->appendElementNS(self::XMLNS, 'extends');
463 463
                     $this->setName($name, $extends);
464 464
                 }
465 465
             }
466 466
 
467 467
             if ($unit->hasImplements()) {
468 468
                 foreach($unit->getImplements() as $name) {
469
-                    $implements = $parent->appendElementNS( self::XMLNS, 'implements');
469
+                    $implements = $parent->appendElementNS(self::XMLNS, 'implements');
470 470
                     $this->setName($name, $implements);
471 471
                 }
472 472
             }
473 473
 
474 474
             if ($unit->usesTraits()) {
475 475
                 foreach($unit->getUsedTraits() as $name) {
476
-                    $uses = $parent->appendElementNS( self::XMLNS, 'uses');
476
+                    $uses = $parent->appendElementNS(self::XMLNS, 'uses');
477 477
                     $this->setName($name, $uses);
478 478
                 }
479 479
             }
480 480
 
481 481
             foreach($unit->getConstants() as $constant) {
482
-                $parent->appendChild( $this->dom->importNode($constant->export(), TRUE) );
482
+                $parent->appendChild($this->dom->importNode($constant->export(), TRUE));
483 483
             }
484 484
 
485 485
             foreach($unit->getExportedMembers() as $member) {
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             foreach($unit->getExportedMethods() as $method) {
492 492
                 $methodNode = $this->dom->importNode($method->export(), TRUE);
493 493
                 $this->adjustStaticResolution($methodNode);
494
-                $parent->appendChild( $methodNode );
494
+                $parent->appendChild($methodNode);
495 495
                 if ($this->hasMethod($method->getName())) {
496 496
                     $unitMethod = $this->getMethod($method->getName());
497 497
                     if ($unitMethod->hasInheritDoc()) {
@@ -513,25 +513,25 @@  discard block
 block discarded – undo
513 513
                 $container->parentNode->removeChild($container);
514 514
             }
515 515
 
516
-            $container = $this->rootNode->appendElementNS( self::XMLNS, 'trait');
516
+            $container = $this->rootNode->appendElementNS(self::XMLNS, 'trait');
517 517
             $this->setName($trait->getName(), $container);
518 518
 
519 519
             if ($trait->hasExtends()) {
520 520
                 foreach($trait->getExtends() as $name) {
521
-                    $extends = $container->appendElementNS( self::XMLNS, 'extends');
521
+                    $extends = $container->appendElementNS(self::XMLNS, 'extends');
522 522
                     $this->setName($name, $extends);
523 523
                 }
524 524
             }
525 525
 
526 526
             if ($trait->usesTraits()) {
527 527
                 foreach($trait->getUsedTraits() as $name) {
528
-                    $used = $container->appendElementNS( self::XMLNS, 'uses');
528
+                    $used = $container->appendElementNS(self::XMLNS, 'uses');
529 529
                     $this->setName($name, $used);
530 530
                 }
531 531
             }
532 532
 
533 533
             foreach($trait->getConstants() as $constant) {
534
-                $container->appendChild( $this->dom->importNode($constant->export(), TRUE) );
534
+                $container->appendChild($this->dom->importNode($constant->export(), TRUE));
535 535
             }
536 536
 
537 537
             foreach($trait->getExportedMembers() as $member) {
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
             if (!$type) {
610 610
                 return;
611 611
             }
612
-            foreach(array('full','namespace','name') as $attribute) {
612
+            foreach(array('full', 'namespace', 'name') as $attribute) {
613 613
                 $type->setAttribute($attribute, $this->rootNode->getAttribute($attribute));
614 614
             }
615 615
         }
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
          * @return fDOMElement
622 622
          */
623 623
         protected function addToContainer($containerName, $elementName) {
624
-            $container = $this->rootNode->queryOne('phpdox:' . $containerName);
624
+            $container = $this->rootNode->queryOne('phpdox:'.$containerName);
625 625
             if (!$container) {
626 626
                 $container = $this->rootNode->appendElementNS(self::XMLNS, $containerName);
627 627
             }
Please login to merge, or discard this patch.