protected function requireAncestor(Tag $tag)
	{
		$tagName   = $tag->getName();
		$tagConfig = $this->tagsConfig[$tagName];

		if (isset($tagConfig['rules']['requireAncestor']))
		{
			foreach ($tagConfig['rules']['requireAncestor'] as $ancestorName)
			{
				if (!empty($this->cntOpen[$ancestorName]))
				{
					return false;
				}
			}

			$this->logger->err('Tag requires an ancestor', [
				'requireAncestor' => implode(',', $tagConfig['rules']['requireAncestor']),
				'tag'             => $tag
			]);

			return true;
		}

		return false;
	}
protected function requireAncestor(Tag $tag)
	{
		$tagName   = $tag->getName();
		$tagConfig = $this->tagsConfig[$tagName];

		if (isset($tagConfig['rules']['requireAncestor']))
		{
			foreach ($tagConfig['rules']['requireAncestor'] as $ancestorName)
			{
				if (!empty($this->cntOpen[$ancestorName]))
				{
					return false;
				}
			}

			$this->logger->err('Tag requires an ancestor', [
				'requireAncestor' => implode(',', $tagConfig['rules']['requireAncestor']),
				'tag'             => $tag
			]);

			return true;
		}

		return false;
	}
protected function requireAncestor ( Tag $ tag ) { $ tagName = $ tag -> getName ( ) ; $ tagConfig = $ this -> tagsConfig [ $ tagName ] ; if ( isset ( $ tagConfig [ 'rules' ] [ 'requireAncestor' ] ) ) { foreach ( $ tagConfig [ 'rules' ] [ 'requireAncestor' ] as $ ancestorName ) { if ( ! empty ( $ this -> cntOpen [ $ ancestorName ] ) ) { return false ; } } $ this -> logger -> err ( 'Tag requires an ancestor' , [ 'requireAncestor' => implode ( ',' , $ tagConfig [ 'rules' ] [ 'requireAncestor' ] ) , 'tag' => $ tag ] ) ; return true ; } return false ; }
Apply requireAncestor rules associated with given tag

@param  Tag  $tag Tag
@return bool      Whether this tag has an unfulfilled requireAncestor requirement
Apply requireAncestor rules associated with given tag