Delete   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A crear() 0 15 1
1
<?php
2
namespace src\factory;
3
4
use src\FactoryClassInterface;
5
use src\pdodatabase\conexion\CrearConexionBaseDeDatos;
6
use src\pdodatabase\consultas\delete\ConsultaDelete;
7
use src\pdodatabase\ejecutar\EjecutarConsultaConDatos;
8
use src\pdodatabase\elementos\Tabla;
9
use src\pdodatabase\elementos\Delete as ElementoDelete;
10
use src\pdodatabase\elementos\ValidadorDeParametrosWhere;
11
use src\pdodatabase\elementos\Where;
12
use src\pdodatabase\sentencias\delete\SentenciaDelete;
13
14
class Delete implements FactoryClassInterface
15
{
16 1
    public function crear(array $array): object
17
    {
18 1
        $conexion = new CrearConexionBaseDeDatos;
19 1
        $conexion = $conexion->crear([]);
20
21 1
        return new ConsultaDelete(
22 1
            new EjecutarConsultaConDatos(
23 1
                $conexion
24
            ),
25 1
            new SentenciaDelete(
26 1
                new ElementoDelete(
27 1
                    new Tabla($array['tabla']),
28 1
                    new Where(
29 1
                        new ValidadorDeParametrosWhere(
30 1
                            $array['where']
31
                        )
32
                    )
33
                )
34
            )
35
        );
36
    }
37
}