Completed
Branch query_logging_to_events (025608)
by Alessandro
02:17
created

QueryEvent::getQueryLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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