Passed
Push — main ( c1cea3...1d91de )
by Osvaldo
13:30
created

Truncate::crear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 12
rs 10
1
<?php
2
namespace src\factory;
3
4
use src\FactoryClassInterface;
5
use src\pdodatabase\conexion\CrearConexionBaseDeDatos;
6
use src\pdodatabase\consultas\sql\ConsultaTruncate;
7
use src\pdodatabase\ejecutar\EjecutarConsultaSinDatos;
8
use src\pdodatabase\elementos\Tabla;
9
use src\pdodatabase\elementos\Truncate as ElementoTruncate;
10
use src\pdodatabase\sentencias\sql\SentenciaTruncate;
11
12
class Truncate implements FactoryClassInterface
13
{
14
    public function crear(array $array): ConsultaTruncate
15
    {
16
        $conexion = new CrearConexionBaseDeDatos;
17
        $conexion = $conexion->crear([]);
18
19
        return new ConsultaTruncate(
20
            new EjecutarConsultaSinDatos(
21
                $conexion
22
            ),
23
            new SentenciaTruncate(
24
                new ElementoTruncate(
25
                    new Tabla($array['tabla'])
26
                )
27
            )
28
        );
29
    }
30
}