Issues (56)

src/NamedExtendedPdoProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Aura\Sql\ExtendedPdo;
8
use Override;
0 ignored issues
show
The type Override 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...
9
use Ray\Di\InjectorInterface;
10
use Ray\Di\ProviderInterface;
11
use Ray\Di\SetContextInterface;
12
13
/** @implements ProviderInterface<ExtendedPdo> */
14
15
final class NamedExtendedPdoProvider implements ProviderInterface, SetContextInterface
16
{
17
    private string $context;
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    #[Override]
23
    public function setContext($context)
24
    {
25
        $this->context = $context;
26
    }
27
28
    public function __construct(private readonly InjectorInterface $injector)
29
    {
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    #[Override]
36
    public function get(): ExtendedPdo
37
    {
38
        $connection = $this->injector->getInstance(EnvConnection::class, $this->context);
39
40
        return ($connection)();
41
    }
42
}
43