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

QueryEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 3
cts 5
cp 0.6
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\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