1 | <?php |
||
17 | class WC_Cart_Fees implements Iterator { |
||
18 | |||
19 | /** |
||
20 | * An array of fee objects. |
||
21 | * @var object[] |
||
22 | */ |
||
23 | private $fees = array(); |
||
24 | |||
25 | /** |
||
26 | * Iterator Position. |
||
27 | * @var integer |
||
28 | */ |
||
29 | private $position = 0; |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | */ |
||
34 | public function __construct() { |
||
37 | |||
38 | /** |
||
39 | * Rewind Iterator. |
||
40 | */ |
||
41 | public function rewind() { |
||
44 | |||
45 | /** |
||
46 | * Current Iterator. |
||
47 | */ |
||
48 | public function current() { |
||
51 | |||
52 | /** |
||
53 | * Key Iterator. |
||
54 | */ |
||
55 | public function key() { |
||
58 | |||
59 | /** |
||
60 | * Next Iterator. |
||
61 | */ |
||
62 | public function next() { |
||
65 | |||
66 | /** |
||
67 | * Valid Iterator. |
||
68 | */ |
||
69 | public function valid() { |
||
72 | |||
73 | /** |
||
74 | * Allow 3rd parties to calculate and register fees. |
||
75 | */ |
||
76 | public function calculate_fees() { |
||
86 | |||
87 | /** |
||
88 | * Generate a unique ID for the fee being added. |
||
89 | * |
||
90 | * @param string $fee Fee name. |
||
91 | * @return string fee key. |
||
92 | */ |
||
93 | public function generate_key( $fee ) { |
||
96 | |||
97 | /** |
||
98 | * Get fees. |
||
99 | * @return array |
||
100 | */ |
||
101 | public function get_fees() { |
||
104 | |||
105 | /** |
||
106 | * Set fees. |
||
107 | * @param object[] $value Array of fees. |
||
108 | */ |
||
109 | public function set_fees( $value ) { |
||
112 | } |
||
113 |
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: