Conditions | 5 |
Paths | 5 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function __call($methodName, array $args) |
||
10 | { |
||
11 | if (ends_with($methodName, 'OrAbort')) { |
||
|
|||
12 | $realMethodName = substr($methodName, 0, -7); |
||
13 | |||
14 | $abortCode = null; |
||
15 | |||
16 | $originalMethodParameterCount = (new ReflectionMethod($this, $realMethodName))->getNumberOfParameters(); |
||
17 | |||
18 | if (($originalMethodParameterCount + 1) == count($args)) { |
||
19 | $abortCode = array_pop($args); |
||
20 | } |
||
21 | |||
22 | $originalMethodResult = call_user_func_array([$this, $realMethodName], $args); |
||
23 | |||
24 | if ($originalMethodResult == false) { |
||
25 | return abort($abortCode ?: 404); |
||
26 | } |
||
27 | |||
28 | return $originalMethodResult; |
||
29 | } |
||
30 | |||
31 | |||
32 | trigger_error('Call to undefined method '.__CLASS__.'::'.$methodName.'()', E_USER_ERROR); |
||
33 | } |
||
34 | } |
||
35 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.