1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\AkeneoPimMiddlewareConnector\Business\Translator\Dictionary; |
9
|
|
|
|
10
|
|
|
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig; |
11
|
|
|
use SprykerMiddleware\Zed\Process\Business\Translator\Dictionary\AbstractDictionary; |
|
|
|
|
12
|
|
|
|
13
|
|
|
class AttributeMapDictionary extends AbstractDictionary |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var array |
17
|
|
|
*/ |
18
|
|
|
protected static $localeMap; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var array |
22
|
|
|
*/ |
23
|
|
|
protected static $superAttributeMap; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig |
27
|
|
|
*/ |
28
|
|
|
private $config; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig $config |
32
|
|
|
*/ |
33
|
|
|
public function __construct(AkeneoPimMiddlewareConnectorConfig $config) |
34
|
|
|
{ |
35
|
|
|
$this->config = $config; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return array |
40
|
|
|
*/ |
41
|
|
|
public function getDictionary(): array |
42
|
|
|
{ |
43
|
|
|
return [ |
44
|
|
|
'is_super' => [ |
45
|
|
|
[ |
46
|
|
|
'MarkAsSuperAttribute', |
47
|
|
|
'options' => [ |
48
|
|
|
'map' => $this->getSuperAttributeMap(), |
49
|
|
|
], |
50
|
|
|
], |
51
|
|
|
], |
52
|
|
|
'options' => [ |
53
|
|
|
[ |
54
|
|
|
'AddAttributeOptions', |
55
|
|
|
'options' => [ |
56
|
|
|
'pageSize' => 100, |
57
|
|
|
], |
58
|
|
|
], |
59
|
|
|
], |
60
|
|
|
'labels' => [ |
61
|
|
|
[ |
62
|
|
|
'LabelsToLocalizedAttributeNames', |
63
|
|
|
'options' => [ |
64
|
|
|
'key' => 'key_translation', |
65
|
|
|
], |
66
|
|
|
], |
67
|
|
|
'AddAttributeValues', |
68
|
|
|
[ |
69
|
|
|
'LocaleKeysToIds', |
70
|
|
|
'options' => [ |
71
|
|
|
'map' => $this->getLocaleMap(), |
72
|
|
|
], |
73
|
|
|
], |
74
|
|
|
], |
75
|
|
|
'labels.*.key_translation' => [ |
76
|
|
|
'AttributeEmptyTranslationToKey', |
77
|
|
|
], |
78
|
|
|
]; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return array |
83
|
|
|
*/ |
84
|
|
|
protected function getLocaleMap(): array |
85
|
|
|
{ |
86
|
|
|
if (static::$localeMap === null) { |
|
|
|
|
87
|
|
|
$content = file_get_contents($this->config->getLocaleMapFilePath()); |
88
|
|
|
static::$localeMap = json_decode($content, true); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
return static::$localeMap; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return array |
96
|
|
|
*/ |
97
|
|
|
protected function getSuperAttributeMap(): array |
98
|
|
|
{ |
99
|
|
|
if (static::$superAttributeMap === null) { |
|
|
|
|
100
|
|
|
$content = file_get_contents($this->config->getSuperAttributeMapFilePath()); |
101
|
|
|
static::$superAttributeMap = json_decode($content, true); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
return static::$superAttributeMap; |
105
|
|
|
} |
106
|
|
|
} |
107
|
|
|
|
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