PostFilterEndpoint   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 8 2
A getOrder() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchDSL\SearchEndpoint;
13
14
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
15
16
/**
17
 * Search post filter dsl endpoint.
18
 */
19
class PostFilterEndpoint extends QueryEndpoint
20
{
21
    /**
22
     * Endpoint name
23
     */
24
    const NAME = 'post_filter';
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
30
    {
31
        if (!$this->getBool()) {
32
            return null;
33
        }
34
35
        return $this->getBool()->toArray();
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function getOrder()
42
    {
43
        return 1;
44
    }
45
}
46