1 | <?php |
||
17 | class AliasCollection implements \IteratorAggregate |
||
18 | { |
||
19 | /** |
||
20 | * @var JsonFile |
||
21 | */ |
||
22 | protected $configFile; |
||
23 | |||
24 | /** |
||
25 | * @var JsonConfigSource |
||
26 | */ |
||
27 | protected $configSource; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $aliases; |
||
33 | |||
34 | /** |
||
35 | * @param JsonFile $configFile |
||
36 | * |
||
37 | * @throws \Exception |
||
38 | */ |
||
39 | public function __construct(JsonFile $configFile) |
||
49 | |||
50 | /** |
||
51 | * Gets all aliases. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public function all() |
||
61 | |||
62 | /** |
||
63 | * Add an alias. |
||
64 | * |
||
65 | * @param string $alias |
||
66 | * @param string $raw |
||
67 | * |
||
68 | * @return static |
||
69 | */ |
||
70 | public function add($alias, $raw) |
||
78 | |||
79 | /** |
||
80 | * Removes an alias. |
||
81 | * |
||
82 | * @param string $alias |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function remove($alias) |
||
94 | |||
95 | /** |
||
96 | * Gets the alias. |
||
97 | * |
||
98 | * @param string $alias |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function get($alias) |
||
108 | |||
109 | /** |
||
110 | * Checks whether the alias exists. |
||
111 | * |
||
112 | * @param string $alias |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | public function has($alias) |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function getIterator() |
||
128 | |||
129 | protected function readFromFile() |
||
142 | } |
||
143 |
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: