Passed
Push — dev_2x ( 3e8772...896177 )
by Adrian
06:45
created

NewMapperQuery   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 32
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A eventName() 0 3 1
A getQuery() 0 3 1
A __construct() 0 4 1
A setQuery() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Orm\Event;
5
6
use League\Event\HasEventName;
7
use Sirius\Orm\Query;
8
9
class NewMapperQuery implements HasEventName
10
{
11
12
    /**
13
     * @var string
14
     */
15
    private $mapper;
16
17
    /**
18
     * @var Query
19
     */
20
    private $query;
21
22
    public function __construct(string $mapper, Query $query)
23
    {
24
        $this->mapper = $mapper;
25
        $this->query = $query;
26
    }
27
28
    public function getQuery(): Query
29
    {
30
        return $this->query;
31
    }
32
33
    public function setQuery(Query $query)
34
    {
35
        $this->query = $query;
36
    }
37
38
    public function eventName(): string
39
    {
40
        return $this->mapper . '.query';
41
    }
42
}
43