Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3.0067 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | public function handle($client, $index) |
||
36 | { |
||
37 | 1 | $config = $this->configurationRepository->get($client, $index); |
|
38 | |||
39 | 1 | if (null === $client || null === $config) { |
|
40 | throw new \InvalidArgumentException(); |
||
41 | } |
||
42 | |||
43 | 1 | $client |
|
44 | 1 | ->indices() |
|
45 | 1 | ->putSettings([ |
|
46 | 1 | 'index' => $index, |
|
47 | 'body' => [ |
||
48 | 1 | 'settings' => $this->extractSettings($config), |
|
49 | 1 | ], |
|
50 | 1 | ]) |
|
51 | ; |
||
52 | 1 | } |
|
53 | |||
63 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: