Completed
Push — feature/eco-3656/eco-3658-enab... ( 85b20e...4f4220 )
by
unknown
04:19
created

ComputopFactory::createDirectDebitPaymentHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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

431
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
432
            $this->getUtilEncodingService(),
433
            $this->getCountryClient()
434
        );
435
    }
436
437
    /**
438
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
439
     */
440
    protected function createOrderPayNowMapper()
441
    {
442
        return new PayNowMapper(
443
            $this->getComputopApiService(),
444
            $this->getRouter(),
445
            $this->getStore(),
446
            $this->getConfig(),
447
            $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

447
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
448
            $this->getUtilEncodingService(),
449
            $this->getCountryClient()
450
        );
451
    }
452
453
    /**
454
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
455
     */
456
    protected function createOrderPayPalMapper()
457
    {
458
        return new PayPalMapper(
459
            $this->getComputopApiService(),
460
            $this->getRouter(),
461
            $this->getStore(),
462
            $this->getConfig(),
463
            $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

463
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
464
            $this->getUtilEncodingService(),
465
            $this->getCountryClient()
466
        );
467
    }
468
469
    /**
470
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
471
     */
472
    protected function createOrderPayPalExpressMapper()
473
    {
474
        return new PayPalExpressMapper(
475
            $this->getComputopApiService(),
476
            $this->getRouter(),
477
            $this->getStore(),
478
            $this->getConfig(),
479
            $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

479
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
480
            $this->getUtilEncodingService(),
481
            $this->getCountryClient()
482
        );
483
    }
484
485
    /**
486
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
487
     */
488
    protected function createOrderDirectDebitMapper()
489
    {
490
        return new DirectDebitMapper(
491
            $this->getComputopApiService(),
492
            $this->getRouter(),
493
            $this->getStore(),
494
            $this->getConfig(),
495
            $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

495
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
496
            $this->getUtilEncodingService(),
497
            $this->getCountryClient()
498
        );
499
    }
500
501
    /**
502
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
503
     */
504
    protected function createOrderSofortMapper()
505
    {
506
        return new SofortMapper(
507
            $this->getComputopApiService(),
508
            $this->getRouter(),
509
            $this->getStore(),
510
            $this->getConfig(),
511
            $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

511
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
512
            $this->getUtilEncodingService(),
513
            $this->getCountryClient()
514
        );
515
    }
516
517
    /**
518
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
519
     */
520
    protected function createOrderPaydirektMapper()
521
    {
522
        return new PaydirektMapper(
523
            $this->getComputopApiService(),
524
            $this->getRouter(),
525
            $this->getStore(),
526
            $this->getConfig(),
527
            $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

527
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
528
            $this->getUtilEncodingService(),
529
            $this->getCountryClient()
530
        );
531
    }
532
533
    /**
534
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
535
     */
536
    protected function createOrderIdealMapper()
537
    {
538
        return new IdealMapper(
539
            $this->getComputopApiService(),
540
            $this->getRouter(),
541
            $this->getStore(),
542
            $this->getConfig(),
543
            $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

543
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
544
            $this->getUtilEncodingService(),
545
            $this->getCountryClient()
546
        );
547
    }
548
549
    /**
550
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
551
     */
552
    protected function createOrderEasyCreditMapper()
553
    {
554
        return new EasyCreditMapper(
555
            $this->getComputopApiService(),
556
            $this->getRouter(),
557
            $this->getStore(),
558
            $this->getConfig(),
559
            $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

559
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
560
            $this->getUtilEncodingService(),
561
            $this->getCountryClient()
562
        );
563
    }
564
565
    /**
566
     * @return \Spryker\Yves\Router\Router\RouterInterface
567
     */
568
    public function getRouter(): RouterInterface
569
    {
570
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER);
571
    }
572
573
    /**
574
     * @return \Symfony\Component\HttpFoundation\RequestStack
575
     */
576
    public function getRequestStack(): RequestStack
577
    {
578
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK);
579
    }
580
581
    /**
582
     * @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface
583
     */
584
    public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface
585
    {
586
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING);
587
    }
588
589
    /**
590
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface
591
     */
592
    public function getCountryClient(): ComputopToCountryClientInterface
593
    {
594
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY);
595
    }
596
597
    /**
598
     * @return PayPalExpressToQuoteMapper
599
     */
600
    protected function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapper
601
    {
602
        return new PayPalExpressToQuoteMapper();
603
    }
604
}
605