Completed
Push — master ( 20f6ff...6a696f )
by Nicolas
03:14
created

Split::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace Elastica\Processor;
3
4
/**
5
 * Elastica Split Processor.
6
 *
7
 * @author   Federico Panini <[email protected]>
8
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/split-processor.html
9
 */
10 View Code Duplication
class Split extends AbstractProcessor
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * Split constructor.
14
     *
15
     * @param $field
16
     * @param $separator
17
     */
18
    public function __construct($field, $separator)
19
    {
20
        $this->setField($field);
21
        $this->setSeparator($separator);
22
    }
23
24
    /**
25
     * Set the field.
26
     *
27
     * @param string $field
28
     *
29
     * @return $this
30
     */
31
    public function setField(string $field)
32
    {
33
        return $this->setParam('field', $field);
34
    }
35
36
    /**
37
     * Set the separator.
38
     *
39
     * @param string $separator
40
     *
41
     * @return $this
42
     */
43
    public function setSeparator(string $separator)
44
    {
45
        return $this->setParam('separator', $separator);
46
    }
47
48
    /**
49
     * Set ignore_missing. Default value false.
50
     *
51
     * @param bool $ignoreMissing only these values are allowed (integer|float|string|boolean|auto)
52
     *
53
     * @return $this
54
     */
55
    public function setIgnoreMissing(bool $ignoreMissing)
56
    {
57
        return $this->setParam('ignore_missing', $ignoreMissing);
58
    }
59
}