1 | <?php |
||
8 | class ComponentList |
||
9 | { |
||
10 | /** |
||
11 | * The list of component argument arrays |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | private $components = array(); |
||
16 | |||
17 | /** |
||
18 | * Set the components |
||
19 | * |
||
20 | * @param array $components |
||
21 | */ |
||
22 | public function __construct( array $components = array() ) |
||
26 | |||
27 | /** |
||
28 | * Get a component by name. Only applicable to value components. |
||
29 | * |
||
30 | * @param string $name |
||
31 | * @return AbstractComponent |
||
32 | */ |
||
33 | public function get_by_name( $name ) |
||
44 | |||
45 | /** |
||
46 | * Get components by type |
||
47 | * |
||
48 | * @param string $type |
||
49 | * @return AbstractComponent[] |
||
50 | */ |
||
51 | public function get_by_type( $type ) |
||
57 | |||
58 | /** |
||
59 | * Get all components. |
||
60 | * |
||
61 | * @return AbstractComponent[] |
||
62 | */ |
||
63 | public function get_all() |
||
67 | |||
68 | /** |
||
69 | * Get all the components that implement the ValueComponentInterface |
||
70 | * |
||
71 | * @return AbstractComponent[] |
||
72 | */ |
||
73 | public function get_value_components() |
||
79 | |||
80 | /** |
||
81 | * Get all the components that implement the FilterableComponentInterface |
||
82 | * |
||
83 | * @return AbstractComponent[] |
||
84 | */ |
||
85 | public function get_filterable_components() |
||
91 | |||
92 | /** |
||
93 | * Get all the components that implement the ValidatableComponentInterface |
||
94 | * |
||
95 | * @return AbstractComponent[] |
||
96 | */ |
||
97 | public function get_validatable_components() |
||
103 | |||
104 | /** |
||
105 | * Add an array of components to the list |
||
106 | * |
||
107 | * @param AbstractComponent[] $components |
||
108 | * @return void |
||
109 | */ |
||
110 | public function add_components( array $components ) |
||
117 | |||
118 | /** |
||
119 | * Add a single component to the list |
||
120 | * |
||
121 | * @param AbstractComponent[] $args |
||
122 | * @return void |
||
123 | */ |
||
124 | public function add_component( array $args ) |
||
136 | |||
137 | /** |
||
138 | * Verify that the given component name is unique among the list of value components |
||
139 | * |
||
140 | * @param AbstractComponent $comp |
||
141 | * @return void |
||
142 | */ |
||
143 | private function verify_name_uniqueness( AbstractComponent $comp ) |
||
158 | |||
159 | /** |
||
160 | * Filter the list of components |
||
161 | * |
||
162 | * @param function $callable |
||
163 | * @return array |
||
164 | */ |
||
165 | private function filter( $callable ) |
||
169 | } |
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: