| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.0054 |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | 2 | protected function doFetchOne(string $path, string $orderBy = null, string $order = self::ORDER_BY_ASC, callable $mappingFunction) |
|
| 54 | { |
||
| 55 | 2 | $response = $this->requestHandler->get($path, [ |
|
| 56 | 2 | 'order_by' => $orderBy, |
|
| 57 | 2 | 'order' => $order, |
|
| 58 | 2 | 'limit' => 1 |
|
| 59 | ]); |
||
| 60 | /** @var Collection $items */ |
||
| 61 | 2 | $items = $mappingFunction($response); |
|
| 62 | 2 | if (count($items)) { |
|
| 63 | 2 | return $items->first(); |
|
| 64 | } |
||
| 65 | return null; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |