PhpParser\Builder\Class_::addStmt PHP Метод

addStmt() публичный Метод

Adds a statement.
public addStmt ( PhpParser\Node\Stmt | PhpParser\Builder $stmt )
$stmt PhpParser\Node\Stmt | PhpParser\Builder The statement to add
    public function addStmt($stmt)
    {
        $stmt = $this->normalizeNode($stmt);
        $targets = array('Stmt_TraitUse' => &$this->uses, 'Stmt_ClassConst' => &$this->constants, 'Stmt_Property' => &$this->properties, 'Stmt_ClassMethod' => &$this->methods);
        $type = $stmt->getType();
        if (!isset($targets[$type])) {
            throw new \LogicException(sprintf('Unexpected node of type "%s"', $type));
        }
        $targets[$type][] = $stmt;
        return $this;
    }