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

AnyCaseValue::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
c 0
b 0
f 0
nc 3
nop 1
dl 0
loc 8
rs 10
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