1 | <?php |
||
22 | class TaxContext implements Context |
||
23 | { |
||
24 | /** |
||
25 | * @var FactoryInterface |
||
26 | */ |
||
27 | private $taxRateFactory; |
||
28 | |||
29 | /** |
||
30 | * @var FactoryInterface |
||
31 | */ |
||
32 | private $taxCategoryFactory; |
||
33 | |||
34 | /** |
||
35 | * @var RepositoryInterface |
||
36 | */ |
||
37 | private $taxRateRepository; |
||
38 | |||
39 | /** |
||
40 | * @var RepositoryInterface |
||
41 | */ |
||
42 | private $taxCategoryRepository; |
||
43 | |||
44 | /** |
||
45 | * @var RepositoryInterface |
||
46 | */ |
||
47 | private $zoneRepository; |
||
48 | |||
49 | /** |
||
50 | * @param FactoryInterface $taxRateFactory |
||
51 | * @param FactoryInterface $taxCategoryFactory |
||
52 | * @param RepositoryInterface $taxRateRepository |
||
53 | * @param RepositoryInterface $taxCategoryRepository |
||
54 | * @param RepositoryInterface $zoneRepository |
||
55 | */ |
||
56 | public function __construct( |
||
69 | |||
70 | /** |
||
71 | * @Transform /^"([^"]+)" tax category$/ |
||
72 | * @Transform /^tax category "([^"]+)"$/ |
||
73 | */ |
||
74 | public function castTaxCategoryNameToTaxCategory($taxCategoryName) |
||
83 | |||
84 | /** |
||
85 | * @Given /^store has "([^"]+)" tax rate of ([^"]+)% for "([^"]+)" within ("([^"]+)" zone)$/ |
||
86 | */ |
||
87 | public function storeHasTaxRateWithinZone($taxRateName, $taxRateAmount, $taxCategoryName, ZoneInterface $taxZone) |
||
105 | |||
106 | /** |
||
107 | * @param string $taxRateAmount |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | private function getAmountFromString($taxRateAmount) |
||
115 | |||
116 | /** |
||
117 | * @param string $taxRateName |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | private function getCodeFromName($taxRateName) |
||
125 | } |
||
126 |