1 | <?php |
||
32 | class OrderFixture extends AbstractFixture |
||
33 | { |
||
34 | /** |
||
35 | * @var FactoryInterface |
||
36 | */ |
||
37 | private $orderFactory; |
||
38 | |||
39 | /** |
||
40 | * @var FactoryInterface |
||
41 | */ |
||
42 | private $orderItemFactory; |
||
43 | |||
44 | /** |
||
45 | * @var OrderItemQuantityModifierInterface |
||
46 | */ |
||
47 | private $orderItemQuantityModifier; |
||
48 | |||
49 | /** |
||
50 | * @var ObjectManager |
||
51 | */ |
||
52 | private $orderManager; |
||
53 | |||
54 | /** |
||
55 | * @var RepositoryInterface |
||
56 | */ |
||
57 | private $channelRepository; |
||
58 | |||
59 | /** |
||
60 | * @var RepositoryInterface |
||
61 | */ |
||
62 | private $customerRepository; |
||
63 | |||
64 | /** |
||
65 | * @var RepositoryInterface |
||
66 | */ |
||
67 | private $productRepository; |
||
68 | |||
69 | /** |
||
70 | * @var RepositoryInterface |
||
71 | */ |
||
72 | private $countryRepository; |
||
73 | |||
74 | /** |
||
75 | * @var PaymentMethodRepositoryInterface |
||
76 | */ |
||
77 | private $paymentMethodRepository; |
||
78 | |||
79 | /** |
||
80 | * @var ShippingMethodRepositoryInterface |
||
81 | */ |
||
82 | private $shippingMethodRepository; |
||
83 | |||
84 | /** |
||
85 | * @var FactoryInterface |
||
86 | */ |
||
87 | private $addressFactory; |
||
88 | |||
89 | /** |
||
90 | * @var StateMachineFactoryInterface |
||
91 | */ |
||
92 | private $stateMachineFactory; |
||
93 | |||
94 | /** |
||
95 | * @var OrderShippingMethodSelectionRequirementCheckerInterface |
||
96 | */ |
||
97 | private $orderShippingMethodSelectionRequirementChecker; |
||
98 | |||
99 | /** |
||
100 | * @var OrderPaymentMethodSelectionRequirementCheckerInterface |
||
101 | */ |
||
102 | private $orderPaymentMethodSelectionRequirementChecker; |
||
103 | |||
104 | /** |
||
105 | * @var \Faker\Generator |
||
106 | */ |
||
107 | private $faker; |
||
108 | |||
109 | /** |
||
110 | * @param FactoryInterface $orderFactory |
||
111 | * @param FactoryInterface $orderItemFactory |
||
112 | * @param OrderItemQuantityModifierInterface $orderItemQuantityModifier |
||
113 | * @param ObjectManager $orderManager |
||
114 | * @param RepositoryInterface $channelRepository |
||
115 | * @param RepositoryInterface $customerRepository |
||
116 | * @param RepositoryInterface $productRepository |
||
117 | * @param RepositoryInterface $countryRepository |
||
118 | * @param PaymentMethodRepositoryInterface $paymentMethodRepository |
||
119 | * @param ShippingMethodRepositoryInterface $shippingMethodRepository |
||
120 | * @param FactoryInterface $addressFactory |
||
121 | * @param StateMachineFactoryInterface $stateMachineFactory |
||
122 | * @param OrderShippingMethodSelectionRequirementCheckerInterface $orderShippingMethodSelectionRequirementChecker |
||
123 | * @param OrderPaymentMethodSelectionRequirementCheckerInterface $orderPaymentMethodSelectionRequirementChecker |
||
124 | */ |
||
125 | public function __construct( |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function load(array $options): void |
||
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | public function getName(): string |
||
206 | |||
207 | /** |
||
208 | * {@inheritdoc} |
||
209 | */ |
||
210 | protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void |
||
217 | |||
218 | /** |
||
219 | * @param OrderInterface $order |
||
220 | */ |
||
221 | private function generateItems(OrderInterface $order): void |
||
238 | |||
239 | /** |
||
240 | * @param OrderInterface $order |
||
241 | * @param string $countryCode |
||
242 | */ |
||
243 | private function address(OrderInterface $order, string $countryCode): void |
||
259 | |||
260 | /** |
||
261 | * @param OrderInterface $order |
||
262 | */ |
||
263 | private function selectShipping(OrderInterface $order): void |
||
279 | |||
280 | /** |
||
281 | * @param OrderInterface $order |
||
282 | */ |
||
283 | private function selectPayment(OrderInterface $order): void |
||
299 | |||
300 | /** |
||
301 | * @param OrderInterface $order |
||
302 | */ |
||
303 | private function completeCheckout(OrderInterface $order): void |
||
311 | |||
312 | /** |
||
313 | * @param OrderInterface $order |
||
314 | * @param string $transition |
||
315 | */ |
||
316 | private function applyCheckoutStateTransition(OrderInterface $order, string $transition): void |
||
320 | } |
||
321 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: