QueryEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getQueryLog() 0 3 1
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