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

Query::serialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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