1 | <?php |
||
31 | final class TaxonomyContext implements Context |
||
32 | { |
||
33 | /** |
||
34 | * @var RepositoryInterface |
||
35 | */ |
||
36 | private $taxonRepository; |
||
37 | |||
38 | /** |
||
39 | * @var FactoryInterface |
||
40 | */ |
||
41 | private $taxonFactory; |
||
42 | |||
43 | /** |
||
44 | * @var FactoryInterface |
||
45 | */ |
||
46 | private $taxonTranslationFactory; |
||
47 | |||
48 | /** |
||
49 | * @var FactoryInterface |
||
50 | */ |
||
51 | private $taxonImageFactory; |
||
52 | |||
53 | /** |
||
54 | * @var ObjectManager |
||
55 | */ |
||
56 | private $objectManager; |
||
57 | |||
58 | /** |
||
59 | * @var ImageUploaderInterface |
||
60 | */ |
||
61 | private $imageUploader; |
||
62 | |||
63 | /** |
||
64 | * @var TaxonSlugGeneratorInterface |
||
65 | */ |
||
66 | private $taxonSlugGenerator; |
||
67 | |||
68 | /** |
||
69 | * @var array |
||
70 | */ |
||
71 | private $minkParameters; |
||
72 | |||
73 | /** |
||
74 | * @param RepositoryInterface $taxonRepository |
||
75 | * @param FactoryInterface $taxonFactory |
||
76 | * @param FactoryInterface $taxonTranslationFactory |
||
77 | * @param FactoryInterface $taxonImageFactory |
||
78 | * @param ObjectManager $objectManager |
||
79 | * @param ImageUploaderInterface $imageUploader |
||
80 | * @param TaxonSlugGeneratorInterface $taxonSlugGenerator |
||
81 | * @param array $minkParameters |
||
82 | */ |
||
83 | public function __construct( |
||
102 | |||
103 | /** |
||
104 | * @Given the store has :firstTaxonName taxonomy |
||
105 | * @Given the store classifies its products as :firstTaxonName |
||
106 | * @Given the store classifies its products as :firstTaxonName and :secondTaxonName |
||
107 | * @Given the store classifies its products as :firstTaxonName, :secondTaxonName and :thirdTaxonName |
||
108 | * @Given the store classifies its products as :firstTaxonName, :secondTaxonName, :thirdTaxonName and :fourthTaxonName |
||
109 | */ |
||
110 | public function storeClassifiesItsProductsAs(...$taxonsNames) |
||
116 | |||
117 | /** |
||
118 | * @Given /^the store has taxonomy named "([^"]+)" in ("[^"]+" locale) and "([^"]+)" in ("[^"]+" locale)$/ |
||
119 | */ |
||
120 | public function theStoreHasTaxonomyNamedInAndIn($firstName, $firstLocale, $secondName, $secondLocale) |
||
129 | |||
130 | /** |
||
131 | * @Given /^the ("[^"]+" taxon)(?:| also) has an image "([^"]+)" with "([^"]+)" type$/ |
||
132 | */ |
||
133 | public function theTaxonHasAnImageWithType(TaxonInterface $taxon, $imagePath, $imageType) |
||
147 | |||
148 | /** |
||
149 | * @Given /^the ("[^"]+" taxon) has children taxon "([^"]+)" and "([^"]+)"$/ |
||
150 | */ |
||
151 | public function theTaxonHasChildrenTaxonAnd(TaxonInterface $taxon, $firstTaxonName, $secondTaxonName) |
||
158 | |||
159 | /** |
||
160 | * @param string $name |
||
161 | * |
||
162 | * @return TaxonInterface |
||
163 | */ |
||
164 | private function createTaxon($name) |
||
174 | |||
175 | /** |
||
176 | * @param array $names |
||
177 | * |
||
178 | * @return TaxonInterface |
||
179 | */ |
||
180 | private function createTaxonInManyLanguages(array $names) |
||
197 | |||
198 | /** |
||
199 | * @param string $name |
||
200 | * |
||
201 | * @return NodeElement |
||
202 | */ |
||
203 | private function getParameter($name) |
||
207 | } |
||
208 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: