| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | final class AssistedWebContextParam implements ParamInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * $GLOBALS for testing |
||
| 22 | * |
||
| 23 | * @var SuperGlobalsMap |
||
|
|
|||
| 24 | */ |
||
| 25 | private static array $globals = []; |
||
| 26 | |||
| 27 | public function __construct( |
||
| 28 | private readonly AbstractWebContextParam $webContextParam, |
||
| 29 | 5 | private readonly ParamInterface $defaultParam, |
|
| 30 | ) { |
||
| 31 | 5 | } |
|
| 32 | 5 | ||
| 33 | 5 | /** |
|
| 34 | * {@inheritDoc} |
||
| 35 | */ |
||
| 36 | #[Override] |
||
| 37 | public function __invoke(string $varName, array $query, InjectorInterface $injector) |
||
| 38 | 4 | { |
|
| 39 | $superGlobals = static::$globals ?: $GLOBALS; |
||
| 40 | 4 | /** @var SuperGlobalsMap $superGlobals */ |
|
| 41 | 4 | $webContextParam = $this->webContextParam; |
|
| 42 | 4 | assert(is_string($webContextParam::GLOBAL_KEY)); |
|
| 43 | /** @psalm-suppress MixedArrayOffset */ |
||
| 44 | 4 | $phpWebContext = $superGlobals[$webContextParam::GLOBAL_KEY]; |
|
| 45 | 2 | ||
| 46 | return $phpWebContext[$this->webContextParam->key] ?? ($this->defaultParam)($varName, $query, $injector); |
||
| 47 | } |
||
| 48 | 2 | ||
| 49 | /** @param SuperGlobalsMap $globals */ |
||
| 50 | public static function setSuperGlobalsOnlyForTestingPurpose(array $globals): void |
||
| 53 | 5 | } |
|
| 54 | } |
||
| 55 |
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