1 | <?php |
||
32 | class Retorno extends Status |
||
33 | { |
||
34 | |||
35 | private $data_recebimento; |
||
36 | |||
37 | 42 | public function __construct($retorno = []) |
|
41 | |||
42 | 13 | public function getDataRecebimento($normalize = false) |
|
49 | |||
50 | 42 | public function setDataRecebimento($data_recebimento) |
|
51 | { |
||
52 | 42 | if (!is_null($data_recebimento) && !is_numeric($data_recebimento)) { |
|
53 | 15 | $data_recebimento = strtotime($data_recebimento); |
|
54 | } |
||
55 | 42 | $this->data_recebimento = $data_recebimento; |
|
56 | 42 | return $this; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Informa se a nota foi autorizada no prazo ou fora do prazo |
||
61 | */ |
||
62 | 9 | public function isAutorizado() |
|
66 | |||
67 | /** |
||
68 | * Informa se a nota está cancelada |
||
69 | */ |
||
70 | 6 | public function isCancelado() |
|
74 | |||
75 | /** |
||
76 | * Informa se o lote já foi processado e já tem um protocolo |
||
77 | */ |
||
78 | 4 | public function isProcessado() |
|
82 | |||
83 | /** |
||
84 | * Informa se o lote foi recebido com sucesso |
||
85 | */ |
||
86 | public function isRecebido() |
||
87 | { |
||
88 | return in_array($this->getStatus(), ['103', '105']); |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * Informa se a nota foi denegada |
||
93 | */ |
||
94 | 1 | public function isDenegada() |
|
98 | |||
99 | /** |
||
100 | * Informa se a nota da consulta não foi autorizada ou se não existe |
||
101 | */ |
||
102 | 1 | public function isInexistente() |
|
106 | |||
107 | /** |
||
108 | * Informa se os serviços da SEFAZ estão paralisados ou em manutenção |
||
109 | */ |
||
110 | public function isParalisado() |
||
111 | { |
||
112 | return in_array($this->getStatus(), ['108', '109']); |
||
113 | } |
||
114 | |||
115 | 9 | public function toArray($recursive = false) |
|
121 | |||
122 | 42 | public function fromArray($retorno = []) |
|
137 | |||
138 | 8 | public function getNode($name = null) |
|
148 | |||
149 | 17 | public function loadNode($element, $name = null) |
|
156 | } |
||
157 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.