SelectWhereOrLimit   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 24
ccs 15
cts 15
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A crear() 0 22 1
1
<?php
2
namespace src\factory;
3
4
use src\FactoryClassInterface;
5
use src\pdodatabase\conexion\CrearConexionBaseDeDatos;
6
use src\pdodatabase\consultas\select\ConsultaSelectWhereOrdenOLimite;
7
use src\pdodatabase\ejecutar\EjecutarConsultaConDatos;
8
use src\pdodatabase\elementos\Campos;
9
use src\pdodatabase\elementos\CamposYTabla;
10
use src\pdodatabase\elementos\Como;
11
use src\pdodatabase\elementos\Limite;
12
use src\pdodatabase\elementos\Tabla;
13
use src\pdodatabase\elementos\ValidadorDeParametrosWhereAndOthers;
14
use src\pdodatabase\elementos\WhereOr;
15
use src\pdodatabase\sentencias\select\SentenciaSelectWhereOrdenOLimite;
16
17
class SelectWhereOrLimit implements FactoryClassInterface
18
{
19 1
    public function crear(array $array): ConsultaSelectWhereOrdenOLimite
20
    {
21 1
        $conexion = new CrearConexionBaseDeDatos;
22 1
        $conexion = $conexion->crear([]);
23
24 1
        return new ConsultaSelectWhereOrdenOLimite(
25 1
            new EjecutarConsultaConDatos(
26 1
                $conexion
27
            ),
28 1
            new SentenciaSelectWhereOrdenOLimite(
29 1
                new CamposYTabla(
30 1
                    new Campos($array['campos']),
31 1
                    new Tabla($array['tabla'])
32
                ),
33 1
                new Como(
34 1
                    new WhereOr(
35 1
                        new ValidadorDeParametrosWhereAndOthers(
36 1
                            $array['where']
37
                        )
38
                    )
39
                ),
40 1
                new Limite($array['limit'])
41
            )
42
        );
43
    }
44
}