|
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\BraintreeToQuoteClientInterface; |
|
14
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
15
|
|
|
|
|
16
|
|
|
class QuoteExpander implements QuoteExpanderInterface |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* @var \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToQuoteClientInterface |
|
20
|
|
|
*/ |
|
21
|
|
|
public $quoteClient; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @var \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToCalculationClientInterface |
|
25
|
|
|
*/ |
|
26
|
|
|
public $calculationClient; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var \Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface |
|
30
|
|
|
*/ |
|
31
|
|
|
public $shipmentHandlerPlugin; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToQuoteClientInterface $quoteClient |
|
35
|
|
|
* @param \SprykerEco\Yves\Braintree\Dependency\Client\BraintreeToCalculationClientInterface $calculationClient |
|
36
|
|
|
* @param \Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface $shipmentHandlerPlugin |
|
37
|
|
|
*/ |
|
38
|
|
|
public function __construct( |
|
39
|
|
|
BraintreeToQuoteClientInterface $quoteClient, |
|
40
|
|
|
BraintreeToCalculationClientInterface $calculationClient, |
|
41
|
|
|
StepHandlerPluginInterface $shipmentHandlerPlugin |
|
42
|
|
|
) { |
|
43
|
|
|
$this->quoteClient = $quoteClient; |
|
44
|
|
|
$this->calculationClient = $calculationClient; |
|
45
|
|
|
$this->shipmentHandlerPlugin = $shipmentHandlerPlugin; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param \Symfony\Component\HttpFoundation\Request $request |
|
50
|
|
|
* @param int $idShipmentMethod |
|
51
|
|
|
* |
|
52
|
|
|
* @return \Generated\Shared\Transfer\QuoteTransfer |
|
53
|
|
|
*/ |
|
54
|
|
|
public function expandQuoteWithShipmentMethod(Request $request, int $idShipmentMethod): QuoteTransfer |
|
55
|
|
|
{ |
|
56
|
|
|
$quoteClient = $this->quoteClient; |
|
57
|
|
|
|
|
58
|
|
|
$quoteTransfer = $quoteClient->getQuote(); |
|
59
|
|
|
$quoteTransfer->getShipment()->setShipmentSelection($idShipmentMethod); |
|
60
|
|
|
$quoteTransfer = $this->shipmentHandlerPlugin->addToDataClass($request, $quoteTransfer); |
|
61
|
|
|
$quoteTransfer = $this->calculationClient->recalculate($quoteTransfer); |
|
62
|
|
|
|
|
63
|
|
|
$quoteClient->setQuote($quoteTransfer); |
|
64
|
|
|
|
|
65
|
|
|
return $quoteTransfer; |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
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