Completed
Push — master ( 41fafc...54e7a7 )
by Andrii
07:29
created

HashCondition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 34
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getHash() 0 4 1
A fromArrayDefinition() 0 4 1
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db\conditions;
9
10
/**
11
 * Condition based on column-value pairs.
12
 *
13
 * @author Dmytro Naumenko <[email protected]>
14
 * @since 2.0.14
15
 */
16
class HashCondition implements ConditionInterface
17
{
18
    /**
19
     * @var array|null the condition specification.
20
     */
21
    private $hash;
22
23
24
    /**
25
     * HashCondition constructor.
26
     *
27
     * @param array|null $hash
28
     */
29 3
    public function __construct($hash)
30
    {
31 3
        $this->hash = $hash;
32
    }
33
34
    /**
35
     * @return array|null
36
     */
37 3
    public function getHash()
38
    {
39 3
        return $this->hash;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public static function fromArrayDefinition($operator, $operands)
46
    {
47
        return new static($operands);
48
    }
49
}
50