Issues (456)

Zed/Ratepay/Business/Api/Mapper/MapperFactory.php (10 issues)

Labels
Severity
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\Zed\Ratepay\Business\Api\Mapper;
9
10
use Generated\Shared\Transfer\AddressTransfer;
0 ignored issues
show
The type Generated\Shared\Transfer\AddressTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\ItemTransfer;
0 ignored issues
show
The type Generated\Shared\Transfer\ItemTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Generated\Shared\Transfer\OrderTransfer;
0 ignored issues
show
The type Generated\Shared\Transfer\OrderTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Generated\Shared\Transfer\RatepayPaymentInitTransfer;
0 ignored issues
show
The type Generated\Shared\Transfe...epayPaymentInitTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Generated\Shared\Transfer\RatepayPaymentRequestTransfer;
0 ignored issues
show
The type Generated\Shared\Transfe...yPaymentRequestTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use Generated\Shared\Transfer\RatepayRequestTransfer;
0 ignored issues
show
The type Generated\Shared\Transfer\RatepayRequestTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay;
0 ignored issues
show
The type Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Spryker\Shared\Kernel\Transfer\TransferInterface;
19
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
20
use SprykerEco\Zed\Ratepay\RatepayDependencyProvider;
21
22
/**
23
 * @method \SprykerEco\Zed\Ratepay\RatepayConfig getConfig()
24
 */
