Code Duplication    Length = 13-13 lines in 4 locations

view/SSTemplateParser.php 2 locations

@@ 3713-3725 (lines=13) @@
3710
		}
3711
	}
3712
3713
	function ClosedBlock__finalise(&$res) {
3714
		$blockname = $res['BlockName']['text'];
3715
3716
		$method = 'ClosedBlock_Handle_'.$blockname;
3717
		if (method_exists($this, $method)) {
3718
			$res['php'] = $this->$method($res);
3719
		} else if (isset($this->closedBlocks[$blockname])) {
3720
			$res['php'] = call_user_func($this->closedBlocks[$blockname], $res);
3721
		} else {
3722
			throw new SSTemplateParseException('Unknown closed block "'.$blockname.'" encountered. Perhaps you are ' .
3723
			'not supposed to close this block, or have mis-spelled it?', $this);
3724
		}
3725
	}
3726
3727
	/**
3728
	 * This is an example of a block handler function. This one handles the loop tag.
@@ 3863-3875 (lines=13) @@
3860
		}
3861
	}
3862
3863
	function OpenBlock__finalise(&$res) {
3864
		$blockname = $res['BlockName']['text'];
3865
3866
		$method = 'OpenBlock_Handle_'.$blockname;
3867
		if (method_exists($this, $method)) {
3868
			$res['php'] = $this->$method($res);
3869
		} elseif (isset($this->openBlocks[$blockname])) {
3870
			$res['php'] = call_user_func($this->openBlocks[$blockname], $res);
3871
		} else {
3872
			throw new SSTemplateParseException('Unknown open block "'.$blockname.'" encountered. Perhaps you missed ' .
3873
			' the closing tag or have mis-spelled it?', $this);
3874
		}
3875
	}
3876
3877
	/**
3878
	 * This is an open block handler, for the <% debug %> utility tag

view/SSTemplateParser.php.inc 2 locations

@@ 893-905 (lines=13) @@
890
		}
891
	}
892
893
	function ClosedBlock__finalise(&$res) {
894
		$blockname = $res['BlockName']['text'];
895
896
		$method = 'ClosedBlock_Handle_'.$blockname;
897
		if (method_exists($this, $method)) {
898
			$res['php'] = $this->$method($res);
899
		} else if (isset($this->closedBlocks[$blockname])) {
900
			$res['php'] = call_user_func($this->closedBlocks[$blockname], $res);
901
		} else {
902
			throw new SSTemplateParseException('Unknown closed block "'.$blockname.'" encountered. Perhaps you are ' .
903
			'not supposed to close this block, or have mis-spelled it?', $this);
904
		}
905
	}
906
907
	/**
908
	 * This is an example of a block handler function. This one handles the loop tag.
@@ 986-998 (lines=13) @@
983
		}
984
	}
985
986
	function OpenBlock__finalise(&$res) {
987
		$blockname = $res['BlockName']['text'];
988
989
		$method = 'OpenBlock_Handle_'.$blockname;
990
		if (method_exists($this, $method)) {
991
			$res['php'] = $this->$method($res);
992
		} elseif (isset($this->openBlocks[$blockname])) {
993
			$res['php'] = call_user_func($this->openBlocks[$blockname], $res);
994
		} else {
995
			throw new SSTemplateParseException('Unknown open block "'.$blockname.'" encountered. Perhaps you missed ' .
996
			' the closing tag or have mis-spelled it?', $this);
997
		}
998
	}
999
1000
	/**
1001
	 * This is an open block handler, for the <% debug %> utility tag