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

ParserSearchTrait::parserSearch()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 7
nc 4
nop 0
dl 0
loc 12
rs 9.6111
c 0
b 0
f 0
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
}