Code Duplication    Length = 27-27 lines in 2 locations

application/tests/_ci_phpunit_test/patcher/Patcher/FunctionPatcher/Proxy.php 1 location

@@ 114-140 (lines=27) @@
111
		}
112
	}
113
114
	protected static function checkCalledMethod($function)
115
	{
116
		$trace = debug_backtrace();
117
		$info = Backtrace::getInfo('FunctionPatcher', $trace);
118
		
119
		$class = strtolower($info['class']);
120
		$class_method = strtolower($info['class_method']);
121
122
		// Patches the functions only in the class
123
		if (strpos(self::$patches_to_apply[$function], '::') === false)
124
		{
125
			if (self::$patches_to_apply[$function] !== $class)
126
			{
127
				return false;
128
			}
129
			return true;
130
		}
131
		//Patches the functions only in the class method
132
		else
133
		{
134
			if (self::$patches_to_apply[$function] !== $class_method)
135
			{
136
				return false;
137
			}
138
			return true;
139
		}
140
	}
141
142
	public static function __callStatic($function, array $arguments)
143
	{

application/tests/_ci_phpunit_test/patcher/Patcher/ConstantPatcher/Proxy.php 1 location

@@ 71-97 (lines=27) @@
68
		}
69
	}
70
71
	protected static function checkCalledMethod($constant)
72
	{
73
		$trace = debug_backtrace();
74
		$info = Backtrace::getInfo('ConstantPatcher', $trace);
75
		
76
		$class = strtolower($info['class']);
77
		$class_method = strtolower($info['class_method']);
78
79
		// Patches the constants only in the class
80
		if (strpos(self::$patches_to_apply[$constant], '::') === false)
81
		{
82
			if (self::$patches_to_apply[$constant] !== $class)
83
			{
84
				return false;
85
			}
86
			return true;
87
		}
88
		//Patches the constants only in the class method
89
		else
90
		{
91
			if (self::$patches_to_apply[$constant] !== $class_method)
92
			{
93
				return false;
94
			}
95
			return true;
96
		}
97
	}
98
99
	/**
100
	 * Get patched constant value