Passed
Push — feature/eco-3656/eco-3658-enab... ( 522204...dfb610 )
by
unknown
04:02
created

ComputopFactory::getShipmentClient()   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 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\ComputopToStoreInterface;
31
use SprykerEco\Yves\Computop\Dependency\Plugin\PayPalExpressInitPluginInterface;
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\ComputopPayPalExpressCompleteAggregator;
54
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface;
55
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregator;
56
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface;
57
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregator;
58
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface;
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\Handler\ComputopPrePostPaymentHandlerInterface
266
     */
267
    public function createCreditCardPaymentHandler(): ComputopPrePostPaymentHandlerInterface
268
    {
269
        return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient());
270
    }
271
272
    /**
273
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
274
     */
275
    public function createPayNowPaymentHandler(): ComputopPrePostPaymentHandlerInterface
276
    {
277
        return new ComputopPayNowPaymentHandler($this->createInitPayNowConverter(), $this->getComputopClient());
278
    }
279
280
    /**
281
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
282
     */
283
    public function createPayPalPaymentHandler(): ComputopPrePostPaymentHandlerInterface
284
    {
285
        return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient());
286
    }
287
288
    /**
289
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface
290
     */
291
    public function createComputopPayPalExpressInitAggregator(): ComputopPayPalExpressInitAggregatorInterface
292
    {
293
        return new ComputopPayPalExpressInitAggregator(
294
            $this->createComputopPaymentHandler(),
295
            $this->createInitPayPalExpressConverter(),
296
            $this->getQuoteClient(),
297
            $this->getComputopClient(),
298
            $this->createPayPalExpressToQuoteMapper(),
299
            $this->getPayPalExpressInitAggregatorPluginsStack()
300
        );
301
    }
302
303
    /**
304
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface
305
     */
306
    public function createComputopPayPalExpressPrepareAggregator(): ComputopPayPalExpressPrepareAggregatorInterface
307
    {
308
        return new ComputopPayPalExpressPrepareAggregator(
309
            $this->getQuoteClient(),
310
            $this->createPayPalExpressFormDataProvider(),
311
            $this->getComputopApiClient(),
312
            $this->getComputopApiService(),
313
            $this->getComputopConfig()
314
        );
315
    }
316
317
    /**
318
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface
319
     */
320
    public function createComputopPayPalExpressCompleteAggregator(): ComputopPayPalExpressCompleteAggregatorInterface
321
    {
322
        return new ComputopPayPalExpressCompleteAggregator(
323
            $this->getComputopApiClient(),
324
            $this->getComputopClient()
325
        );
326
    }
327
328
    /**
329
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
330
     */
331
    public function createDirectDebitPaymentHandler(): ComputopPrePostPaymentHandlerInterface
332
    {
333
        return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient());
334
    }
335
336
    /**
337
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
338
     */
339
    public function createEasyCreditPaymentHandler(): ComputopPrePostPaymentHandlerInterface
340
    {
341
        return new ComputopEasyCreditPaymentHandler(
342
            $this->createInitEasyCreditConverter(),
343
            $this->getComputopClient(),
344
            $this->getCalculationClient()
345
        );
346
    }
347
348
    /**
349
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
350
     */
351
    public function createPaydirektPaymentHandler(): ComputopPrePostPaymentHandlerInterface
352
    {
353
        return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient());
354
    }
355
356
    /**
357
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
358
     */
359
    public function createSofortPaymentHandler(): ComputopPrePostPaymentHandlerInterface
360
    {
361
        return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient());
362
    }
363
364
    /**
365
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
366
     */
367
    public function createIdealPaymentHandler(): ComputopPrePostPaymentHandlerInterface
368
    {
369
        return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient());
370
    }
371
372
    /**
373
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
374
     */
375
    public function createInitCreditCardConverter(): ConverterInterface
376
    {
377
        return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig());
378
    }
379
380
    /**
381
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
382
     */
383
    public function createInitPayNowConverter(): ConverterInterface
384
    {
385
        return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig());
386
    }
387
388
    /**
389
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
390
     */
391
    public function createInitPayPalConverter(): ConverterInterface
392
    {
393
        return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig());
394
    }
395
396
    /**
397
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
398
     */
399
    public function createInitPayPalExpressConverter(): ConverterInterface
400
    {
401
        return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig());
402
    }
403
404
    /**
405
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
406
     */
407
    public function createInitDirectDebitConverter(): ConverterInterface
408
    {
409
        return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig());
410
    }
411
412
    /**
413
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
414
     */
415
    public function createInitEasyCreditConverter(): ConverterInterface
416
    {
417
        return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig());
418
    }
419
420
    /**
421
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
422
     */
423
    public function createInitPaydirektConverter(): ConverterInterface
424
    {
425
        return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig());
426
    }
427
428
    /**
429
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
430
     */
431
    public function createInitSofortConverter(): ConverterInterface
432
    {
433
        return new InitSofortConverter($this->getComputopApiService(), $this->getConfig());
434
    }
435
436
    /**
437
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
438
     */
439
    public function createInitIdealConverter(): ConverterInterface
440
    {
441
        return new InitIdealConverter($this->getComputopApiService(), $this->getConfig());
442
    }
443
444
    /**
445
     * @return \SprykerEco\Client\Computop\ComputopClientInterface
446
     */
447
    public function getComputopClient(): ComputopClientInterface
448
    {
449
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP);
450
    }
451
452
    /**
453
     * @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface
454
     */
455
    public function getStore(): ComputopToStoreInterface
456
    {
457
        return $this->getProvidedDependency(ComputopDependencyProvider::STORE);
458
    }
459
460
    /**
461
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface
462
     */
463
    public function getCalculationClient(): ComputopToCalculationClientInterface
464
    {
465
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION);
466
    }
467
468
    /**
469
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface
470
     */
471
    public function getComputopApiClient(): ComputopToComputopApiClientInterface
472
    {
473
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP_API);
474
    }
475
476
    /**
477
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
478
     */
479
    public function createOrderCreditCardMapper(): MapperInterface
480
    {
481
        return new CreditCardMapper(
482
            $this->getComputopApiService(),
483
            $this->getRouter(),
484
            $this->getStore(),
485
            $this->getConfig(),
486
            $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

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

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

518
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
519
            $this->getUtilEncodingService(),
520
            $this->getCountryClient()
521
        );
522
    }
523
524
    /**
525
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
526
     */
527
    public function createPayPalExpressMapper(): MapperInterface
528
    {
529
        return new PayPalExpressMapper(
530
            $this->getComputopApiService(),
531
            $this->getRouter(),
532
            $this->getStore(),
533
            $this->getConfig(),
534
            $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

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

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

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

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

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

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