Passed
Push — main ( 67a4aa...1c1b74 )
by Osvaldo
05:10
created

Update   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 12
cp 0
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\update\ConsultaUpdate;
7
use src\pdodatabase\ejecutar\EjecutarConsultaConDatos;
8
use src\pdodatabase\elementos\Tabla;
9
use src\pdodatabase\elementos\Update as ElementoUpdate;
10
use src\pdodatabase\elementos\ValidadorDeParametrosWhere;
11
use src\pdodatabase\elementos\Where;
12
use src\pdodatabase\sentencias\update\SentenciaUpdate;
13
14
class Update implements FactoryClassInterface
15
{
16
    public function crear(array $array): object
17
    {
18
        $conexion = new CrearConexionBaseDeDatos;
19
        $conexion = $conexion->crear([]);
20
21
        return new ConsultaUpdate(
22
            new EjecutarConsultaConDatos(
23
                $conexion
24
            ),
25
            new SentenciaUpdate(
26
                new Tabla($array['tabla']),
27
                new ElementoUpdate(
28
                    $array['valores'],
29
                    new Where(
30
                        new ValidadorDeParametrosWhere($array['where'])
31
                    )
32
                )
33
            )
34
        );
35
    }
36
}