Code Duplication    Length = 12-12 lines in 2 locations

view/SSTemplateParser.php 1 location

@@ 741-752 (lines=12) @@
738
	 * get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj)
739
	 * depending on the context the lookup is used in.
740
	 */
741
	function Lookup_AddLookupStep(&$res, $sub, $method) {
742
		$res['LookupSteps'][] = $sub;
743
744
		$property = $sub['Call']['Method']['text'];
745
746
		if (isset($sub['Call']['CallArguments']) && $arguments = $sub['Call']['CallArguments']['php']) {
747
			$res['php'] .= "->$method('$property', array($arguments), true)";
748
		}
749
		else {
750
			$res['php'] .= "->$method('$property', null, true)";
751
		}
752
	}
753
754
	function Lookup_LookupStep(&$res, $sub) {
755
		$this->Lookup_AddLookupStep($res, $sub, 'obj');

view/SSTemplateParser.php.inc 1 location

@@ 283-294 (lines=12) @@
280
	 * get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj)
281
	 * depending on the context the lookup is used in.
282
	 */
283
	function Lookup_AddLookupStep(&$res, $sub, $method) {
284
		$res['LookupSteps'][] = $sub;
285
286
		$property = $sub['Call']['Method']['text'];
287
288
		if (isset($sub['Call']['CallArguments']) && $arguments = $sub['Call']['CallArguments']['php']) {
289
			$res['php'] .= "->$method('$property', array($arguments), true)";
290
		}
291
		else {
292
			$res['php'] .= "->$method('$property', null, true)";
293
		}
294
	}
295
296
	function Lookup_LookupStep(&$res, $sub) {
297
		$this->Lookup_AddLookupStep($res, $sub, 'obj');