AuraSqlEnvModule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A configure() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Override;
8
use Ray\Di\AbstractModule;
9
10
final class AuraSqlEnvModule extends AbstractModule
11
{
12
    /**
13
     * @param string        $dsn      Env key for Data Source Name (DSN)
14
     * @param string        $username Env key for Username for the DSN string
15
     * @param string        $password Env key for Password for the DSN string
16
     * @param string        $slave    Env key for Comma separated slave host list
17
     * @param array<string> $options  A key=>value array of driver-specific connection options
18
     * @param array<string> $queries  Queries to execute after the connection.
19
     */
20
    public function __construct(
21
        private readonly string $dsn,
22
        private readonly string $username = '',
23
        private readonly string $password = '',
24
        private readonly string $slave = '',
25
        private readonly array $options = [],
26
        private readonly array $queries = []
27
    ) {
28
        parent::__construct();
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    #[Override]
35
    protected function configure(): void
36
    {
37
        $this->install(new NamedPdoEnvModule('', $this->dsn, $this->username, $this->password, $this->slave, $this->options, $this->queries));
0 ignored issues
show
Bug introduced by
The type Ray\AuraSqlModule\NamedPdoEnvModule 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...
38
        $this->install(new AuraSqlBaseModule($this->dsn));
39
    }
40
}
41