SegmentoFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDetail() 0 5 1
1
<?php
2
3
namespace Umbrella\Ya\RetornoBoleto\Cnab\Cnab240\Segmento;
4
5
/**
6
 * Classe que identifica o tipo de arquivo de retorno sendo carregado e instancia a classe
7
 * específica para leitura do mesmo.
8
 * @author Ítalo Lelis de Vietro <[email protected]>
9
 */
10
class SegmentoFactory
11
{
12
    /**
13
     * @param string $tipo O tipo do segmento para carregar os detalhes
14
     * @return SegmentoInterface
15
     */
16
    public function getDetail($tipo)
17
    {
18
        $reflection = new \ReflectionClass('\Umbrella\Ya\RetornoBoleto\Cnab\Cnab240\Segmento\Segmento' . strtoupper($tipo));
19
        return $reflection->newInstanceArgs();
20
    }
21
}
22