Passed
Pull Request — master (#343)
by Sergei
15:57 queued 02:59
created

HashCondition::getHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\QueryBuilder\Conditions;
6
7
use Yiisoft\Db\QueryBuilder\Conditions\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 $hash = [])
15
    {
16
    }
17
18
    public function getHash(): ?array
19
    {
20
        return $this->hash;
21
    }
22
23
    /**
24
     * @psalm-suppress MixedArgument
25
     */
26
    public static function fromArrayDefinition(string $operator, array $operands): self
27
    {
28
        return new self($operands);
29
    }
30
}
31