1 | <?php |
||
23 | class ShoppingCart extends \yz\shoppingcart\ShoppingCart |
||
24 | { |
||
25 | /** |
||
26 | * @var AbstractCartPosition[] |
||
27 | * TODO make local AbstractCartPosition |
||
28 | */ |
||
29 | protected $_positions = []; |
||
30 | |||
31 | /** |
||
32 | * The cart module. |
||
33 | */ |
||
34 | public $module; |
||
35 | |||
36 | /** |
||
37 | * @return integer |
||
38 | */ |
||
39 | 1 | public function getCount() |
|
43 | |||
44 | 1 | public function getQuantity() |
|
53 | |||
54 | 2 | public function getSubtotal() |
|
58 | |||
59 | 2 | public function getTotal() |
|
63 | |||
64 | 1 | public function getDiscount() |
|
68 | |||
69 | 1 | public function formatCurrency($sum, $currency = null) |
|
73 | |||
74 | /** |
||
75 | * Sets cart from serialized string |
||
76 | * @param string $serialized |
||
77 | */ |
||
78 | public function setSerialized($serialized) |
||
88 | |||
89 | /** |
||
90 | * Checks whether any of cart positions has error in `id` attribute. |
||
91 | * @return boolean |
||
92 | */ |
||
93 | public function hasErrors() |
||
103 | |||
104 | /** |
||
105 | * @param CartPositionInterface[] $positions |
||
106 | */ |
||
107 | public function putPositions($positions) |
||
130 | |||
131 | public function getCurrency(): ?string |
||
139 | |||
140 | /** |
||
141 | * @return array |
||
142 | */ |
||
143 | public function getAdditionalLinks(): array |
||
165 | |||
166 | /** |
||
167 | * @var CartActionEvent[]|null |
||
168 | */ |
||
169 | private $_accumulatedEvents; |
||
170 | public function trigger($name, Event $event = null) |
||
179 | |||
180 | /** |
||
181 | * Runs $closure and accumulates all events occurred during $closure run. |
||
182 | * Events get released immediately after a success $closure run. |
||
183 | * |
||
184 | * The method can be used to prevent useless calculations that happen after |
||
185 | * bunch of similar updates on a cart. |
||
186 | * |
||
187 | * @param \Closure $closure |
||
188 | */ |
||
189 | public function accumulateEvents(\Closure $closure): void |
||
204 | } |
||
205 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.