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

Trim::setField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Elastica\Processor;
3
4
/**
5
 * Elastica Trim Processor.
6
 *
7
 * @author   Federico Panini <[email protected]>
8
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/trim-processor.html
9
 */
10
class Trim extends AbstractProcessor
11
{
12
    /**
13
     * Sort constructor.
14
     * @param $field
15
     */
16
    public function __construct($field)
17
    {
18
        $this->setField($field);
19
    }
20
21
    /**
22
     * Set the field.
23
     *
24
     * @param string $field
25
     *
26
     * @return $this
27
     */
28
    public function setField(string $field)
29
    {
30
        return $this->setParam('field', $field);
31
    }
32
}