Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
15 | public function determineUserAgent(array $options): string |
||
16 | { |
||
17 | if (!isset($options[Options::PACKAGE])) { |
||
18 | throw new InvalidArgumentException('Missing package option'); |
||
19 | } |
||
20 | |||
21 | $package = $options[Options::PACKAGE]; |
||
22 | |||
23 | $chunks = []; |
||
24 | $chunks[] = $package; |
||
25 | $chunks[] = explode('@', Versions::getVersion($package))[0]; |
||
26 | $chunks[] = $this->getWebsite($package); |
||
27 | |||
28 | return sprintf( |
||
29 | self::USER_AGENT, |
||
30 | ...$chunks |
||
31 | ); |
||
32 | } |
||
33 | |||
50 |
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: