Completed
Push — feature/eco-3656/eco-3658-enab... ( 4f4220...78bea4 )
by
unknown
04:14
created

ComputopFactory   D

Complexity

Total Complexity 59

Size/Duplication

Total Lines 558
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 59
eloc 134
c 3
b 0
f 0
dl 0
loc 558
rs 4.08

59 Methods

Rating   Name   Duplication   Size   Complexity  
A createPayNowPaymentHandler() 0 3 1
A createEasyCreditPaymentHandler() 0 6 1
A createInitCreditCardConverter() 0 3 1
A createOrderEasyCreditMapper() 0 10 1
A createOrderSofortMapper() 0 10 1
A getStore() 0 3 1
A getRequestStack() 0 3 1
A createInitSofortConverter() 0 3 1
A createOrderPayNowMapper() 0 10 1
A createPayNowForm() 0 3 1
A getComputopApiService() 0 3 1
A createPayPalForm() 0 3 1
A createPaydirektForm() 0 3 1
A getCalculationClient() 0 3 1
A createPayPalPaymentHandler() 0 3 1
A createEasyCreditFormDataProvider() 0 3 1
A createInitDirectDebitConverter() 0 3 1
A getHttpClient() 0 3 1
A createPayPalFormDataProvider() 0 3 1
A getComputopConfig() 0 3 1
A createOrderCreditCardMapper() 0 10 1
A createOrderPayPalMapper() 0 10 1
A createPaydirektPaymentHandler() 0 3 1
A getCountryClient() 0 3 1
A getApplication() 0 3 1
A createOrderDirectDebitMapper() 0 10 1
A createPayPalExpressPrepareHandler() 0 8 1
A createOrderPayPalExpressMapper() 0 10 1
A createIdealForm() 0 3 1
A createIdealFormDataProvider() 0 3 1
A createCreditCardPaymentHandler() 0 3 1
A getUtilEncodingService() 0 3 1
A createSofortPaymentHandler() 0 3 1
A createInitEasyCreditConverter() 0 3 1
A createEasyCreditForm() 0 3 1
A getRouter() 0 3 1
A createDirectDebitPaymentHandler() 0 3 1
A createIdealPaymentHandler() 0 3 1
A getComputopClient() 0 3 1
A createPayPalExpressToQuoteMapper() 0 3 1
A createPayPalExpressInitHandler() 0 6 1
A createCreditCardForm() 0 3 1
A createDirectDebitFormDataProvider() 0 3 1
A createInitPayNowConverter() 0 3 1
A createPayNowFormDataProvider() 0 3 1
A createDirectDebitForm() 0 3 1
A createPayPalExpressFormDataProvider() 0 3 1
A createPaydirektFormDataProvider() 0 3 1
A createSofortFormDataProvider() 0 3 1
A createComputopPaymentHandler() 0 3 1
A createInitPaydirektConverter() 0 3 1
A createCreditCardFormDataProvider() 0 3 1
A createInitPayPalConverter() 0 3 1
A createSofortForm() 0 3 1
A createInitIdealConverter() 0 3 1
A createInitPayPalExpressConverter() 0 3 1
A createOrderPaydirektMapper() 0 10 1
A createOrderIdealMapper() 0 10 1
A getQuoteClient() 0 3 1

How to fix   Complexity   

Complex Class

