Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
66.67% |
2 / 3 |
CRAP | |
87.50% |
7 / 8 |
RouteConfig | |
0.00% |
0 / 1 |
|
66.67% |
2 / 3 |
4.03 | |
87.50% |
7 / 8 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
__callStatic | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
|||
__call | |
0.00% |
0 / 1 |
2.15 | |
66.67% |
2 / 3 |
1 | <?php |
2 | |
3 | |
4 | namespace Qmp\Laravel\ApiGateway\Services\Route; |
5 | |
6 | |
7 | class RouteConfig |
8 | { |
9 | protected $instance; |
10 | |
11 | protected function __construct() |
12 | { |
13 | $this->instance = new class { |
14 | use RouteTrait; |
15 | }; |
16 | } |
17 | |
18 | public static function __callStatic($method, $arguments) |
19 | { |
20 | $self = self::class; |
21 | $instance = new $self(); |
22 | return $instance->$method(...$arguments); |
23 | } |
24 | |
25 | public function __call($method, $arguments) |
26 | { |
27 | if (method_exists($this->instance, $method)) { |
28 | return $this->instance->$method(...$arguments); |
29 | } |
30 | |
31 | throw new \ErrorException("Method '$method' does not exist"); |
32 | } |
33 | } |