1 | <?php |
||
14 | class Container extends Set implements SlimContainerConsumibleInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var ServiceManager |
||
18 | */ |
||
19 | protected $sm; |
||
20 | |||
21 | public function __construct(ServiceManager $sm = null) |
||
26 | 14 | ||
27 | 14 | protected function initServiceManager(ServiceManager $sm = null) |
|
32 | |||
33 | /** |
||
34 | 6 | * Set data key to value |
|
35 | * @param string $key The data key |
||
36 | 6 | * @param mixed $value The data value |
|
37 | 1 | */ |
|
38 | 1 | public function set($key, $value) |
|
46 | |||
47 | /** |
||
48 | * Get data value with key |
||
49 | 3 | * @param string $key The data key |
|
50 | * @param mixed $default The value to return if data key does not exist |
||
51 | 3 | * @return mixed The data value, or the default value |
|
52 | */ |
||
53 | public function get($key, $default = null) |
||
57 | |||
58 | 1 | /** |
|
59 | * Fetch set data |
||
60 | 1 | * @return array This set's key-value data array |
|
61 | */ |
||
62 | public function all() |
||
66 | |||
67 | 4 | /** |
|
68 | * Fetch set data keys |
||
69 | 4 | * @return array This set's key-value data array keys |
|
70 | */ |
||
71 | public function keys() |
||
75 | |||
76 | /** |
||
77 | 7 | * Does this set contain a key? |
|
78 | * @param string $key The data key |
||
79 | 7 | * @return boolean |
|
80 | */ |
||
81 | public function has($key) |
||
85 | |||
86 | 1 | /** |
|
87 | * Remove value with key from this set |
||
88 | 1 | * @param string $key The data key |
|
89 | 1 | */ |
|
90 | public function remove($key) |
||
94 | 1 | ||
95 | /** |
||
96 | 1 | * Clear all values |
|
97 | 1 | */ |
|
98 | 1 | public function clear() |
|
102 | |||
103 | /** |
||
104 | * Countable |
||
105 | 1 | */ |
|
106 | public function count() |
||
110 | |||
111 | /** |
||
112 | * IteratorAggregate |
||
113 | 1 | */ |
|
114 | public function getIterator() |
||
118 | |||
119 | /** |
||
120 | * Ensure a value or object will remain globally unique |
||
121 | * @param string $key The value or object name |
||
122 | * @param $value |
||
123 | * @return mixed |
||
124 | 2 | */ |
|
125 | public function singleton($key, $value) |
||
133 | |||
134 | /** |
||
135 | * Makes this to consume the services defined in provided container |
||
136 | * |
||
137 | 14 | * @param Set $container |
|
138 | * @return mixed |
||
139 | 14 | */ |
|
140 | 14 | public function consumeSlimContainer(Set $container) |
|
157 | 1 | ||
158 | /** |
||
159 | 1 | * Registers a factory wrapping a Slim factory into a ZF2 factory |
|
160 | 1 | * |
|
161 | * @param $key |
||
162 | 1 | * @param callable $callable |
|
163 | * @param bool $shared |
||
164 | 1 | */ |
|
165 | 1 | protected function registerFactory($key, callable $callable, $shared = true) |
|
170 | } |
||
171 |
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: