protected static function buildPHP(array $branches)
	{
		$return = ['', ''];
		foreach ($branches as $branch)
		{
			$return[0] .= $branch['statement'] . '{' . $branch['head'];
			$return[1] .= $branch['statement'] . '{';

			if ($branch['branches'])
			{
				list($head, $tail) = self::buildPHP($branch['branches']);

				$return[0] .= $head;
				$return[1] .= $tail;
			}

			$return[0] .= '}';
			$return[1] .= $branch['tail'] . '}';
		}

		return $return;
	}
protected static function buildPHP(array $branches)
	{
		$return = ['', ''];
		foreach ($branches as $branch)
		{
			$return[0] .= $branch['statement'] . '{' . $branch['head'];
			$return[1] .= $branch['statement'] . '{';

			if ($branch['branches'])
			{
				list($head, $tail) = self::buildPHP($branch['branches']);

				$return[0] .= $head;
				$return[1] .= $tail;
			}

			$return[0] .= '}';
			$return[1] .= $branch['tail'] . '}';
		}

		return $return;
	}
protected static function buildPHP ( array $ branches ) { $ return = [ '' , '' ] ; foreach ( $ branches as $ branch ) { $ return [ 0 ] .= $ branch [ 'statement' ] . '{' . $ branch [ 'head' ] ; $ return [ 1 ] .= $ branch [ 'statement' ] . '{' ; if ( $ branch [ 'branches' ] ) { list ( $ head , $ tail ) = self :: buildPHP ( $ branch [ 'branches' ] ) ; $ return [ 0 ] .= $ head ; $ return [ 1 ] .= $ tail ; } $ return [ 0 ] .= '}' ; $ return [ 1 ] .= $ branch [ 'tail' ] . '}' ; } return $ return ; }
Build the source for the two sides of a templates based on the structure extracted from its
original source

@param  array    $branches
@return string[]
Build the source for the two sides of a templates based on the structure extracted from its original source