Passed
Push — main ( f2df15...8d7bb5 )
by Osvaldo
09:13
created

ODonde::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
1
<?php
2
namespace src\pdodatabase\elementos;
3
4
class ODonde
5
{
6
    private $_donde;
7
    private $_primerDonde;
8
    private $_segundoDonde;
9
10
    public function __construct(Donde $Donde, Donde $SegundoDonde)
11
    {
12
        $this->_primerDonde = $Donde;
13
        $this->_segundoDonde = $SegundoDonde;
14
        $this->_donde = $this->setDonde();
15
    }
16
17
    public function donde(): string
18
    {
19
        return $this->_donde;
20
    }
21
22
    public function datos(): array
23
    {
24
        return array($this->_primerDonde->datos()[0],$this->_segundoDonde->datos()[0]);
25
    }
26
27
    private function setDonde(): string
28
    {
29
        return ' WHERE '.$this->_primerDonde->donde().' OR '.$this->_segundoDonde->donde();
30
    }
31
}