Parametros::parametros()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 4
eloc 5
c 2
b 0
f 0
nc 6
nop 0
dl 0
loc 11
rs 10
1
<?php
2
namespace src;
3
4
use src\Enlace;
5
use src\Metodo;
6
7
class Parametros
8
{
9
    private $_url;
10
    private $_metodo;
11
12
    public function __construct(Enlace $url, Metodo $metodo)
13
    {
14
        $this->_url = $url->enlace();
15
        $this->_metodo = $metodo;
16
    }
17
18
    public function parametros(): array
19
    {
20
        unset($this->_url[0]);
21
22
        if (isset($this->_url[1])) {
23
            if ($this->_metodo->metodo() == $this->_url[1]) {
24
                unset($this->_url[1]);
25
            }
26
        }
27
28
        return $this->_url ? array_values($this->_url) : [];
29
    }
30
}
31