Passed
Pull Request — master (#184)
by
unknown
04:31
created

QueryCreatedListener   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscribedEvents() 0 4 1
A onQueryCreated() 0 6 2
1
<?php
2
/*
3
4
This file was created by developers working at BitBag
5
6
Do you need more information about us and what we do? Visit our   website!
7
8
We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
9
*/
10
declare(strict_types=1);
11
12
namespace BitBag\SyliusElasticsearchPlugin\EventListener;
13
14
use Elastica\Query\BoolQuery;
15
16
final class QueryCreatedListener
17
{
18
19
    public static function getSubscribedEvents(): array
20
    {
21
        return [
22
            QueryCreatedEventInterface::NAME => 'onQueryCreated',
23
        ];
24
    }
25
26
    public function onQueryCreated(QueryCreatedEvent $event): void
27
    {
28
        $query = $event->getQuery();
29
30
        if (false === $query instanceof BoolQuery) {
31
            return;
32
        }
33
    }
34
}
35