Completed
Push — master ( 7a35bc...7eff79 )
by Krzysztof
05:49 queued 02:58
created

TextCriteria::getText()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
ccs 0
cts 2
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace KGzocha\Searcher\Criteria;
4
5
class TextCriteria implements CriteriaInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    private $text;
11
12
    /**
13
     * @return string
14
     */
15
    public function getText()
16
    {
17
        return $this->text;
18
    }
19
20
    /**
21
     * @param string $text
22
     *
23
     * @return TextCriteria
24
     */
25 7
    public function setText($text)
26
    {
27 7
        $this->text = (string) $text;
28
29 7
        return $this;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 8
    public function shouldBeApplied()
36
    {
37 8
        return $this->text !== null && 0 < mb_strlen($this->text);
38
    }
39
}
40