| @@ 48-61 (lines=14) @@ | ||
| 45 | return isset(static::$macros[$name]); |
|
| 46 | } |
|
| 47 | ||
| 48 | public static function __callStatic($method, $parameters) |
|
| 49 | { |
|
| 50 | if (! static::hasMacro($method)) { |
|
| 51 | throw new BadMethodCallException("Method {$method} does not exist."); |
|
| 52 | } |
|
| 53 | ||
| 54 | $macro = static::$macros[$method]; |
|
| 55 | ||
| 56 | if ($macro instanceof Closure) { |
|
| 57 | return call_user_func_array(Closure::bind($macro, null, static::class), $parameters); |
|
| 58 | } |
|
| 59 | ||
| 60 | return call_user_func_array($macro, $parameters); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function __call($method, $parameters) |
|
| 64 | { |
|
| @@ 63-76 (lines=14) @@ | ||
| 60 | return call_user_func_array($macro, $parameters); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function __call($method, $parameters) |
|
| 64 | { |
|
| 65 | if (! static::hasMacro($method)) { |
|
| 66 | throw new BadMethodCallException("Method {$method} does not exist."); |
|
| 67 | } |
|
| 68 | ||
| 69 | $macro = static::$macros[$method]; |
|
| 70 | ||
| 71 | if ($macro instanceof Closure) { |
|
| 72 | return call_user_func_array($macro->bindTo($this, static::class), $parameters); |
|
| 73 | } |
|
| 74 | ||
| 75 | return call_user_func_array($macro, $parameters); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||