| Total Complexity | 8 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | class Config extends \Shopware_Components_Config |
||
|
|
|||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | private $customConfig; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | private $defaultShopId; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param array $config |
||
| 19 | * @param int $defaultShopId |
||
| 20 | * @throws \Zend_Cache_Exception |
||
| 21 | */ |
||
| 22 | public function __construct(array $config, int $defaultShopId) |
||
| 23 | { |
||
| 24 | parent::__construct($config); |
||
| 25 | $this->customConfig = $config['custom']['config'] ?? []; |
||
| 26 | |||
| 27 | // support for Shopware()->Config()->getByNamespace('<pluginName>', '<configName>') |
||
| 28 | if (isset($config['custom']['plugins'])) { |
||
| 29 | foreach ($config['custom']['plugins'] as $shopId => $pluginConfigs) { |
||
| 30 | foreach ($pluginConfigs as $pluginName => $pluginConfigValues) { |
||
| 31 | foreach ($pluginConfigValues as $pluginConfigName => $pluginConfigValue) { |
||
| 32 | $pluginConfigKey = $pluginName . '::' . $pluginConfigName; |
||
| 33 | $this->customConfig[(int) $shopId][$pluginConfigKey] = $pluginConfigValue; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | $this->defaultShopId = $defaultShopId; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $name |
||
| 44 | * @return mixed |
||
| 45 | */ |
||
| 46 | public function offsetGet($name) |
||
| 47 | { |
||
| 48 | return $this->customConfig[$this->getShopId()][$name] ?? parent::offsetGet($name); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return int |
||
| 53 | */ |
||
| 54 | private function getShopId(): int |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
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