Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.
There are several approaches to avoid long parameter lists:
1 | <?php |
||
35 | public function storePushLog( |
||
36 | String $provider, |
||
37 | String $key, |
||
38 | String $type, |
||
39 | bool $succeeded, |
||
40 | String $request = null, |
||
41 | String $response = null, |
||
42 | int $userId = null, |
||
43 | String $relationType = null, |
||
44 | int $relationId = null |
||
45 | ) |
||
46 | { |
||
47 | $this->client->post($this->buildPath($this->path), [ |
||
48 | 'body' => '{ |
||
49 | "provider": "' . $provider . '", |
||
50 | "key": "' . $key . '", |
||
51 | "type": "' . $type . '", |
||
52 | "succeeded": ' . $succeeded . ', |
||
53 | "request": { ' . $request . ', }, |
||
54 | "response": { ' . $response . ', }, |
||
55 | "user_id": ' . $userId . ' |
||
56 | "relation_type": "' . $relationType . '", |
||
57 | "relation_id": ' . $relationId . ' |
||
58 | }' |
||
62 | } |
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