Sha256: 3fe72f8a027d5cec9c0d587231341850af1e4e6efb448216d95acdaf654e11b9

Contents?: true

Size: 974 Bytes

Versions: 10

Compression:

Stored size: 974 Bytes

Contents

<?php

namespace MtHaml\Node;

use MtHaml\NodeVisitor\NodeVisitorInterface;

class Statement extends NodeAbstract
{
    protected $content;

    public function __construct(array $position, NodeAbstract $content)
    {
        parent::__construct($position);
        $this->content = $content;
    }

    public function getContent()
    {
        return $this->content;
    }

    public function hasContent()
    {
        return null !== $this->content;
    }

    public function getNodeName()
    {
        return 'statement';
    }

    public function accept(NodeVisitorInterface $visitor)
    {
        if (false !== $visitor->enterStatement($this)) {

            if (false !== $visitor->enterStatementContent($this)) {
                if ($this->hasContent()) {
                    $this->getContent()->accept($visitor);
                }
            }
            $visitor->leaveStatementContent($this);
        }
        $visitor->leaveStatement($this);
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.3.1 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.3.0 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.5 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.4 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.3 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.2 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.1 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.2.0 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php
guard-mthaml-0.1.0 vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php