Completed
Push — master ( 373aee...88365a )
by Dominik
02:29
created

Query   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A serialize() 0 4 1
A json() 0 4 1
1
<?php
2
3
namespace Saxulum\ElasticSearchQueryBuilder;
4
5
use Saxulum\ElasticSearchQueryBuilder\Node\AbstractNode;
6
7
class Query
8
{
9
    /**
10
     * @var AbstractNode
11
     */
12
    protected $node;
13
14
    /**
15
     * @param AbstractNode $node
16
     */
17 2
    public function __construct(AbstractNode $node)
18
    {
19 2
        $this->node = $node;
20 2
    }
21
22
    /**
23
     * @return array|bool|float|int|null|\stdClass|string
24
     */
25 2
    public function serialize()
26
    {
27 2
        return $this->node->serialize();
28
    }
29
30
    /**
31
     * @return string
32
     */
33 2
    public function json()
34
    {
35 2
        return json_encode($this->serialize());
36
    }
37
}
38