Passed
Push — master ( f4eeb8...0d22ee )
by Sergei
11:47 queued 01:39
created

HashCondition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getHash() 0 3 1
A fromArrayDefinition() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Query\Conditions;
6
7
/**
8
 * Condition based on column-value pairs.
9
 */
10
class HashCondition implements ConditionInterface
11
{
12
    private ?array $hash = [];
13
14 626
    public function __construct(?array $hash = [])
15
    {
16 626
        $this->hash = $hash;
17
    }
18
19
    /**
20
     * @return array|null the condition specification.
21
     */
22 626
    public function getHash(): ?array
23
    {
24 626
        return $this->hash;
25
    }
26
27
    public static function fromArrayDefinition(string $operator, array $operands): self
28
    {
29
        return new static($operands);
30
    }
31
}
32