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

YDonde   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 setDonde() 0 3 1
A __construct() 0 5 1
A datos() 0 3 1
A donde() 0 3 1
1
<?php
2
namespace src\pdodatabase\elementos;
3
4
use src\pdodatabase\elementos\Donde;
5
6
class YDonde
7
{
8
    private $_donde;
9
    private $_primerDonde;
10
    private $_segundoDonde;
11
12
    public function __construct(Donde $Donde, Donde $SegundoDonde)
13
    {
14
        $this->_primerDonde = $Donde;
15
        $this->_segundoDonde = $SegundoDonde;
16
        $this->_donde = $this->setDonde();
17
    }
18
19
    public function donde(): string
20
    {
21
        return $this->_donde;
22
    }
23
24
    public function datos(): array
25
    {
26
        return array($this->_primerDonde->datos()[0],$this->_segundoDonde->datos()[0]);
27
    }
28
29
    private function setDonde(): string
30
    {
31
        return ' WHERE '.$this->_primerDonde->donde().' AND '.$this->_segundoDonde->donde();
32
    }
33
}