Percolate::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 3
eloc 5
nc 2
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 1
1
<?php
2
3
4
namespace Manticoresearch\Query;
5
6
use Manticoresearch\Query;
7
8
class Percolate extends Query
9
{
10
    public function __construct($docs)
11
    {
12
        $this->params['percolate'] = [];
13
        if (isset($docs[0]) && (is_array($docs[0]))) {
14
            $this->params['percolate'] ['documents'] = $docs;
15
        } else {
16
            $this->params['percolate'] ['document'] = $docs;
17
        }
18
    }
19
}
20