Sha256: d1ba88aef94164f79cfd259092418cb2b7e252a835301c8184d708d06b4609a8
Contents?: true
Size: 514 Bytes
Versions: 10
Compression:
Stored size: 514 Bytes
Contents
<?php namespace MtHaml\NodeVisitor; use MtHaml\Node\Tag; class Autoclose extends NodeVisitorAbstract { protected $autocloseTags; public function __construct(array $autocloseTags) { $this->autocloseTags = $autocloseTags; } public function enterTag(Tag $tag) { if ($tag->hasChilds() || $tag->hasContent()) { return; } if (in_array($tag->getTagName(), $this->autocloseTags)) { $tag->setFlag(Tag::FLAG_SELF_CLOSE); } } }
Version data entries
10 entries across 10 versions & 1 rubygems