1 | <?php |
||
13 | class PackageManager |
||
14 | { |
||
15 | /** |
||
16 | * default driver name. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $driverName; |
||
21 | |||
22 | /** |
||
23 | * configurations of the default driver. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $driverParameters; |
||
28 | |||
29 | /** |
||
30 | * Http client. |
||
31 | * |
||
32 | * @var object |
||
33 | */ |
||
34 | private $httpClient; |
||
35 | |||
36 | /** |
||
37 | * @param \Vinelab\UrlShortener\Base\ConfigManager $config |
||
38 | * @param null $httpClient The http Client 'will be injected here (mocked) for testing' |
||
39 | */ |
||
40 | public function __construct(ConfigManager $config, $httpClient = null) |
||
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getDriverName() |
||
54 | |||
55 | /** |
||
56 | * @return array |
||
57 | */ |
||
58 | public function getDriverParameters() |
||
62 | |||
63 | /** |
||
64 | * @return object |
||
65 | */ |
||
66 | public function getHttpClient() |
||
70 | |||
71 | /** |
||
72 | * @param string $driverName |
||
73 | */ |
||
74 | private function setDriverName($driverName) |
||
78 | |||
79 | /** |
||
80 | * @param array $driverParameters |
||
81 | */ |
||
82 | private function setDriverParameters($driverParameters) |
||
86 | |||
87 | /** |
||
88 | * @param object $httpClient |
||
89 | */ |
||
90 | private function setHttpClient($httpClient) |
||
94 | } |
||
95 |
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: