Passed
Branch dev (f56f10)
by Wilmer
04:41 queued 01:34
created

AnyCaseValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\TestSupport;
6
7
use function array_map;
8
use function is_array;
9
use function strtolower;
10
11
final class AnyCaseValue extends CompareValue
12
{
13
    public $value;
14
15
    /**
16
     * Constructor.
17
     *
18
     * @param string|string[] $value
19
     */
20
    public function __construct($value)
21
    {
22
        if (is_array($value)) {
23
            $this->value = array_map('strtolower', $value);
24
        } else {
25
            $this->value = strtolower($value);
26
        }
27
    }
28
}
29