1 | <?php |
||
16 | class ServicesManager { |
||
17 | |||
18 | /** |
||
19 | * @var CallbackInstantiator |
||
20 | */ |
||
21 | private $callbackInstantiator; |
||
22 | |||
23 | /** |
||
24 | * @since 1.2 |
||
25 | * |
||
26 | * @param CallbackInstantiator $callbackInstantiator |
||
27 | */ |
||
28 | 7 | public function __construct( CallbackInstantiator $callbackInstantiator ) { |
|
31 | |||
32 | /** |
||
33 | * @since 1.2 |
||
34 | * |
||
35 | * @return ServicesManager |
||
36 | */ |
||
37 | 7 | public static function newManager() { |
|
40 | |||
41 | /** |
||
42 | * @since 1.2 |
||
43 | * |
||
44 | * @param string $serviceName |
||
45 | * @param mixed $service |
||
46 | * @param string|null $type |
||
47 | */ |
||
48 | 5 | public function add( $serviceName, $service, $type = null ) { |
|
62 | |||
63 | /** |
||
64 | * @since 1.2 |
||
65 | * |
||
66 | * @param string $serviceName |
||
67 | * |
||
68 | * @return boolean |
||
69 | */ |
||
70 | 5 | public function has( $serviceName ) { |
|
73 | |||
74 | /** |
||
75 | * @since 1.2 |
||
76 | * |
||
77 | * @param string $serviceName |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 5 | public function getBy( $serviceName ) { |
|
89 | |||
90 | /** |
||
91 | * @since 1.2 |
||
92 | * |
||
93 | * @param string $serviceName |
||
94 | */ |
||
95 | 1 | public function removeBy( $serviceName ) { |
|
98 | |||
99 | /** |
||
100 | * @since 1.2 |
||
101 | * |
||
102 | * @param string $serviceName |
||
103 | * @param mixed $service |
||
104 | */ |
||
105 | 2 | public function overrideWith( $serviceName, $service ) { |
|
108 | |||
109 | } |
||
110 |
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: