Total Complexity | 6 |
Total Lines | 70 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
18 | class MatchPhrase implements Query |
||
19 | { |
||
20 | use Traits\Analyzer; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $field; |
||
26 | |||
27 | /** |
||
28 | * @var mixed |
||
29 | */ |
||
30 | private $query; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | private $slop; |
||
36 | |||
37 | /** |
||
38 | * @param string $field |
||
39 | * @param mixed $query |
||
40 | * @param int $slop |
||
41 | */ |
||
42 | 6 | public function __construct(string $field, $query, int $slop = null) |
|
43 | { |
||
44 | 6 | $this->field = $field; |
|
45 | 6 | $this->query = $query; |
|
46 | 6 | $this->slop = $slop; |
|
47 | 6 | } |
|
48 | |||
49 | /** |
||
50 | * @param int $slop |
||
51 | * |
||
52 | * @return self |
||
53 | */ |
||
54 | 1 | public function slop(int $slop): self |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 1 | public function name(): string |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 4 | public function compile(): array |
|
91 |