Passed
Push — feature/optimize ( 219eef...0e0305 )
by Fu
03:34
created

ParserSearchTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A parserSearch() 0 12 5
1
<?php
2
3
4
namespace Modules\Core\Traits\Criteria;
5
6
7
trait ParserSearchTrait
8
{
9
    protected function parserSearch()
10
    {
11
        if (stripos($this->search, ';') || stripos($this->search, ':')) {
12
            $values = explode(';', $this->search);
13
            foreach ($values as $value) {
14
                $s = explode(':', $value);
15
                if (count($s) == 1) {
16
                    $this->search = $s[0];
0 ignored issues
show
Bug Best Practice introduced by
The property search does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
17
                }
18
            }
19
20
            $this->search = null;
21
        }
22
    }
23
}