Completed
Branch query_logging_to_events (6a211d)
by Alessandro
02:15
created

QueryEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Facile\MongoDbBundle\Event;
6
7
use Facile\MongoDbBundle\Models\QueryLog;
8
use Symfony\Component\EventDispatcher\GenericEvent;
9
10
/**
11
 * Class QueryEvent.
12
 * @internal
13
 */
14
class QueryEvent extends GenericEvent
15
{
16
    const QUERY_PREPARED = 'facile_mongo_db.event.query_prepared';
17
    const QUERY_EXECUTED = 'facile_mongo_db.event.query_executed';
18
19
    /**
20
     * QueryEvent constructor.
21
     *
22
     * @param QueryLog $queryLog
23
     * @param array    $arguments
24
     */
25 12
    public function __construct(QueryLog $queryLog, array $arguments = [])
26
    {
27 12
        parent::__construct($queryLog, $arguments);
28 12
    }
29
30
    /**
31
     * @return QueryLog
32
     */
33 1
    public function getQueryLog(): QueryLog
34
    {
35 1
        return $this->getSubject();
36
    }
37
}
38