bearsunday /
BEAR.Package
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace BEAR\Package\Module; |
||
| 6 | |||
| 7 | use BEAR\AppMeta\Meta; |
||
| 8 | use BEAR\Package\Module\Import\ImportApp; |
||
| 9 | use BEAR\Resource\Annotation\ImportAppConfig; |
||
| 10 | use BEAR\Resource\Module\SchemeCollectionProvider; |
||
|
0 ignored issues
–
show
|
|||
| 11 | use BEAR\Resource\SchemeCollectionInterface; |
||
| 12 | use Override; |
||
| 13 | use Ray\Di\AbstractModule; |
||
| 14 | use Ray\Di\Exception\NotFound; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Provides SchemeCollectionInterface and derived bindings |
||
| 18 | * |
||
| 19 | * The following bindings are provided: |
||
| 20 | * |
||
| 21 | * SchemeCollectionInterface |
||
| 22 | * SchemeCollectionInterface:original |
||
| 23 | * :ImportAppConfig |
||
| 24 | */ |
||
| 25 | final class ImportAppModule extends AbstractModule |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * Import scheme config |
||
| 29 | * |
||
| 30 | * @var array<ImportApp> |
||
| 31 | */ |
||
| 32 | private array $importApps = []; |
||
| 33 | |||
| 34 | /** @param array<ImportApp> $importApps */ |
||
| 35 | public function __construct(array $importApps) |
||
| 36 | { |
||
| 37 | foreach ($importApps as $importApp) { |
||
| 38 | // create import config |
||
| 39 | $this->importApps[] = $importApp; |
||
| 40 | } |
||
| 41 | |||
| 42 | parent::__construct(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritDoc} |
||
| 47 | * |
||
| 48 | * @throws NotFound |
||
| 49 | */ |
||
| 50 | #[Override] |
||
| 51 | protected function configure(): void |
||
| 52 | { |
||
| 53 | $this->bind()->annotatedWith(ImportAppConfig::class)->toInstance($this->importApps); |
||
| 54 | $this->bind(SchemeCollectionInterface::class)->annotatedWith('original')->toProvider(SchemeCollectionProvider::class); |
||
| 55 | $this->bind(SchemeCollectionInterface::class)->toProvider(ImportSchemeCollectionProvider::class); |
||
| 56 | foreach ($this->importApps as $app) { |
||
| 57 | $meta = new Meta($app->appName, $app->context, $app->appDir); |
||
| 58 | $this->install(new ResourceObjectModule($meta->getResourceListGenerator())); |
||
| 59 | } |
||
| 60 | } |
||
| 61 | } |
||
| 62 |
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