Passed
Push — master ( 53b3d3...a35a46 )
by Julián
06:01 queued 13s
created

AbstractEmptyQuery::getAllowedInterfaces()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
/*
4
 * cqrs (https://github.com/phpgears/cqrs).
5
 * CQRS base.
6
 *
7
 * @license MIT
8
 * @link https://github.com/phpgears/cqrs
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Gears\CQRS;
15
16
use Gears\DTO\ScalarPayloadBehaviour;
17
use Gears\Immutability\ImmutabilityBehaviour;
18
19
/**
20
 * Abstract empty immutable serializable query.
21
 */
22
abstract class AbstractEmptyQuery implements Query
23
{
24
    use ImmutabilityBehaviour, ScalarPayloadBehaviour {
25
        ScalarPayloadBehaviour::__call insteadof ImmutabilityBehaviour;
26
    }
27
28
    /**
29
     * AbstractEmptyQuery constructor.
30
     */
31
    final protected function __construct()
32
    {
33
        $this->assertImmutable();
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getQueryType(): string
40
    {
41
        return \get_called_class();
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     *
47
     * @return string[]
48
     */
49
    final protected function getAllowedInterfaces(): array
50
    {
51
        return [Query::class];
52
    }
53
}
54