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

FetchAssoc   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule\Pagerfanta;
6
7
use Aura\Sql\ExtendedPdoInterface;
8
use Override;
9
use PDO;
10
11
final readonly class FetchAssoc implements FetcherInterface
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 11 at column 6
Loading history...
12
{
13
    public function __construct(private ExtendedPdoInterface $pdo)
14
    {
15
    }
16
17
    /**
18
     * {@inheritDoc}
19
     */
20
    #[Override]
21
    public function __invoke(string $sql, array $params): array
22
    {
23
        return $this->pdo->perform($sql, $params)->fetchAll(PDO::FETCH_ASSOC);
24
    }
25
}
26