ElasticSearchRequester   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 35
ccs 0
cts 22
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B wasNotified() 0 25 2
1
<?php
2
namespace Jeancsil\FlightSpy\Service\ElasticSearch;
3
4
/**
5
 * @author Jean Silva <[email protected]>
6
 * @license MIT
7
 */
8
class ElasticSearchRequester
9
{
10
    use ConfiguratorTrait;
11
12
    /**
13
     * @param string $identifier
14
     * @param string $notifyTo
15
     * @return boolean
16
     */
17
    public function wasNotified($identifier, $notifyTo)
0 ignored issues
show
Coding Style introduced by
function wasNotified() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
18
    {
19
        $params = [
20
            'index' => $this->indexName,
21
            'type' => $this->typeName,
22
            'body' => [
23
                'query' => [
24
                    'bool' => [
25
                        'must' => [
26
                            ['term' => ['identifier' => $identifier]],
27
                            ['term' => ['notified' => $notifyTo]]
28
                        ]
29
                    ]
30
                ]
31
            ]
32
        ];
33
34
        $response = Client::getInstance()->search($params);
35
36
        if (isset($response['hits']['total'])) {
37
            return $response['hits']['total'] > 0;
38
        }
39
40
        return false;
41
    }
42
}
43