SelectWhereOrderByLimit   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A crear() 0 24 1
1
<?php
2
namespace src\factory;
3
4
use src\FactoryClassInterface;
5
use src\pdodatabase\conexion\CrearConexionBaseDeDatos;
6
use src\pdodatabase\consultas\select\ConsultaSelectWhereOrdenYLimite;
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\Orden;
13
use src\pdodatabase\elementos\OrdenYLimite;
14
use src\pdodatabase\elementos\Tabla;
15
use src\pdodatabase\elementos\ValidadorDeParametrosWhere;
16
use src\pdodatabase\elementos\Where;
17
use src\pdodatabase\sentencias\select\SentenciaSelectWhereOrdenYLimite;
18
19
class SelectWhereOrderByLimit implements FactoryClassInterface
20
{
21 1
    public function crear(array $array): ConsultaSelectWhereOrdenYLimite
22
    {
23 1
        $conexion = new CrearConexionBaseDeDatos;
24 1
        $conexion = $conexion->crear([]);
25
26 1
        return new ConsultaSelectWhereOrdenYLimite(
27 1
            new EjecutarConsultaConDatos(
28 1
                $conexion
29
            ),
30 1
            new SentenciaSelectWhereOrdenYLimite(
31 1
                new CamposYTabla(
32 1
                    new Campos($array['campos']),
33 1
                    new Tabla($array['tabla'])
34
                ),
35 1
                new Como(
36 1
                    new Where(
37 1
                        new ValidadorDeParametrosWhere(
38 1
                            $array['where']
39
                        )
40
                    )
41
                ),
42 1
                new OrdenYLimite(
43 1
                    new Orden($array['order']),
44 1
                    new Limite($array['limit'])
45
                )
46
                
47
            )
48
        );
49
    }
50
}