Complex classes like ComputopFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use ComputopFactory, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop;
9
10
use Spryker\Yves\Kernel\AbstractFactory;
11
use Spryker\Yves\Router\Router\RouterInterface;
12
use SprykerEco\Yves\Computop\Converter\InitCreditCardConverter;
13
use SprykerEco\Yves\Computop\Converter\InitDirectDebitConverter;
14
use SprykerEco\Yves\Computop\Converter\InitEasyCreditConverter;
15
use SprykerEco\Yves\Computop\Converter\InitIdealConverter;
16
use SprykerEco\Yves\Computop\Converter\InitPaydirektConverter;
17
use SprykerEco\Yves\Computop\Converter\InitPayNowConverter;
18
use SprykerEco\Yves\Computop\Converter\InitPayPalConverter;
19
use SprykerEco\Yves\Computop\Converter\InitPayPalExpressConverter;
20
use SprykerEco\Yves\Computop\Converter\InitSofortConverter;
21
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface;
22
use SprykerEco\Yves\Computop\Dependency\External\ComputopToGuzzleHttpClientInterface;
23
use SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface;
24
use SprykerEco\Yves\Computop\Form\CreditCardSubForm;
25
use SprykerEco\Yves\Computop\Form\DataProvider\CreditCardFormDataProvider;
26
use SprykerEco\Yves\Computop\Form\DataProvider\DirectDebitFormDataProvider;
27
use SprykerEco\Yves\Computop\Form\DataProvider\EasyCreditFormDataProvider;
28
use SprykerEco\Yves\Computop\Form\DataProvider\IdealFormDataProvider;
29
use SprykerEco\Yves\Computop\Form\DataProvider\PaydirektFormDataProvider;
30
use SprykerEco\Yves\Computop\Form\DataProvider\PayNowFormDataProvider;
31
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalExpressFormDataProvider;
32
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalFormDataProvider;
33
use SprykerEco\Yves\Computop\Form\DataProvider\SofortFormDataProvider;
34
use SprykerEco\Yves\Computop\Form\DirectDebitSubForm;
35
use SprykerEco\Yves\Computop\Form\EasyCreditSubForm;
36
use SprykerEco\Yves\Computop\Form\IdealSubForm;
37
use SprykerEco\Yves\Computop\Form\PaydirektSubForm;
38
use SprykerEco\Yves\Computop\Form\PayNowSubForm;
39
use SprykerEco\Yves\Computop\Form\PayPalSubForm;
40
use SprykerEco\Yves\Computop\Form\SofortSubForm;
41
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandler;
42
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitHandler;
43
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareHandler;
44
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareHandlerInterface;
45
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopCreditCardPaymentHandler;
46
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopDirectDebitPaymentHandler;
47
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopEasyCreditPaymentHandler;
48
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopIdealPaymentHandler;
49
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPaydirektPaymentHandler;
50
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayNowPaymentHandler;
51
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayPalPaymentHandler;
52
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopSofortPaymentHandler;
53
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\CreditCardMapper;
54
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\DirectDebitMapper;
55
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\EasyCreditMapper;
56
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\IdealMapper;
57
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PaydirektMapper;
58
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayNowMapper;
59
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalExpressMapper;
60
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalMapper;
61
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\SofortMapper;
62
use SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapper;
63
use Symfony\Component\HttpFoundation\RequestStack;
64
65
/**
66
 * @method \SprykerEco\Yves\Computop\ComputopConfig getConfig()
67
 * @method \SprykerEco\Client\Computop\ComputopClientInterface getClient()
68
 */
69
class ComputopFactory extends AbstractFactory
70
{
71
    /**
72
     * @return \SprykerEco\Yves\Computop\ComputopConfigInterface
73
     */
74
    public function getComputopConfig()
75
    {
76
        return $this->getConfig();
77
    }
78
79
    /**
80
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface
81
     */
82
    public function createComputopPaymentHandler()
83
    {
84
        return new ComputopPaymentHandler($this->getConfig());
85
    }
86
87
    /**
88
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
89
     */
90
    public function createCreditCardForm()
91
    {
92
        return new CreditCardSubForm();
93
    }
94
95
    /**
96
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
97
     */
98
    public function createPayNowForm()
99
    {
100
        return new PayNowSubForm();
101
    }
102
103
    /**
104
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
105
     */
106
    public function createPayPalForm()
107
    {
108
        return new PayPalSubForm();
109
    }
110
111
    /**
112
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
113
     */
114
    public function createSofortForm()
115
    {
116
        return new SofortSubForm();
117
    }
118
119
    /**
120
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
121
     */
122
    public function createDirectDebitForm()
123
    {
124
        return new DirectDebitSubForm();
125
    }
126
127
    /**
128
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
129
     */
130
    public function createPaydirektForm()
131
    {
132
        return new PaydirektSubForm();
133
    }
134
135
    /**
136
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
137
     */
138
    public function createIdealForm()
139
    {
140
        return new IdealSubForm();
141
    }
142
143
    /**
144
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
145
     */
146
    public function createEasyCreditForm()
147
    {
148
        return new EasyCreditSubForm();
149
    }
150
151
    /**
152
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
153
     */
154
    public function createCreditCardFormDataProvider()
155
    {
156
        return new CreditCardFormDataProvider($this->getQuoteClient(), $this->createOrderCreditCardMapper());
157
    }
158
159
    /**
160
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
161
     */
162
    public function createPayNowFormDataProvider()
163
    {
164
        return new PayNowFormDataProvider($this->getQuoteClient(), $this->createOrderPayNowMapper());
165
    }
166
167
    /**
168
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
169
     */
170
    public function createPayPalFormDataProvider()
171
    {
172
        return new PayPalFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalMapper());
173
    }
