Passed
Pull Request — 1.x (#78)
by Akihito
02:20 queued 01:13
created

AuraSqlQueryUpdateProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Aura\SqlQuery\Common\UpdateInterface;
8
use Aura\SqlQuery\QueryFactory;
9
use Override;
10
use Ray\AuraSqlModule\Annotation\AuraSqlQueryConfig;
11
use Ray\Di\ProviderInterface;
12
13
/** @implements ProviderInterface<UpdateInterface> */
14
final readonly class AuraSqlQueryUpdateProvider implements ProviderInterface
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 14 at column 6
Loading history...
15
{
16
    /**
17
     * @param string $db The database type
18
     *
19
     * @AuraSqlQueryConfig
20
     */
21
    #[AuraSqlQueryConfig]
22
    public function __construct(private string $db)
23
    {
24
    }
25 5
26
    /**
27 5
     * {@inheritDoc}
28 5
     */
29
    #[Override]
30
    public function get(): UpdateInterface
31
    {
32
        return new QueryFactory($this->db)->newUpdate();
33 5
    }
34
}
35