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\FactFinderSdk\Business\Expander; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\CurrencyTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\LocaleTransfer; |
|
|
|
|
12
|
|
|
use Generated\Shared\Transfer\StoreTransfer; |
|
|
|
|
13
|
|
|
use SprykerEco\Shared\FactFinderSdk\FactFinderSdkConstants; |
14
|
|
|
|
15
|
|
|
class FactFinderSdkUrlExpander extends FactFinderSdkAbstractExpander |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @param \Generated\Shared\Transfer\LocaleTransfer $localeTransfer |
19
|
|
|
* @param \Generated\Shared\Transfer\CurrencyTransfer $currencyTransfer |
20
|
|
|
* @param \Generated\Shared\Transfer\StoreTransfer $storeTransfer |
21
|
|
|
* @param array $productData |
22
|
|
|
* |
23
|
|
|
* @return array |
24
|
|
|
*/ |
25
|
|
|
public function expand(LocaleTransfer $localeTransfer, CurrencyTransfer $currencyTransfer, StoreTransfer $storeTransfer, $productData) |
26
|
|
|
{ |
27
|
|
|
$productUrl = 'http://' . $this->config |
28
|
|
|
->getYvesHost() . $productData[FactFinderSdkConstants::ITEM_PRODUCT_URL]; |
29
|
|
|
$concreteAttributes = json_decode($productData[FactFinderSdkConstants::ITEM_CONCRETE_PRODUCT_ATTRIBUTES], true); |
30
|
|
|
|
31
|
|
|
$productUrl = $this->addAttributes($productUrl, $concreteAttributes); |
32
|
|
|
$productData[FactFinderSdkConstants::ITEM_PRODUCT_URL] = $productUrl; |
33
|
|
|
|
34
|
|
|
return $productData; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @param string $productUrl |
39
|
|
|
* @param array $concreteAttributes |
40
|
|
|
* |
41
|
|
|
* @return string |
42
|
|
|
*/ |
43
|
|
|
protected function addAttributes($productUrl, $concreteAttributes) |
44
|
|
|
{ |
45
|
|
|
if (empty($concreteAttributes)) { |
46
|
|
|
return $productUrl; |
47
|
|
|
} |
48
|
|
|
$productUrl .= '?'; |
49
|
|
|
|
50
|
|
|
foreach ($concreteAttributes as $attribute => $value) { |
51
|
|
|
$value = urlencode($value); |
52
|
|
|
$productUrl .= "attribute[$attribute]=$value&"; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
return $productUrl; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|
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