Passed
Push — feature/eco-3656/eco-3658-enab... ( 066b3e...da021b )
by
unknown
14:41 queued 07:00
created

createComputopPayPalExpressPrepareHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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

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

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

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

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

557
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
558
            $this->getUtilEncodingService(),
559
            $this->getCountryClient()
560
        );
561
    }
562
563
    /**
564
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
565
     */
566
    public function createOrderSofortMapper(): MapperInterface
567
    {
568
        return new SofortMapper(
569
            $this->getComputopApiService(),
570
            $this->getRouter(),
571
            $this->getStore(),
572
            $this->getConfig(),
573
            $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

573
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
574
            $this->getUtilEncodingService(),
575
            $this->getCountryClient()
576
        );
577
    }
578
579
    /**
580
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
581
     */
582
    public function createOrderPaydirektMapper(): MapperInterface
583
    {
584
        return new PaydirektMapper(
585
            $this->getComputopApiService(),
586
            $this->getRouter(),
587
            $this->getStore(),
588
            $this->getConfig(),
589
            $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

589
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
590
            $this->getUtilEncodingService(),
591
            $this->getCountryClient()
592
        );
593
    }
594
595
    /**
596
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
597
     */
598
    public function createOrderIdealMapper(): MapperInterface
599
    {
600
        return new IdealMapper(
601
            $this->getComputopApiService(),
602
            $this->getRouter(),
603
            $this->getStore(),
604
            $this->getConfig(),
605
            $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

605
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
606
            $this->getUtilEncodingService(),
607
            $this->getCountryClient()
608
        );
609
    }
610
611
    /**
612
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
613
     */
614
    public function createOrderEasyCreditMapper(): MapperInterface
615
    {
616
        return new EasyCreditMapper(
617
            $this->getComputopApiService(),
618
            $this->getRouter(),
619
            $this->getStore(),
620
            $this->getConfig(),
621
            $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

621
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
622
            $this->getUtilEncodingService(),
623
            $this->getCountryClient()
624
        );
625
    }
626
627
    /**
628
     * @return \Spryker\Yves\Router\Router\RouterInterface
629
     */
630
    public function getRouter(): RouterInterface
631
    {
632
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER);
633
    }
634
635
    /**
636
     * @return \Symfony\Component\HttpFoundation\RequestStack
637
     */
638
    public function getRequestStack(): RequestStack
639
    {
640
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK);
641
    }
642
643
    /**
644
     * @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface
645
     */
646
    public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface
647
    {
648
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING);
649
    }
650
651
    /**
652
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface
653
     */
654
    public function getCountryClient(): ComputopToCountryClientInterface
655
    {
656
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY);
657
    }
658
659
    /**
660
     * @return \SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface
661
     */
662
    protected function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapperInterface
663
    {
664
        return new PayPalExpressToQuoteMapper();
665
    }
666
}
667