StringCriteria   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 3
c 1
b 0
f 1
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setValue() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Noitran\Repositories\Criteria\Support;
6
7
use Noitran\Repositories\Contracts\Criteria\FilterCriteriaInterface;
8
9
/**
10
 * Class StringCriteria.
11
 */
12
class StringCriteria extends AbstractFilterCriteria
13
{
14
    /**
15
     * @param $value
16
     *
17 12
     * @return FilterCriteriaInterface
18
     */
19 12
    public function setValue($value): FilterCriteriaInterface
20
    {
21 12
        $this->value = filter_var($value, FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);
0 ignored issues
show
Bug Best Practice introduced by
The property value does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
22
23
        return $this;
24
    }
25
}
26