Code Duplication    Length = 38-50 lines in 2 locations

lib/Elastica/Processor/Join.php 1 location

@@ 12-49 (lines=38) @@
9
 *
10
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/join-processor.html
11
 */
12
class Join extends AbstractProcessor
13
{
14
    /**
15
     * Join constructor.
16
     *
17
     * @param $field
18
     * @param $separator
19
     */
20
    public function __construct($field, $separator)
21
    {
22
        $this->setField($field);
23
        $this->setSeparator($separator);
24
    }
25
26
    /**
27
     * Set the field.
28
     *
29
     * @param string $field
30
     *
31
     * @return $this
32
     */
33
    public function setField(string $field)
34
    {
35
        return $this->setParam('field', $field);
36
    }
37
38
    /**
39
     * Set the separator.
40
     *
41
     * @param string $separator
42
     *
43
     * @return $this
44
     */
45
    public function setSeparator(string $separator)
46
    {
47
        return $this->setParam('separator', $separator);
48
    }
49
}
50

lib/Elastica/Processor/Split.php 1 location

@@ 12-61 (lines=50) @@
9
 *
10
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/split-processor.html
11
 */
12
class Split extends AbstractProcessor
13
{
14
    /**
15
     * Split constructor.
16
     *
17
     * @param $field
18
     * @param $separator
19
     */
20
    public function __construct($field, $separator)
21
    {
22
        $this->setField($field);
23
        $this->setSeparator($separator);
24
    }
25
26
    /**
27
     * Set the field.
28
     *
29
     * @param string $field
30
     *
31
     * @return $this
32
     */
33
    public function setField(string $field)
34
    {
35
        return $this->setParam('field', $field);
36
    }
37
38
    /**
39
     * Set the separator.
40
     *
41
     * @param string $separator
42
     *
43
     * @return $this
44
     */
45
    public function setSeparator(string $separator)
46
    {
47
        return $this->setParam('separator', $separator);
48
    }
49
50
    /**
51
     * Set ignore_missing. Default value false.
52
     *
53
     * @param bool $ignoreMissing only these values are allowed (integer|float|string|boolean|auto)
54
     *
55
     * @return $this
56
     */
57
    public function setIgnoreMissing(bool $ignoreMissing)
58
    {
59
        return $this->setParam('ignore_missing', $ignoreMissing);
60
    }
61
}
62