DqlQuery   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFilters() 0 4 1
A setHydrationMode() 0 4 1
A getHydrationMode() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Explicit Architecture POC,
7
 * which is created on top of the Symfony Demo application.
8
 *
9
 * (c) Herberto Graça <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Acme\App\Infrastructure\Persistence\Doctrine;
16
17
use Acme\App\Core\Port\Persistence\QueryInterface;
18
use Doctrine\ORM\AbstractQuery;
19
use Doctrine\ORM\Query;
20
21
final class DqlQuery implements QueryInterface
22
{
23
    /**
24
     * @var Query
25
     */
26
    private $filters;
27
28
    /**
29
     * @var int
30
     */
31
    private $hydrationMode = AbstractQuery::HYDRATE_OBJECT;
32
33
    public function __construct(array $filters)
34
    {
35
        $this->filters = $filters;
0 ignored issues
show
Documentation Bug introduced by
It seems like $filters of type array is incompatible with the declared type object<Doctrine\ORM\Query> of property $filters.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
    }
37
38
    public function getFilters(): array
39
    {
40
        return $this->filters;
41
    }
42
43
    public function setHydrationMode(int $hydrationMode): void
44
    {
45
        $this->hydrationMode = $hydrationMode;
46
    }
47
48
    public function getHydrationMode(): int
49
    {
50
        return $this->hydrationMode;
51
    }
52
}
53