Conditions | 6 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 0 |
1 | <?php |
||
53 | public function getRequest(Array $headers = [], $body = '') |
||
54 | { |
||
55 | if ($this->id === null) { |
||
56 | throw new RuntimeException('You must provide the Droplet ID you want to perform an action on'); |
||
57 | } |
||
58 | |||
59 | if (method_exists($this, 'getBody') && $body === '') { |
||
60 | $body = $this->getBody(); |
||
61 | } |
||
62 | |||
63 | if ($body === '' || json_decode($body, true) === []) { |
||
64 | throw new RuntimeException('Body cannot be empty'); |
||
65 | } |
||
66 | |||
67 | $endpoint = str_replace('[:id:]', $this->id, self::ENDPOINT); |
||
68 | |||
69 | return new Request( |
||
70 | static::METHOD, |
||
71 | $endpoint, |
||
72 | $headers, |
||
73 | $body |
||
74 | ); |
||
77 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths