Passed
Pull Request — master (#412)
by Wilmer
36:35 queued 23:53
created

AnyCaseValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Support;
6
7
use function strtolower;
8
9
final class AnyCaseValue extends CompareValue
10
{
11
    public string|array $value = '';
12
13
    /**
14
     * @psalm-param string|string[] $value
15
     */
16
    public function __construct(string|array $value)
17
    {
18
        if (is_array($value)) {
0 ignored issues
show
introduced by
The condition is_array($value) is always true.
Loading history...
19
            foreach ($value as $v) {
20
                $this->value = strtolower($v);
21
            }
22
        } else {
23
            $this->value = strtolower($value);
24
        }
25
    }
26
}
27