Passed
Push — main ( 088d44...a78334 )
by Osvaldo
01:57
created

WhereAndNot   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A datos() 0 6 1
A __construct() 0 4 1
A sql() 0 3 1
1
<?php
2
namespace src\pdodatabase\elementos;
3
4
use src\interfaces\SentenciaDeComparacionInterface;
5
use src\interfaces\WhereAndOthersInterface;
6
use src\interfaces\WhereInterface;
7
8
class WhereAndNot implements WhereAndOthersInterface
9
{
10
    private $_where;
11
    private $_sentencia;
12
13
    public function __construct(WhereInterface $whereInterface, SentenciaDeComparacionInterface $SentenciaDeComparacionInterface)
14
    {
15
        $this->_where = $whereInterface;
16
        $this->_sentencia = $SentenciaDeComparacionInterface;
17
    }
18
19
    public function sql(): string
20
    {
21
        return $this->_where->sql().' AND NOT '.$this->_sentencia->sql();
22
    }
23
24
    public function datos(): array
25
    {
26
        $array = $this->_where->datos();
27
        array_push($array,$this->_sentencia->datos()[0]);
28
29
        return $array;        
30
    }
31
}