25
class MapperFactory extends AbstractBusinessFactory implements MapperFactoryInterface
26
{
27
    /**
28
     * @var \Generated\Shared\Transfer\RatepayRequestTransfer
29
     */
30
    protected $requestTransfer;
31
32
    /**
33
     * @param \Generated\Shared\Transfer\RatepayRequestTransfer $requestTransfer
34
     */
35
    public function __construct(RatepayRequestTransfer $requestTransfer)
36
    {
37
        $this->requestTransfer = $requestTransfer;
38
    }
39
40
    /**
41
     * @return \SprykerEco\Zed\Ratepay\Dependency\Facade\RatepayToMoneyInterface
42
     */
43
    protected function getMoneyFacade()
44
    {
45
        return $this->getProvidedDependency(RatepayDependencyProvider::FACADE_MONEY);
46
    }
47
48
    /**
49
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
50
     */
51
    public function createHeadMapper()
52
    {
53
        return new HeadMapper(
54
            $this->getConfig(),
55
            $this->requestTransfer
56
        );
57
    }
58
59
    /**
60
     * @param \Generated\Shared\Transfer\RatepayPaymentInitTransfer $ratepayPaymentInitTransfer
61
     *
62
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
63
     */
64
    public function createPaymentInitHeadMapper(
65
        RatepayPaymentInitTransfer $ratepayPaymentInitTransfer
66
    ) {
67
        return new PaymentInitHeadMapper(
68
            $ratepayPaymentInitTransfer,
69
            $this->getConfig(),
70
            $this->requestTransfer
71
        );
72
    }
73
74
    /**
75
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
76
     * @param \Spryker\Shared\Kernel\Transfer\TransferInterface $paymentData
77
     *
78
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
79
     */
80
    public function createQuoteHeadMapper(
81
        QuoteTransfer $quoteTransfer,
82
        TransferInterface $paymentData
83
    ) {
84
        return new QuoteHeadMapper(
85
            $quoteTransfer,
86
            $paymentData,
87
            $this->getConfig(),
88
            $this->requestTransfer
89
        );
90
    }
91
92
    /**
93
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
94
     * @param \Orm\Zed\Ratepay\Persistence\SpyPaymentRatepay $paymentData
95
     *
96
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
97
     */
98
    public function createOrderHeadMapper(
99
        OrderTransfer $orderTransfer,
100
        SpyPaymentRatepay $paymentData
101
    ) {
102
        return new OrderHeadMapper(
103
            $orderTransfer,
104
            $paymentData,
105
            $this->getConfig(),
106
            $this->requestTransfer
107
        );
108
    }
109
110
    /**
111
     * @param \Generated\Shared\Transfer\AddressTransfer $addressTransfer
112
     * @param string $type
113
     *
114
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
115
     */
116
    public function createAddressMapper(
117
        AddressTransfer $addressTransfer,
118
        $type
119
    ) {
120
        return new AddressMapper(
121
            $addressTransfer,
122
            $type,
123
            $this->requestTransfer
124
        );
125
    }
126
127
    /**
128
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
129
     *
130
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
131
     */
132
    public function createBankAccountMapper(
133
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
134
    ) {
135
        return new BankAccountMapper(
136
            $ratepayPaymentRequestTransfer,
137
            $this->requestTransfer
138
        );
139
    }
140
141
    /**
142
     * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
143
     *
144
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
145
     */
146
    public function createBasketItemMapper(
147
        ItemTransfer $itemTransfer
148
    ) {
149
        return new BasketItemMapper(
150
            $itemTransfer,
151
            $this->requestTransfer,
152
            $this->getMoneyFacade()
153
        );
154
    }
155
156
    /**
157
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
158
     *
159
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
160
     */
161
    public function createBasketMapper(
162
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
163
    ) {
164
        return new BasketMapper(
165
            $ratepayPaymentRequestTransfer,
166
            $this->requestTransfer,
167
            $this->getMoneyFacade()
168
        );
169
    }
170
171
    /**
172
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
173
     * @param \Generated\Shared\Transfer\OrderTransfer $partialOrderTransfer
174
     * @param \Spryker\Shared\Kernel\Transfer\TransferInterface $ratepayPaymentTransfer
175
     * @param bool $needToSendShipping
176
     * @param float|int $discountTaxRate
177
     *
178
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
179
     */
180
    public function createPartialBasketMapper(
181
        OrderTransfer $orderTransfer,
182
        OrderTransfer $partialOrderTransfer,
183
        $ratepayPaymentTransfer,
184
        $needToSendShipping = false,
185
        $discountTaxRate = 0
186
    ) {
187
        return new PartialBasketMapper(
188
            $orderTransfer,
189
            $partialOrderTransfer,
190
            $ratepayPaymentTransfer,
191
            $needToSendShipping,
192
            $discountTaxRate,
193
            $this->requestTransfer,
194
            $this->getMoneyFacade()
195
        );
196
    }
197
198
    /**
199
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
200
     *
201
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
202
     */
203
    public function createCustomerMapper(
204
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
205
    ) {
206
        return new CustomerMapper(
207
            $ratepayPaymentRequestTransfer,
208
            $this->requestTransfer
209
        );
210
    }
211
212
    /**
213
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
214
     *
215
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
216
     */
217
    public function createPaymentMapper(
218
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
219
    ) {
220
        return new PaymentMapper(
221
            $ratepayPaymentRequestTransfer,
222
            $this->requestTransfer,
223
            $this->getMoneyFacade()
224
        );
225
    }
226
227
    /**
228
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
229
     * @param \Generated\Shared\Transfer\RatepayPaymentElvTransfer|\Generated\Shared\Transfer\RatepayPaymentInstallmentTransfer $ratepayPaymentTransfer
0 ignored issues
show
The type Generated\Shared\Transfe...tepayPaymentElvTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The type Generated\Shared\Transfe...mentInstallmentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
230
     *
231
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
232
     */
233
    public function createInstallmentCalculationMapper(
234
        QuoteTransfer $quoteTransfer,
235
        $ratepayPaymentTransfer
236
    ) {
237
        return new InstallmentCalculationMapper(
238
            $quoteTransfer,
239
            $ratepayPaymentTransfer,
240
            $this->requestTransfer,
241
            $this->getMoneyFacade()
242
        );
243
    }
244
245
    /**
246
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
247
     *
248
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
249
     */
250
    public function createInstallmentDetailMapper(
251
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
252
    ) {
253
        return new InstallmentDetailMapper(
254
            $ratepayPaymentRequestTransfer,
255
            $this->requestTransfer,
256
            $this->getMoneyFacade()
257
        );
258
    }
259
260
    /**
261
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
262
     *
263
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Mapper\MapperInterface
264
     */
265
    public function createInstallmentPaymentMapper(
266
        RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
267
    ) {
268
        return new InstallmentPaymentMapper(
269
            $ratepayPaymentRequestTransfer,
270
            $this->requestTransfer,
271
            $this->getMoneyFacade()
272
        );
273
    }
274
}
275