PhpParser\Builder\Trait_::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);
        if ($stmt instanceof Stmt\Property) {
            $this->properties[] = $stmt;
        } else {
            if ($stmt instanceof Stmt\ClassMethod) {
                $this->methods[] = $stmt;
            } else {
                throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType()));
            }
        }
        return $this;
    }