QueryEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\MongoDbBundle\Event;
6
7
use Facile\MongoDbBundle\Models\Query;
8
use Symfony\Component\EventDispatcher\GenericEvent;
9
10
/**
11
 * Class QueryEvent.
12
 *
13
 * @internal
14
 */
15
final class QueryEvent extends GenericEvent
16
{
17
    const QUERY_PREPARED = 'facile_mongo_db.event.query_prepared';
18
19
    const QUERY_EXECUTED = 'facile_mongo_db.event.query_executed';
20
21
    /**
22
     * QueryEvent constructor.
23 13
     *
24
     * @param Query $queryLog
25 13
     * @param array $arguments
26 13
     */
27
    public function __construct(Query $queryLog, array $arguments = [])
28
    {
29
        parent::__construct($queryLog, $arguments);
30
    }
31 1
32
    /**
33 1
     * @return Query
34
     */
35
    public function getQueryLog(): Query
36
    {
37
        return $this->getSubject();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getSubject() could return the type null which is incompatible with the type-hinted return Facile\MongoDbBundle\Models\Query. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
}
40