Passed
Push — feature/eco-3656/eco-3658-enab... ( a994d4...5e2bf3 )
by
unknown
06:08 queued 21s
created

ComputopFactory::getCheckoutClient()   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
c 0
b 0
f 0
dl 0
loc 3
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->createComputopPaymentHandler(),
303
            $this->createInitPayPalExpressConverter(),
304
            $this->getQuoteClient(),
305
            $this->getComputopClient(),
306
            $this->getShipmentClient(),
307
            $this->createPayPalExpressToQuoteMapper()
308
        );
309
    }
310
311
    /**
312
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareHandlerInterface
313
     */
314
    public function createComputopPayPalExpressPrepareHandler(): ComputopPayPalExpressPrepareHandlerInterface
315
    {
316
        return new ComputopPayPalExpressPrepareHandler(
317
            $this->getQuoteClient(),
318
            $this->createPayPalExpressFormDataProvider(),
319
            $this->getComputopApiClient(),
320
            $this->getComputopApiService(),
321
            $this->getComputopConfig()
322
        );
323
    }
324
325
    /**
326
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteHandlerInterface
327
     */
328
    public function createComputopPayPalExpressCompleteHandler(): ComputopPayPalExpressCompleteHandlerInterface
329
    {
330
        return new ComputopPayPalExpressCompleteHandler(
331
            $this->getComputopApiClient(),
332
            $this->getComputopClient()
333
        );
334
    }
335
336
    /**
337
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
338
     */
339
    public function createDirectDebitPaymentHandler(): ComputopPrePostPaymentHandlerInterface
340
    {
341
        return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient());
342
    }
343
344
    /**
345
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
346
     */
347
    public function createEasyCreditPaymentHandler(): ComputopPrePostPaymentHandlerInterface
348
    {
349
        return new ComputopEasyCreditPaymentHandler(
350
            $this->createInitEasyCreditConverter(),
351
            $this->getComputopClient(),
352
            $this->getCalculationClient()
353
        );
354
    }
355
356
    /**
357
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
358
     */
359
    public function createPaydirektPaymentHandler(): ComputopPrePostPaymentHandlerInterface
360
    {
361
        return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient());
362
    }
363
364
    /**
365
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
366
     */
367
    public function createSofortPaymentHandler(): ComputopPrePostPaymentHandlerInterface
368
    {
369
        return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient());
370
    }
371
372
    /**
373
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
374
     */
375
    public function createIdealPaymentHandler(): ComputopPrePostPaymentHandlerInterface
376
    {
377
        return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient());
378
    }
379
380
    /**
381
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
382
     */
383
    public function createInitCreditCardConverter(): ConverterInterface
384
    {
385
        return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig());
386
    }
387
388
    /**
389
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
390
     */
391
    public function createInitPayNowConverter(): ConverterInterface
392
    {
393
        return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig());
394
    }
395
396
    /**
397
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
398
     */
399
    public function createInitPayPalConverter(): ConverterInterface
400
    {
401
        return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig());
402
    }
403
404
    /**
405
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
406
     */
407
    public function createInitPayPalExpressConverter(): ConverterInterface
408
    {
409
        return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig());
410
    }
411
412
    /**
413
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
414
     */
415
    public function createInitDirectDebitConverter(): ConverterInterface
416
    {
417
        return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig());
418
    }
419
420
    /**
421
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
422
     */
423
    public function createInitEasyCreditConverter(): ConverterInterface
424
    {
425
        return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig());
426
    }
427
428
    /**
429
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
430
     */
431
    public function createInitPaydirektConverter(): ConverterInterface
432
    {
433
        return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig());
434
    }
435
436
    /**
437
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
438
     */
439
    public function createInitSofortConverter(): ConverterInterface
440
    {
441
        return new InitSofortConverter($this->getComputopApiService(), $this->getConfig());
442
    }
443
444
    /**
445
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
446
     */
447
    public function createInitIdealConverter(): ConverterInterface
448
    {
449
        return new InitIdealConverter($this->getComputopApiService(), $this->getConfig());
450
    }
451
452
    /**
453
     * @return \SprykerEco\Client\Computop\ComputopClientInterface
454
     */
455
    public function getComputopClient(): ComputopClientInterface
456
    {
457
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP);
458
    }
459
460
    /**
461
     * @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface
462
     */
463
    public function getStore(): ComputopToStoreInterface
464
    {
465
        return $this->getProvidedDependency(ComputopDependencyProvider::STORE);
466
    }
467
468
    /**
469
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface
470
     */
471
    public function getCalculationClient(): ComputopToCalculationClientInterface
472
    {
473
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION);
474
    }
475
476
    /**
477
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface
478
     */
479
    public function getComputopApiClient(): ComputopToComputopApiClientInterface
480
    {
481
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP_API);
482
    }
483
484
    /**
485
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
486
     */
487
    public function createOrderCreditCardMapper(): MapperInterface
488
    {
489
        return new CreditCardMapper(
490
            $this->getComputopApiService(),
491
            $this->getRouter(),
492
            $this->getStore(),
493
            $this->getConfig(),
494
            $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

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

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

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

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

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

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

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

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

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