Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
34 | protected function getWebsite(string $package) |
||
35 | { |
||
36 | $package = package($package); |
||
37 | $homepage = $package->getConfig('homepage'); |
||
|
|||
38 | |||
39 | if ($homepage === null) { |
||
40 | return ''; |
||
41 | } |
||
42 | |||
43 | if (filter_var($homepage, FILTER_VALIDATE_URL) === false) { |
||
44 | return ''; |
||
45 | } |
||
46 | |||
47 | return ' (' . $homepage . ') '; |
||
48 | } |
||
49 | } |
||
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: