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

ODonde   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A donde() 0 3 1
A setDonde() 0 3 1
A __construct() 0 5 1
A datos() 0 3 1
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
}