RetornosCliente   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 6
Bugs 0 Features 0
Metric Value
c 6
b 0
f 0
dl 0
loc 37
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRetornoDados() 0 14 2
A getListaRetornos() 0 5 1
1
<?php
2
3
namespace OBRSDK\HttpClient;
4
5
/**
6
 * @author Antonio
7
 * @since 19/10/2017
8
 */
9
class RetornosCliente extends Nucleo\Instancia {
10
11
    /**
12
     * Pega todos os arquivos de retornos já enviado para a API
13
     * 
14
     * @return \OBRSDK\Entidades\Retornos[]
15
     */
16
    public function getListaRetornos() {
17
        $this->apiCliente->addAuthorization()
18
                ->get("retornos");
19
20
        return $this->getListaEntidade('retornos', new \OBRSDK\Entidades\Retornos());
21
    }
22
23
    /**
24
     * Se passado o parametro isFile como true, a identificacao deve ser 
25
     * o caminho para o arquivo.
26
     * Se não, deve ser o ID de retorno enviado anteriormente
27
     * 
28
     * @param string $identificacao
29
     * @param bool $isFile
30
     * @return \OBRSDK\Entidades\Retornos
31
     */
32
    public function getRetornoDados($identificacao, $isFile = false) {
33
        $this->apiCliente->addAuthorization();
34
        if ($isFile) {
35
            $this->apiCliente->enviarArquivo('retornos', $identificacao);
36
        } else {
37
            $this->apiCliente->get('retornos/' . $identificacao);
38
        }
39
40
        $resposta = $this->apiCliente->getRespostaArray();
41
42
        $respostaEntidade = new \OBRSDK\Entidades\Retornos();
43
        $respostaEntidade->setAtributos($resposta);
44
45
        return $respostaEntidade;
46
    }
47
48
}
49