1 | <?php |
||
33 | final class ShippingContext implements Context |
||
34 | { |
||
35 | /** |
||
36 | * @var SharedStorageInterface |
||
37 | */ |
||
38 | private $sharedStorage; |
||
39 | |||
40 | /** |
||
41 | * @var ShippingMethodRepositoryInterface |
||
42 | */ |
||
43 | private $shippingMethodRepository; |
||
44 | |||
45 | /** |
||
46 | * @var RepositoryInterface |
||
47 | */ |
||
48 | private $zoneRepository; |
||
49 | |||
50 | /** |
||
51 | * @var ShippingMethodExampleFactory |
||
52 | */ |
||
53 | private $shippingMethodExampleFactory; |
||
54 | |||
55 | /** |
||
56 | * @var FactoryInterface |
||
57 | */ |
||
58 | private $shippingMethodTranslationFactory; |
||
59 | |||
60 | /** |
||
61 | * @var ObjectManager |
||
62 | */ |
||
63 | private $shippingMethodManager; |
||
64 | |||
65 | /** |
||
66 | * @param SharedStorageInterface $sharedStorage |
||
67 | * @param ShippingMethodRepositoryInterface $shippingMethodRepository |
||
68 | * @param RepositoryInterface $zoneRepository |
||
69 | * @param ShippingMethodExampleFactory $shippingMethodExampleFactory |
||
70 | * @param FactoryInterface $shippingMethodTranslationFactory |
||
71 | * @param ObjectManager $shippingMethodManager |
||
72 | */ |
||
73 | public function __construct( |
||
88 | |||
89 | /** |
||
90 | * @Given the store ships everything for free within the :zone zone |
||
91 | */ |
||
92 | public function storeShipsEverythingForFree(ZoneInterface $zone) |
||
104 | |||
105 | /** |
||
106 | * @Given the store ships everywhere for free |
||
107 | */ |
||
108 | public function theStoreShipsEverywhereForFree() |
||
124 | |||
125 | /** |
||
126 | * @Given /^the store ships everywhere for free for (all channels)$/ |
||
127 | */ |
||
128 | public function theStoreShipsEverywhereForFreeForAllChannels(array $channels) |
||
146 | |||
147 | /** |
||
148 | * @Given the store (also )allows shipping with :name |
||
149 | */ |
||
150 | public function theStoreAllowsShippingMethodWithName($name) |
||
154 | |||
155 | /** |
||
156 | * @Given the store (also )allows shipping with :name identified by :code |
||
157 | */ |
||
158 | public function theStoreAllowsShippingMethodWithNameAndCode($name, $code) |
||
166 | |||
167 | /** |
||
168 | * @Given the store (also )allows shipping with :name at position :position |
||
169 | */ |
||
170 | public function theStoreAllowsShippingMethodWithNameAndPosition($name, $position) |
||
178 | |||
179 | /** |
||
180 | * @Given /^(this shipping method) is named "([^"]+)" in the "([^"]+)" locale$/ |
||
181 | */ |
||
182 | public function thisShippingMethodIsNamedInLocale(ShippingMethodInterface $shippingMethod, $name, $locale) |
||
193 | |||
194 | /** |
||
195 | * @Given the store allows shipping with :firstName and :secondName |
||
196 | */ |
||
197 | public function theStoreAllowsShippingWithAnd(...$names) |
||
203 | |||
204 | /** |
||
205 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee within the ("[^"]+" zone)$/ |
||
206 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee for the (rest of the world)$/ |
||
207 | */ |
||
208 | public function storeHasShippingMethodWithFeeAndZone($shippingMethodName, $fee, ZoneInterface $zone) |
||
224 | |||
225 | /** |
||
226 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee$/ |
||
227 | */ |
||
228 | public function storeHasShippingMethodWithFee($shippingMethodName, $fee) |
||
244 | |||
245 | /** |
||
246 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee per shipment for ("[^"]+" channel) and ("[^"]+") for ("[^"]+" channel)$/ |
||
247 | */ |
||
248 | public function storeHasShippingMethodWithFeePerShipmentForChannels( |
||
268 | |||
269 | /** |
||
270 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee per unit for ("[^"]+" channel) and ("[^"]+") for ("[^"]+" channel)$/ |
||
271 | */ |
||
272 | public function storeHasShippingMethodWithFeePerUnitForChannels( |
||
293 | |||
294 | /** |
||
295 | * @Given /^the store has disabled "([^"]+)" shipping method with ("[^"]+") fee$/ |
||
296 | */ |
||
297 | public function storeHasDisabledShippingMethodWithFee($shippingMethodName, $fee) |
||
312 | |||
313 | /** |
||
314 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee per unit$/ |
||
315 | */ |
||
316 | public function theStoreHasShippingMethodWithFeePerUnit($shippingMethodName, $fee) |
||
331 | |||
332 | /** |
||
333 | * @Given /^the store has "([^"]+)" shipping method with ("[^"]+") fee not assigned to any channel$/ |
||
334 | */ |
||
335 | public function storeHasShippingMethodWithFeeNotAssignedToAnyChannel($shippingMethodName, $fee) |
||
351 | |||
352 | /** |
||
353 | * @Given /^(shipping method "[^"]+") belongs to ("[^"]+" tax category)$/ |
||
354 | */ |
||
355 | public function shippingMethodBelongsToTaxCategory(ShippingMethodInterface $shippingMethod, TaxCategoryInterface $taxCategory) |
||
360 | |||
361 | /** |
||
362 | * @Given the shipping method :shippingMethod is enabled |
||
363 | */ |
||
364 | public function theShippingMethodIsEnabled(ShippingMethodInterface $shippingMethod) |
||
369 | |||
370 | /** |
||
371 | * @Given the shipping method :shippingMethod is disabled |
||
372 | */ |
||
373 | public function theShippingMethodIsDisabled(ShippingMethodInterface $shippingMethod) |
||
378 | |||
379 | /** |
||
380 | * @Given /^(this shipping method) requires at least one unit matches to ("([^"]+)" shipping category)$/ |
||
381 | */ |
||
382 | public function thisShippingMethodRequiresAtLeastOneUnitMatchToShippingCategory( |
||
390 | |||
391 | /** |
||
392 | * @Given /^(this shipping method) requires that all units match to ("([^"]+)" shipping category)$/ |
||
393 | */ |
||
394 | public function thisShippingMethodRequiresThatAllUnitsMatchToShippingCategory( |
||
402 | |||
403 | /** |
||
404 | * @Given /^(this shipping method) requires that no units match to ("([^"]+)" shipping category)$/ |
||
405 | */ |
||
406 | public function thisShippingMethodRequiresThatNoUnitsMatchToShippingCategory( |
||
414 | |||
415 | /** |
||
416 | * @param array $channels |
||
417 | * @param int $amount |
||
418 | * |
||
419 | * @return array |
||
420 | */ |
||
421 | private function getConfigurationByChannels(array $channels, $amount = 0) |
||
432 | |||
433 | /** |
||
434 | * @param ShippingMethodInterface $shippingMethod |
||
435 | */ |
||
436 | private function saveShippingMethod(ShippingMethodInterface $shippingMethod) |
||
441 | } |
||
442 |
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: