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

QueryEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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