Completed
Pull Request — master (#119)
by Franco
02:40
created

ExactOrFilter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setValue() 0 16 4
1
<?php
2
3
/**
4
 * Class ExactOrFilter
5
 *
6
 * @package dms
7
 */
8
9
class ExactOrFilter extends ExactMatchFilter
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
    public function setValue($value)
12
    {
13
        if (is_string($value)) {
14
            $valueArray = explode(",", $value);
15
            $newValues = array();
16
            if (count($valueArray)) {
17
                foreach ($valueArray as $v) {
18
                    $newValues[] = trim($v);
19
                }
20
            }
21
            $value = $newValues;
22
        } else {
23
            $value = (array)$value;
24
        }
25
        parent::setValue($value);
26
    }
27
}
28