CrearPeticion   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A crear() 0 10 1
1
<?php
2
namespace src;
3
4
use src\Controlador;
5
use src\Enlace;
6
use src\FactoryClassInterface;
7
use src\Metodo;
8
use src\Parametros;
9
use src\Peticion;
10
11
class CrearPeticion implements FactoryClassInterface
12
{
13
    public function crear(array $array): Peticion
14
    {
15
        $enlace = new Enlace($array['url']);
16
        $controlador = new Controlador($enlace);
17
        $metodo = new Metodo($enlace, $controlador);
18
19
        return new Peticion(
20
            $controlador,
21
            $metodo,
22
            new Parametros($enlace, $metodo)
23
        );
24
    }
25
}
26