Completed
Pull Request — master (#52)
by Daniel
09:53
created

TextQueryCriteria::shouldBeApplied()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace KGzocha\Searcher\QueryCriteria;
4
5
class TextQueryCriteria implements QueryCriteriaInterface
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 TextQueryCriteria
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