AuraSqlQueryModule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 25
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A configure() 0 8 1
1
<?php
2
/**
3
 * This file is part of the Ray.AuraSqlModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\AuraSqlModule;
8
9
use Aura\SqlQuery\Common\DeleteInterface;
10
use Aura\SqlQuery\Common\InsertInterface;
11
use Aura\SqlQuery\Common\SelectInterface;
12
use Aura\SqlQuery\Common\UpdateInterface;
13
use Ray\AuraSqlModule\Annotation\AuraSqlQueryConfig;
14
use Ray\Di\AbstractModule;
15
16
class AuraSqlQueryModule extends AbstractModule
17
{
18
    /**
19
     * @var string
20
     */
21
    private $db;
22
23 13
    public function __construct(string $db, AbstractModule $module = null)
24
    {
25 13
        $this->db = $db;
26 13
        parent::__construct($module);
0 ignored issues
show
Bug introduced by
It seems like $module defined by parameter $module on line 23 can also be of type object<Ray\Di\AbstractModule>; however, Ray\Di\AbstractModule::__construct() does only seem to accept null|object<self>, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
27 13
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 13
    protected function configure()
33
    {
34 13
        $this->bind()->annotatedWith(AuraSqlQueryConfig::class)->toInstance($this->db);
35 13
        $this->bind(SelectInterface::class)->toProvider(AuraSqlQuerySelectProvider::class);
36 13
        $this->bind(InsertInterface::class)->toProvider(AuraSqlQueryInsertProvider::class);
37 13
        $this->bind(UpdateInterface::class)->toProvider(AuraSqlQueryUpdateProvider::class);
38 13
        $this->bind(DeleteInterface::class)->toProvider(AuraSqlQueryDeleteProvider::class);
39 13
    }
40
}
41