| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public static function make(string $data, string $curlResponse = null, string $dto = null, int $mode = EnumOutputMode::DEFAULT_MODE): ICurlResponseDtoInterface |
||
| 21 | { |
||
| 22 | if (!in_array(IResponseHandlerInterface::class, class_implements($curlResponse))) { |
||
| 23 | throw new \Exception("{$dto} must be implements the interface " . IResponseHandlerInterface::class . "!"); |
||
| 24 | } |
||
| 25 | |||
| 26 | if (!in_array(IResponseDataInterface::class, class_implements($dto))) { |
||
| 27 | throw new \Exception("{$dto} must be implements the interface " . IResponseDataInterface::class . "!"); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var IResponseHandlerInterface $curlResponse |
||
| 32 | */ |
||
| 33 | $curlResponse = new $curlResponse(); |
||
| 34 | |||
| 35 | return $curlResponse->bindEntity($dto)->handle($data, $mode); |
||
|
|
|||
| 36 | } |
||
| 37 | } |