Issues (141)

src/Module/ImportAppModule.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Module;
6
7
use BEAR\Resource\Annotation\ImportAppConfig;
8
use BEAR\Resource\ImportApp;
9
use BEAR\Resource\SchemeCollectionInterface;
10
use Override;
11
use Ray\Di\AbstractModule;
12
use Ray\Di\Exception\NotFound;
13
14
final class ImportAppModule extends AbstractModule
15
{
16
    /**
17
     * Import scheme config
18
     *
19
     * @var array<ImportApp>
20
     */
21
    private array $importAppConfig = [];
22
23
    /** @param array<ImportApp> $importApps */
24
    public function __construct(array $importApps, string $defaultContextName = '')
25
    {
26
        foreach ($importApps as $importApp) {
27
            // create import config
28
            $this->importAppConfig[] = $importApp;
29
        }
30
31
        unset($defaultContextName);
32
33
        parent::__construct();
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     *
39
     * @throws NotFound
40
     */
41
    #[Override]
42
    protected function configure(): void
43
    {
44
        $this->bind()->annotatedWith(ImportAppConfig::class)->toInstance($this->importAppConfig);
45
        $this->bind(SchemeCollectionInterface::class)->toProvider(ImportSchemeCollectionProvider::class);
0 ignored issues
show
The type BEAR\Resource\Module\Imp...chemeCollectionProvider was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
46
    }
47
}
48