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

HashCondition::getHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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