1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Yves\Braintree\Model\QuoteExpander; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
11
|
|
|
use Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface; |
12
|
|
|
use SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToCalculationClientInterface; |
13
|
|
|
use SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToPriceClientInterface; |
14
|
|
|
use SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToQuoteClientInterface; |
15
|
|
|
use Symfony\Component\HttpFoundation\Request; |
16
|
|
|
|
17
|
|
|
class QuoteExpander implements QuoteExpanderInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToQuoteClientInterface |
21
|
|
|
*/ |
22
|
|
|
public $quoteClient; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToCalculationClientInterface |
26
|
|
|
*/ |
27
|
|
|
public $calculationClient; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var StepHandlerPluginInterface |
31
|
|
|
*/ |
32
|
|
|
public $shipmentHandlerPlugin; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToQuoteClientInterface $quoteClient |
36
|
|
|
* @param \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToCalculationClientInterface $calculationClient |
37
|
|
|
* @param StepHandlerPluginInterface $shipmentHandlerPlugin |
38
|
|
|
*/ |
39
|
|
|
public function __construct( |
40
|
|
|
BraintreeToQuoteClientInterface $quoteClient, |
41
|
|
|
BraintreeToCalculationClientInterface $calculationClient, |
42
|
|
|
StepHandlerPluginInterface $shipmentHandlerPlugin |
43
|
|
|
) { |
44
|
|
|
$this->quoteClient = $quoteClient; |
45
|
|
|
$this->calculationClient = $calculationClient; |
46
|
|
|
$this->shipmentHandlerPlugin = $shipmentHandlerPlugin; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param Request $request |
51
|
|
|
* @param int $idShipmentMethod |
52
|
|
|
* |
53
|
|
|
* @return \Generated\Shared\Transfer\QuoteTransfer |
54
|
|
|
*/ |
55
|
|
|
public function expandQuoteWithShipmentMethod(Request $request, int $idShipmentMethod): QuoteTransfer |
56
|
|
|
{ |
57
|
|
|
$quoteClient = $this->quoteClient; |
58
|
|
|
|
59
|
|
|
$quoteTransfer = $quoteClient->getQuote(); |
60
|
|
|
$quoteTransfer->getShipment()->setShipmentSelection($idShipmentMethod); |
61
|
|
|
$quoteTransfer = $this->shipmentHandlerPlugin->addToDataClass($request, $quoteTransfer); |
62
|
|
|
$quoteTransfer = $this->calculationClient->recalculate($quoteTransfer); |
63
|
|
|
|
64
|
|
|
$quoteClient->setQuote($quoteTransfer); |
65
|
|
|
|
66
|
|
|
return $quoteTransfer; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths