1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace BEAR\Resource; |
||
6 | |||
7 | use BEAR\Resource\Annotation\ContextScheme; |
||
8 | |||
9 | use function array_key_exists; |
||
10 | use function parse_url; |
||
11 | |||
12 | /** @psalm-import-type Query from Types */ |
||
13 | final class UriFactory |
||
14 | { |
||
15 | public function __construct( |
||
16 | #[ContextScheme] |
||
17 | private readonly string $schemaHost = 'page://self', |
||
18 | ) { |
||
19 | } |
||
20 | |||
21 | /** @param Query $query */ |
||
0 ignored issues
–
show
|
|||
22 | public function __invoke(string $uri, array $query = []): Uri |
||
23 | { |
||
24 | $parsedUrl = (array) parse_url($uri); |
||
25 | if (! array_key_exists('scheme', $parsedUrl)) { |
||
26 | $uri = $this->schemaHost . $uri; |
||
27 | } |
||
28 | |||
29 | return new Uri($uri, $query); |
||
30 | } |
||
31 | } |
||
32 |
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