SensioLabs\DeprecationDetector\FileInfo\PhpFileInfo::addSuperTypeUsage PHP Method

addSuperTypeUsage() public method

public addSuperTypeUsage ( SensioLabs\DeprecationDetector\FileInfo\Usage\SuperTypeUsage $superTypeUsage )
$superTypeUsage SensioLabs\DeprecationDetector\FileInfo\Usage\SuperTypeUsage
    public function addSuperTypeUsage(SuperTypeUsage $superTypeUsage)
    {
        $this->superTypeUsages[$superTypeUsage->className()] = $superTypeUsage;
    }

Usage Example

コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function enterNode(Node $node)
 {
     if ($node instanceof Node\Stmt\Class_ && $node->extends instanceof Node\Name) {
         $superTypeUsage = new SuperTypeUsage($node->extends->toString(), $node->namespacedName->toString(), $node->getLine());
         $this->phpFileInfo->addSuperTypeUsage($superTypeUsage);
     }
 }