SelectWhereOr   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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