1 | <?php |
||
27 | final class ProductReviewContext implements Context |
||
28 | { |
||
29 | /** |
||
30 | * @var SharedStorageInterface |
||
31 | */ |
||
32 | private $sharedStorage; |
||
33 | |||
34 | /** |
||
35 | * @var FactoryInterface |
||
36 | */ |
||
37 | private $productReviewFactory; |
||
38 | |||
39 | /** |
||
40 | * @var RepositoryInterface |
||
41 | */ |
||
42 | private $productReviewRepository; |
||
43 | |||
44 | /** |
||
45 | * @var StateMachineFactoryInterface |
||
46 | */ |
||
47 | private $stateMachineFactory; |
||
48 | |||
49 | /** |
||
50 | * @param SharedStorageInterface $sharedStorage |
||
51 | * @param FactoryInterface $productReviewFactory |
||
52 | * @param RepositoryInterface $productReviewRepository |
||
53 | * @param StateMachineFactoryInterface $stateMachineFactory |
||
54 | */ |
||
55 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * @Given /^(this product) has one review$/ |
||
69 | */ |
||
70 | public function productHasAReview(ProductInterface $product) |
||
76 | |||
77 | /** |
||
78 | * @Given /^(this product) has(?:| also) a review titled "([^"]+)" and rated (\d+) added by (customer "[^"]+")(?:|, created (\d+) days ago)$/ |
||
79 | */ |
||
80 | public function thisProductHasAReviewTitledAndRatedAddedByCustomer( |
||
94 | |||
95 | /** |
||
96 | * @Given /^(this product) has(?:| also) a review titled "([^"]+)" and rated (\d+) added by (customer "[^"]+") which is not accepted yet$/ |
||
97 | */ |
||
98 | public function thisProductHasAReviewTitledAndRatedAddedByCustomerWhichIsNotAcceptedYet( |
||
108 | |||
109 | /** |
||
110 | * @Given /^(this product)(?:| also) has accepted reviews rated (\d+), (\d+), (\d+), (\d+) and (\d+)$/ |
||
111 | * @Given /^(this product)(?:| also) has accepted reviews rated (\d+), (\d+) and (\d+)$/ |
||
112 | */ |
||
113 | public function thisProductHasAcceptedReviewsRated(ProductInterface $product, ...$rates) |
||
121 | |||
122 | /** |
||
123 | * @Given /^(this product)(?:| also) has review rated (\d+) which is not accepted yet$/ |
||
124 | */ |
||
125 | public function itAlsoHasReviewRatedWhichIsNotAcceptedYet(ProductInterface $product, $rate) |
||
131 | |||
132 | /** |
||
133 | * @Given /^(this product) also has review rated (\d+) which is rejected$/ |
||
134 | */ |
||
135 | public function itAlsoHasReviewRatedWhichIsRejected(ProductInterface $product, $rate) |
||
141 | |||
142 | /** |
||
143 | * @param ProductInterface $product |
||
144 | * @param string $title |
||
145 | * @param int $rating |
||
146 | * @param string $comment |
||
147 | * @param CustomerInterface|null $customer |
||
148 | * @param string $transition |
||
149 | * |
||
150 | * @return ReviewInterface |
||
151 | */ |
||
152 | private function createProductReview( |
||
177 | } |
||
178 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.