|
@@ 65-76 (lines=12) @@
|
| 62 |
|
* |
| 63 |
|
* @return mixed |
| 64 |
|
*/ |
| 65 |
|
public static function __callStatic($method, $parameters) |
| 66 |
|
{ |
| 67 |
|
if (! static::hasExtensions($method)) { |
| 68 |
|
throw new BadMethodCallException("Method {$method} does not exist."); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
if (static::$extensions[$method] instanceof Closure) { |
| 72 |
|
return call_user_func_array(Closure::bind(static::$extensions[$method], null, static::class), $parameters); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
return call_user_func_array(static::$extensions[$method], $parameters); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
/** |
| 79 |
|
* Dynamically handle calls to the class. |
|
@@ 88-99 (lines=12) @@
|
| 85 |
|
* |
| 86 |
|
* @return mixed |
| 87 |
|
*/ |
| 88 |
|
public function __call($method, $parameters) |
| 89 |
|
{ |
| 90 |
|
if (! static::hasExtensions($method)) { |
| 91 |
|
throw new BadMethodCallException("Method {$method} does not exist."); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
if (static::$extensions[$method] instanceof Closure) { |
| 95 |
|
return call_user_func_array(static::$extensions[$method]->bindTo($this, static::class), $parameters); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
return call_user_func_array(static::$extensions[$method], $parameters); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
/** |
| 102 |
|
* Static alias of normal constructor. |