Sha256: adf90065db47f09caed9b9c845d6829a76cb5dc91a3b1498b7339e5f6b2728a8

Contents?: true

Size: 1.38 KB

Versions: 10

Compression:

Stored size: 1.38 KB

Contents

<?php

namespace MtHaml\Node;

use MtHaml\NodeVisitor\NodeVisitorInterface;

class TagAttribute extends NodeAbstract
{
    protected $name;
    protected $value;

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

    public function setName(NodeAbstract $name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setValue(NodeAbstract $value)
    {
        $this->value = $value;
    }

    public function getValue()
    {
        return $this->value;
    }

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

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

            if (false !== $visitor->enterTagAttributeName($this)) {
                $this->getName()->accept($visitor);
            }
            $visitor->leaveTagAttributeName($this);

            if ($this->getValue()) {
                if (false !== $visitor->enterTagAttributeValue($this)) {
                    $this->getValue()->accept($visitor);
                }
                $visitor->leaveTagAttributeValue($this);
            }
        }
        $visitor->leaveTagAttribute($this);
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

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