Passed
Push — main ( 5d16fe...94d2f6 )
by Osvaldo
02:29
created

ConsultaSelect::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
namespace src\pdodatabase\consultas\select;
3
4
use PDOStatement;
5
use src\pdodatabase\ejecutar\EjecutarConsultaSinDatos;
6
use src\pdodatabase\sentencias\select\SentenciaSelect;
7
8
class ConsultaSelect
9
{
10
    public function __construct(EjecutarConsultaSinDatos $ejecutarConsultaSinDatos, SentenciaSelect $sentenciaSelect)
11
    {
12
        $this->_ejecutar = $ejecutarConsultaSinDatos;
0 ignored issues
show
Bug Best Practice introduced by
The property _ejecutar does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
13
        $this->_sentencia = $sentenciaSelect;
0 ignored issues
show
Bug Best Practice introduced by
The property _sentencia does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
14
    }
15
16
    public function obtener(): PDOStatement
17
    {
18
        return $this->_ejecutar->query($this->_sentencia->sql());
19
    }
20
}