bearsunday /
BEAR.Resource
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace BEAR\Resource; |
||
| 6 | |||
| 7 | use BEAR\Resource\Exception\UriException; |
||
| 8 | use Override; |
||
| 9 | use Ray\Di\Di\Inject; |
||
| 10 | |||
| 11 | use function is_string; |
||
| 12 | |||
| 13 | final class Factory implements FactoryInterface |
||
| 14 | { |
||
| 15 | public function __construct( |
||
| 16 | private SchemeCollectionInterface $scheme, |
||
| 17 | private readonly UriFactory $uri, |
||
|
0 ignored issues
–
show
|
|||
| 18 | ) { |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Set scheme collection |
||
| 23 | * |
||
| 24 | * @codeCoverageIgnore |
||
| 25 | */ |
||
| 26 | #[Inject(optional: true)] |
||
| 27 | public function setSchemeCollection(SchemeCollectionInterface $scheme): void |
||
| 28 | { |
||
| 29 | $this->scheme = $scheme; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritDoc} |
||
| 34 | * |
||
| 35 | * @throws UriException |
||
| 36 | */ |
||
| 37 | #[Override] |
||
| 38 | public function newInstance($uri): ResourceObject |
||
| 39 | { |
||
| 40 | if (is_string($uri)) { |
||
| 41 | $uri = ($this->uri)($uri); |
||
| 42 | } |
||
| 43 | |||
| 44 | $ro = $this->scheme->getAdapter($uri)->get($uri); |
||
| 45 | $ro->uri = $uri; |
||
| 46 | |||
| 47 | return $ro; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
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