Passed
Push — master ( c65027...a39d50 )
by Wilmer
18:53 queued 16:02
created

HashCondition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

3 Methods

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