Passed
Branch psalm-3 (d5d890)
by Wilmer
02:56
created

HashCondition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Query\Conditions;
6
7
use Yiisoft\Db\Query\Conditions\Interface\HashConditionInterface;
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_INTERFACE, expecting T_STRING or '{' on line 7 at column 32
Loading history...
8
9
/**
10
 * Condition based on column-value pairs.
11
 */
12
class HashCondition implements HashConditionInterface
13
{
14
    public function __construct(private ?array $hash = [])
15
    {
16
    }
17
18
    public function getHash(): ?array
19
    {
20
        return $this->hash;
21
    }
22
23
    public static function fromArrayDefinition(string $operator, array $operands): self
24
    {
25
        return new static($operands);
26
    }
27
}
28