Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function make(string $className, Credentials $credentials, ?IParametersInterface $parameters = null): IEndpointInterface |
||
19 | { |
||
20 | if (!in_array(IEndpointInterface::class, class_implements($className))) { |
||
21 | throw new \Exception("That endpoint {$className} must be implement the interface " . IEndpointInterface::class . "!"); |
||
22 | } |
||
23 | |||
24 | return (new $className()) |
||
25 | ->setCredentials($credentials) |
||
26 | ->bindRequestParameters($parameters); |
||
27 | } |
||
29 |