174
175
    /**
176
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
177
     */
178
    public function createPayPalExpressFormDataProvider()
179
    {
180
        return new PayPalExpressFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalExpressMapper());
181
    }
182
183
    /**
184
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
185
     */
186
    public function createSofortFormDataProvider()
187
    {
188
        return new SofortFormDataProvider($this->getQuoteClient(), $this->createOrderSofortMapper());
189
    }
190
191
    /**
192
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
193
     */
194
    public function createDirectDebitFormDataProvider()
195
    {
196
        return new DirectDebitFormDataProvider($this->getQuoteClient(), $this->createOrderDirectDebitMapper());
197
    }
198
199
    /**
200
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
201
     */
202
    public function createPaydirektFormDataProvider()
203
    {
204
        return new PaydirektFormDataProvider($this->getQuoteClient(), $this->createOrderPaydirektMapper());
205
    }
206
207
    /**
208
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
209
     */
210
    public function createIdealFormDataProvider()
211
    {
212
        return new IdealFormDataProvider($this->getQuoteClient(), $this->createOrderIdealMapper());
213
    }
214
215
    /**
216
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
217
     */
218
    public function createEasyCreditFormDataProvider()
219
    {
220
        return new EasyCreditFormDataProvider($this->getQuoteClient(), $this->createOrderEasyCreditMapper());
221
    }
222
223
    /**
224
     * @return \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface
225
     */
226
    public function getComputopApiService()
227
    {
228
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_COMPUTOP_API);
229
    }
230
231
    /**
232
     * @return \Symfony\Component\HttpKernel\HttpKernelInterface
233
     */
234
    public function getApplication()
235
    {
236
        return $this->getProvidedDependency(ComputopDependencyProvider::PLUGIN_APPLICATION);
237
    }
238
239
    /**
240
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface
241
     */
242
    public function getQuoteClient()
243
    {
244
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_QUOTE);
245
    }
246
247
    /**
248
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
249
     */
250
    public function createCreditCardPaymentHandler()
251
    {
252
        return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient());
253
    }
254
255
    /**
256
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
257
     */
258
    public function createPayNowPaymentHandler()
259
    {
260
        return new ComputopPayNowPaymentHandler($this->createInitPayNowConverter(), $this->getComputopClient());
261
    }
262
263
    /**
264
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
265
     */
266
    public function createPayPalPaymentHandler()
267
    {
268
        return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient());
269
    }
270
271
    /**
272
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitHandlerInterface
273
     */
274
    public function createPayPalExpressInitHandler()
275
    {
276
        return new ComputopPayPalExpressInitHandler(
277
            $this->createInitPayPalExpressConverter(),
278
            $this->getQuoteClient(),
279
            $this->createPayPalExpressToQuoteMapper()
280
        );
281
    }
282
283
    /**
284
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareHandlerInterface
285
     */
286
    public function createPayPalExpressPrepareHandler(): ComputopPayPalExpressPrepareHandlerInterface
