| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 3 | protected function getActivationStrategy($options) |
|
| 38 | { |
||
| 39 | 3 | $activationStrategy = $options['activationStrategy'] ?? null; |
|
| 40 | |||
| 41 | 3 | if (!$activationStrategy) { |
|
| 42 | 1 | return null; |
|
| 43 | } |
||
| 44 | |||
| 45 | 2 | if ($this->getContainer()->has($activationStrategy)) { |
|
| 46 | 1 | return $this->getContainer()->get($activationStrategy); |
|
| 47 | } |
||
| 48 | |||
| 49 | 1 | return $activationStrategy; |
|
| 50 | } |
||
| 51 | } |
||
| 52 |
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: