protected function cloneCloseTagElementsIntoSwitch(DOMDocument $ir)
	{
		$query = '//switch[name(following-sibling::*[1]) = "closeTag"]';
		foreach ($this->query($query) as $switch)
		{
			$closeTag = $switch->nextSibling;
			foreach ($this->query('case', $switch) as $case)
			{
				if (!$case->lastChild || $case->lastChild->nodeName !== 'closeTag')
				{
					$case->appendChild($closeTag->cloneNode());
				}
			}
		}
	}
protected function cloneCloseTagElementsIntoSwitch(DOMDocument $ir)
	{
		$query = '//switch[name(following-sibling::*[1]) = "closeTag"]';
		foreach ($this->query($query) as $switch)
		{
			$closeTag = $switch->nextSibling;
			foreach ($this->query('case', $switch) as $case)
			{
				if (!$case->lastChild || $case->lastChild->nodeName !== 'closeTag')
				{
					$case->appendChild($closeTag->cloneNode());
				}
			}
		}
	}
protected function cloneCloseTagElementsIntoSwitch ( DOMDocument $ ir ) { $ query = '//switch[name(following-sibling::*[1]) = "closeTag"]' ; foreach ( $ this -> query ( $ query ) as $ switch ) { $ closeTag = $ switch -> nextSibling ; foreach ( $ this -> query ( 'case' , $ switch ) as $ case ) { if ( ! $ case -> lastChild || $ case -> lastChild -> nodeName !== 'closeTag' ) { $ case -> appendChild ( $ closeTag -> cloneNode ( ) ) ; } } } }
Clone closeTag elements that follow a switch into said switch

If there's a <closeTag/> right after a <switch/>, clone the <closeTag/> at the end of
the every <case/> that does not end with a <closeTag/>

@param  DOMDocument $ir
@return void
Clone closeTag elements that follow a switch into said switch