287
    {
288
        return new ComputopPayPalExpressPrepareHandler(
289
            $this->getQuoteClient(),
290
            $this->createPayPalExpressFormDataProvider(),
291
            $this->getHttpClient(),
292
            $this->getComputopApiService(),
293
            $this->getComputopConfig()
294
        );
295
    }
296
297
    /**
298
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
299
     */
300
    public function createDirectDebitPaymentHandler()
301
    {
302
        return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient());
303
    }
304
305
    /**
306
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
307
     */
308
    public function createEasyCreditPaymentHandler()
309
    {
310
        return new ComputopEasyCreditPaymentHandler(
311
            $this->createInitEasyCreditConverter(),
312
            $this->getComputopClient(),
313
            $this->getCalculationClient()
314
        );
315
    }
316
317
    /**
318
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
319
     */
320
    public function createPaydirektPaymentHandler()
321
    {
322
        return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient());
323
    }
324
325
    /**
326
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
327
     */
328
    public function createSofortPaymentHandler()
329
    {
330
        return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient());
331
    }
332
333
    /**
334
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
335
     */
336
    public function createIdealPaymentHandler()
337
    {
338
        return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient());
339
    }
340
341
    /**
342
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
343
     */
344
    protected function createInitCreditCardConverter()
345
    {
346
        return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig());
347
    }
348
349
    /**
350
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
351
     */
352
    protected function createInitPayNowConverter()
353
    {
354
        return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig());
355
    }
356
357
    /**
358
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
359
     */
360
    protected function createInitPayPalConverter()
361
    {
362
        return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig());
363
    }
364
365
    /**
366
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
367
     */
368
    protected function createInitPayPalExpressConverter()
369
    {
370
        return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig());
371
    }
372
373
    /**
374
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
375
     */
376
    protected function createInitDirectDebitConverter()
377
    {
378
        return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig());
379
    }
380
381
    /**
382
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
383
     */
384
    protected function createInitEasyCreditConverter()
385
    {
386
        return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig());
387
    }
388
389
    /**
390
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
391
     */
392
    protected function createInitPaydirektConverter()
393
    {
394
        return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig());
395
    }
396
397
    /**
398
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
399
     */
400
    protected function createInitSofortConverter()
401
    {
402
        return new InitSofortConverter($this->getComputopApiService(), $this->getConfig());
403
    }
404
405
    /**
406
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
407
     */
408
    protected function createInitIdealConverter()
409
    {
410
        return new InitIdealConverter($this->getComputopApiService(), $this->getConfig());
411
    }
412
413
    /**
414
     * @return \SprykerEco\Client\Computop\ComputopClientInterface
415
     */
416
    protected function getComputopClient()
417
    {
418
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP);
419
    }
420
421
    /**
422
     * @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface
423
     */
424
    protected function getStore()
425
    {
426
        return $this->getProvidedDependency(ComputopDependencyProvider::STORE);
427
    }
428
429
    /**
430
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface
431
     */
432
    protected function getCalculationClient()
433
    {
434
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION);
435
    }
436
437
    /**
438
     * @return \SprykerEco\Yves\Computop\Dependency\External\ComputopToGuzzleHttpClientInterface
439
     */
440
    protected function getHttpClient(): ComputopToGuzzleHttpClientInterface
441
    {
442
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_HTTP);
443
    }
444
445
    /**
446
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
447
     */
448
    protected function createOrderCreditCardMapper()
449
    {
450
        return new CreditCardMapper(
451
            $this->getComputopApiService(),
452
            $this->getRouter(),
453
            $this->getStore(),
454
            $this->getConfig(),
455
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...rdMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

455
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
456
            $this->getUtilEncodingService(),
457
            $this->getCountryClient()
458
        );
459
    }
460
461
    /**
462
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
463
     */
464
    protected function createOrderPayNowMapper()
