Code Duplication    Length = 12-12 lines in 2 locations

view/SSTemplateParser.php 1 location

@@ 753-764 (lines=12) @@
750
	 * get the next ViewableData in the sequence, and LastLookupStep calls different methods (XML_val, hasValue, obj)
751
	 * depending on the context the lookup is used in.
752
	 */
753
	function Lookup_AddLookupStep(&$res, $sub, $method) {
754
		$res['LookupSteps'][] = $sub;
755
		
756
		$property = $sub['Call']['Method']['text'];
757
		
758
		if (isset($sub['Call']['CallArguments']) && $arguments = $sub['Call']['CallArguments']['php']) {
759
			$res['php'] .= "->$method('$property', array($arguments), true)";
760
		}
761
		else {
762
			$res['php'] .= "->$method('$property', null, true)";
763
		}
764
	}
765
766
	function Lookup_LookupStep(&$res, $sub) {
767
		$this->Lookup_AddLookupStep($res, $sub, 'obj');

view/SSTemplateParser.php.inc 1 location

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