getProperty() public method

public getProperty ( string $name, boolean $inherit = false ) : PhpParser\Node\Stmt\PropertyProperty
$name string
$inherit boolean
return PhpParser\Node\Stmt\PropertyProperty
コード例 #1
0
ファイル: ClassDefinition.php プロジェクト: ovr/phpsa
 /**
  * @param string $name
  * @param bool $inherit
  * @return Node\Stmt\PropertyProperty
  */
 public function getProperty($name, $inherit = false)
 {
     assert($this->hasProperty($name, $inherit));
     if (isset($this->properties[$name])) {
         return $this->properties[$name];
     }
     if ($inherit && $this->extendsClassDefinition) {
         return $this->extendsClassDefinition->getProperty($name, true);
     }
     return null;
 }