465
    {
466
        return new PayNowMapper(
467
            $this->getComputopApiService(),
468
            $this->getRouter(),
469
            $this->getStore(),
470
            $this->getConfig(),
471
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...owMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

471
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
472
            $this->getUtilEncodingService(),
473
            $this->getCountryClient()
474
        );
475
    }
476
477
    /**
478
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
479
     */
480
    protected function createOrderPayPalMapper()
481
    {
482
        return new PayPalMapper(
483
            $this->getComputopApiService(),
484
            $this->getRouter(),
485
            $this->getStore(),
486
            $this->getConfig(),
487
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...alMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

487
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
488
            $this->getUtilEncodingService(),
489
            $this->getCountryClient()
490
        );
491
    }
492
493
    /**
494
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
495
     */
496
    protected function createOrderPayPalExpressMapper()
497
    {
498
        return new PayPalExpressMapper(
499
            $this->getComputopApiService(),
500
            $this->getRouter(),
501
            $this->getStore(),
502
            $this->getConfig(),
503
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...ssMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

503
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
504
            $this->getUtilEncodingService(),
505
            $this->getCountryClient()
506
        );
507
    }
508
509
    /**
510
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
511
     */
512
    protected function createOrderDirectDebitMapper()
513
    {
514
        return new DirectDebitMapper(
515
            $this->getComputopApiService(),
516
            $this->getRouter(),
517
            $this->getStore(),
518
            $this->getConfig(),
519
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...itMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

519
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
520
            $this->getUtilEncodingService(),
521
            $this->getCountryClient()
522
        );
523
    }
524
525
    /**
526
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
527
     */
528
    protected function createOrderSofortMapper()
529
    {
530
        return new SofortMapper(
531
            $this->getComputopApiService(),
532
            $this->getRouter(),
533
            $this->getStore(),
534
            $this->getConfig(),
535
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...rtMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

535
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
536
            $this->getUtilEncodingService(),
537
            $this->getCountryClient()
538
        );
539
    }
540
541
    /**
542
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
543
     */
544
    protected function createOrderPaydirektMapper()
545
    {
546
        return new PaydirektMapper(
547
            $this->getComputopApiService(),
548
            $this->getRouter(),
549
            $this->getStore(),
550
            $this->getConfig(),
551
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...ktMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

551
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
552
            $this->getUtilEncodingService(),
553
            $this->getCountryClient()
554
        );
555
    }
556
557
    /**
558
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
559
     */
560
    protected function createOrderIdealMapper()
561
    {
562
        return new IdealMapper(
563
            $this->getComputopApiService(),
564
            $this->getRouter(),
565
            $this->getStore(),
566
            $this->getConfig(),
567
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...alMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

567
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
568
            $this->getUtilEncodingService(),
569
            $this->getCountryClient()
570
        );
571
    }
572
573
    /**
574
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
575
     */
576
    protected function createOrderEasyCreditMapper()
577
    {
578
        return new EasyCreditMapper(
579
            $this->getComputopApiService(),
580
            $this->getRouter(),
581
            $this->getStore(),
582
            $this->getConfig(),
583
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...itMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

583
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
584
            $this->getUtilEncodingService(),
585
            $this->getCountryClient()
586
        );
587
    }
588
589
    /**
590
     * @return \Spryker\Yves\Router\Router\RouterInterface
591
     */
592
    public function getRouter(): RouterInterface
593
    {
594
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER);
595
    }
596
597
    /**
598
     * @return \Symfony\Component\HttpFoundation\RequestStack
599
     */
600
    public function getRequestStack(): RequestStack
601
    {
602
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK);
603
    }
604
605
    /**
606
     * @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface
607
     */
608
    public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface
609
    {
610
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING);
611
    }
612
613
    /**
614
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface
615
     */
616
    public function getCountryClient(): ComputopToCountryClientInterface
617
    {
618
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY);
619
    }
620
621
    /**
622
     * @return PayPalExpressToQuoteMapper
623
     */
624
    protected function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapper
625
    {
626
        return new PayPalExpressToQuoteMapper();
627
    }
628
}
629