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

AuraSqlQueryInsertProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
wmc 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Aura\SqlQuery\Common\InsertInterface;
8
use Aura\SqlQuery\QueryFactory;
9
use Override;
10
use Ray\AuraSqlModule\Annotation\AuraSqlQueryConfig;
11
use Ray\Di\ProviderInterface;
12
13
/** @implements ProviderInterface<InsertInterface> */
14
final readonly class AuraSqlQueryInsertProvider 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(): InsertInterface
31
    {
32
        return new QueryFactory($this->db)->newInsert();
33 5
    }
34
}
35