Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function make(string $className, ?array $data = null): IResponseDataInterface |
||
17 | { |
||
18 | if (!in_array(IResponseDataInterface::class, class_implements($className))) { |
||
19 | throw new \Exception("That DTO {$className} must be implements the interface " . IResponseHandlerInterface::class . "!"); |
||
20 | } |
||
21 | |||
22 | return new $className($data); |
||
23 | } |
||
24 | } |