OrCondition   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getString() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Nip\Database\Query\Condition;
4
5
/**
6
 * Class OrCondition
7
 * @package Nip\Database\Query\Condition
8
 */
9
class OrCondition extends Condition
10 4
{
11
    protected $_condition;
12 4
    protected $_orCondition;
13 4
14 4
    /**
15
     * OrCondition constructor.
16 4
     * @param $condition
17
     * @param $orCondition
18 4
     */
19
    public function __construct($condition, $orCondition)
20
    {
21
        $this->_condition = $condition;
22
        $this->_orCondition = $orCondition;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getString()
29
    {
30
        return $this->protectCondition($this->_condition->getString()) . ' OR ' . $this->protectCondition($this->_orCondition->getString()) . '';
31
    }
32
}
33