Complex classes like Evento often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Evento, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
37 | class Evento extends Retorno |
||
|
|||
38 | { |
||
39 | |||
40 | const VERSAO = '1.00'; |
||
41 | |||
42 | const TIPO_CANCELAMENTO = '110111'; |
||
43 | const TAG_RETORNO = 'retEvento'; |
||
44 | const TAG_RETORNO_ENVIO = 'retEnvEvento'; |
||
45 | |||
46 | private $id; |
||
47 | private $orgao; |
||
48 | private $identificador; |
||
49 | private $chave; |
||
50 | private $data; |
||
51 | private $tipo; |
||
52 | private $sequencia; |
||
53 | private $descricao; |
||
54 | private $numero; |
||
55 | private $justificativa; |
||
56 | private $email; |
||
57 | private $modelo; |
||
58 | private $informacao; |
||
59 | |||
60 | 9 | public function __construct($evento = []) |
|
64 | |||
65 | /** |
||
66 | * Identificador da TAG a ser assinada, a regra de formação do Id é: "ID" + |
||
67 | * tpEvento + chave da NF-e + nSeqEvento |
||
68 | */ |
||
69 | 8 | public function getID($normalize = false) |
|
76 | |||
77 | 9 | public function setID($id) |
|
82 | |||
83 | /** |
||
84 | * Código do órgão de recepção do Evento. Utilizar a Tabela do IBGE |
||
85 | * extendida, utilizar 91 para identificar o Ambiente Nacional |
||
86 | */ |
||
87 | 7 | public function getOrgao($normalize = false) |
|
96 | |||
97 | 9 | public function setOrgao($orgao) |
|
102 | |||
103 | /** |
||
104 | * Identificação do autor do evento |
||
105 | */ |
||
106 | 7 | public function getIdentificador($normalize = false) |
|
113 | |||
114 | 9 | public function setIdentificador($identificador) |
|
119 | |||
120 | /** |
||
121 | * Chave de Acesso da NF-e vinculada ao evento |
||
122 | */ |
||
123 | 7 | public function getChave($normalize = false) |
|
130 | |||
131 | 9 | public function setChave($chave) |
|
136 | |||
137 | /** |
||
138 | * Data e Hora do Evento, formato UTC (AAAA-MM-DDThh:mm:ssTZD, onde TZD = |
||
139 | * +hh:mm ou -hh:mm) |
||
140 | */ |
||
141 | 7 | public function getData($normalize = false) |
|
148 | |||
149 | 9 | public function setData($data) |
|
150 | { |
||
151 | 9 | if (!is_numeric($data)) { |
|
152 | 9 | $data = strtotime($data); |
|
153 | } |
||
154 | 9 | $this->data = $data; |
|
155 | 9 | return $this; |
|
156 | } |
||
157 | |||
158 | /** |
||
159 | * Tipo do Evento |
||
160 | */ |
||
161 | 7 | public function getTipo($normalize = false) |
|
168 | |||
169 | 9 | public function setTipo($tipo) |
|
174 | |||
175 | /** |
||
176 | * Seqüencial do evento para o mesmo tipo de evento. Para maioria dos |
||
177 | * eventos será 1, nos casos em que possa existir mais de um evento, como é |
||
178 | * o caso da carta de correção, o autor do evento deve numerar de forma |
||
179 | * seqüencial. |
||
180 | */ |
||
181 | 7 | public function getSequencia($normalize = false) |
|
188 | |||
189 | 9 | public function setSequencia($sequencia) |
|
194 | |||
195 | /** |
||
196 | * Descrição do Evento |
||
197 | */ |
||
198 | 7 | public function getDescricao($normalize = false) |
|
205 | |||
206 | 9 | public function setDescricao($descricao) |
|
211 | |||
212 | /** |
||
213 | * Número do Protocolo de Status da NF-e. 1 posição (1 – Secretaria de |
||
214 | * Fazenda Estadual 2 – Receita Federal); 2 posições ano; 10 seqüencial no |
||
215 | * ano. |
||
216 | */ |
||
217 | 7 | public function getNumero($normalize = false) |
|
224 | |||
225 | 9 | public function setNumero($numero) |
|
230 | |||
231 | /** |
||
232 | * Justificativa do cancelamento |
||
233 | */ |
||
234 | 7 | public function getJustificativa($normalize = false) |
|
241 | |||
242 | 9 | public function setJustificativa($justificativa) |
|
247 | |||
248 | /** |
||
249 | * email do destinatário |
||
250 | */ |
||
251 | 5 | public function getEmail($normalize = false) |
|
252 | { |
||
253 | 5 | if (!$normalize) { |
|
254 | 5 | return $this->email; |
|
255 | } |
||
256 | 1 | return $this->email; |
|
257 | } |
||
258 | |||
259 | 9 | public function setEmail($email) |
|
264 | |||
265 | /** |
||
266 | * Código do modelo do Documento Fiscal. 55 = NF-e; 65 = NFC-e. |
||
267 | * @param boolean $normalize informa se o modelo deve estar no formato do XML |
||
268 | * @return mixed modelo do Envio |
||
269 | */ |
||
270 | 4 | public function getModelo($normalize = false) |
|
271 | { |
||
272 | 4 | if (!$normalize) { |
|
273 | 4 | return $this->modelo; |
|
274 | } |
||
275 | 1 | switch ($this->modelo) { |
|
276 | 1 | case Nota::MODELO_NFE: |
|
277 | 1 | return '55'; |
|
278 | 1 | case Nota::MODELO_NFCE: |
|
279 | 1 | return '65'; |
|
280 | } |
||
281 | 1 | return $this->modelo; |
|
282 | } |
||
283 | |||
284 | /** |
||
285 | * Altera o valor do Modelo para o informado no parâmetro |
||
286 | * @param mixed $modelo novo valor para Modelo |
||
287 | * @return Envio A própria instância da classe |
||
288 | */ |
||
289 | 9 | public function setModelo($modelo) |
|
290 | { |
||
291 | switch ($modelo) { |
||
292 | 9 | case '55': |
|
293 | 1 | $modelo = Nota::MODELO_NFE; |
|
294 | 1 | break; |
|
295 | 9 | case '65': |
|
296 | 1 | $modelo = Nota::MODELO_NFCE; |
|
297 | 1 | break; |
|
298 | } |
||
299 | 9 | $this->modelo = $modelo; |
|
300 | 9 | return $this; |
|
301 | } |
||
302 | |||
303 | /** |
||
304 | * Resposta de informação do evento |
||
305 | */ |
||
306 | 6 | public function getInformacao() |
|
310 | |||
311 | 9 | public function setInformacao($informacao) |
|
316 | |||
317 | /** |
||
318 | * Informa se a identificação é um CNPJ |
||
319 | */ |
||
320 | 6 | public function isCNPJ() |
|
324 | |||
325 | /** |
||
326 | * Informa se o lote já foi processado e já tem um protocolo |
||
327 | */ |
||
328 | 3 | public function isProcessado() |
|
332 | |||
333 | /** |
||
334 | * Informa se a nota foi cancelada com sucesso |
||
335 | */ |
||
336 | 2 | public function isCancelado() |
|
340 | |||
341 | 2 | public function toArray($recursive = false) |
|
359 | |||
360 | 9 | public function fromArray($evento = []) |
|
361 | { |
||
362 | 9 | if ($evento instanceof Evento) { |
|
363 | 2 | $evento = $evento->toArray(); |
|
364 | 9 | } elseif (!is_array($evento)) { |
|
365 | 1 | return $this; |
|
366 | } |
||
367 | 9 | parent::fromArray($evento); |
|
368 | 9 | if (isset($evento['id'])) { |
|
369 | 1 | $this->setID($evento['id']); |
|
370 | } else { |
||
371 | 9 | $this->setID(null); |
|
372 | } |
||
373 | 9 | if (isset($evento['orgao'])) { |
|
374 | 1 | $this->setOrgao($evento['orgao']); |
|
375 | } else { |
||
376 | 9 | $this->setOrgao(null); |
|
377 | } |
||
378 | 9 | if (isset($evento['identificador'])) { |
|
379 | 1 | $this->setIdentificador($evento['identificador']); |
|
380 | } else { |
||
381 | 9 | $this->setIdentificador(null); |
|
382 | } |
||
383 | 9 | if (isset($evento['chave'])) { |
|
384 | 1 | $this->setChave($evento['chave']); |
|
385 | } else { |
||
386 | 9 | $this->setChave(null); |
|
387 | } |
||
388 | 9 | if (isset($evento['data'])) { |
|
389 | 2 | $this->setData($evento['data']); |
|
390 | } else { |
||
391 | 9 | $this->setData(null); |
|
392 | } |
||
393 | 9 | if (!isset($evento['tipo'])) { |
|
394 | 9 | $this->setTipo(self::TIPO_CANCELAMENTO); |
|
395 | } else { |
||
396 | 2 | $this->setTipo($evento['tipo']); |
|
397 | } |
||
398 | 9 | if (!isset($evento['sequencia'])) { |
|
399 | 9 | $this->setSequencia(1); |
|
400 | } else { |
||
401 | 2 | $this->setSequencia($evento['sequencia']); |
|
402 | } |
||
403 | 9 | if (!isset($evento['descricao'])) { |
|
404 | 9 | $this->setDescricao('Cancelamento'); |
|
405 | } else { |
||
406 | 2 | $this->setDescricao($evento['descricao']); |
|
407 | } |
||
408 | 9 | if (isset($evento['numero'])) { |
|
409 | 1 | $this->setNumero($evento['numero']); |
|
410 | } else { |
||
411 | 9 | $this->setNumero(null); |
|
412 | } |
||
413 | 9 | if (isset($evento['justificativa'])) { |
|
414 | 1 | $this->setJustificativa($evento['justificativa']); |
|
415 | } else { |
||
416 | 9 | $this->setJustificativa(null); |
|
417 | } |
||
418 | 9 | if (isset($evento['email'])) { |
|
419 | 1 | $this->setEmail($evento['email']); |
|
420 | } else { |
||
421 | 9 | $this->setEmail(null); |
|
422 | } |
||
423 | 9 | if (isset($evento['modelo'])) { |
|
424 | 2 | $this->setModelo($evento['modelo']); |
|
425 | } else { |
||
426 | 9 | $this->setModelo(null); |
|
427 | } |
||
428 | 9 | if (isset($evento['informacao'])) { |
|
429 | 1 | $this->setInformacao($evento['informacao']); |
|
430 | } else { |
||
431 | 9 | $this->setInformacao(null); |
|
432 | } |
||
433 | 9 | return $this; |
|
434 | } |
||
435 | |||
436 | /** |
||
437 | * Gera o ID, a regra de formação do Id é: "ID" + |
||
438 | * tpEvento + chave da NF-e + nSeqEvento |
||
439 | */ |
||
440 | 6 | public function gerarID() |
|
441 | { |
||
442 | 6 | $id = sprintf( |
|
443 | 6 | '%s%s%02d', |
|
444 | 6 | $this->getTipo(true), |
|
445 | 6 | $this->getChave(true), |
|
446 | 6 | $this->getSequencia(true) |
|
447 | ); |
||
448 | 6 | return $id; |
|
449 | } |
||
450 | |||
451 | 6 | public function getNode($name = null) |
|
452 | { |
||
453 | 6 | $this->setID($this->gerarID()); |
|
454 | |||
455 | 6 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
|
456 | 6 | $element = $dom->createElement(is_null($name)?'evento':$name); |
|
457 | 6 | $element->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', Nota::PORTAL); |
|
458 | 6 | $versao = $dom->createAttribute('versao'); |
|
459 | 6 | $versao->value = self::VERSAO; |
|
460 | 6 | $element->appendChild($versao); |
|
461 | |||
462 | 6 | $info = $dom->createElement('infEvento'); |
|
463 | 6 | $dom = $element->ownerDocument; |
|
464 | 6 | $id = $dom->createAttribute('Id'); |
|
465 | 6 | $id->value = $this->getID(true); |
|
466 | 6 | $info->appendChild($id); |
|
467 | |||
468 | 6 | Util::appendNode($info, 'cOrgao', $this->getOrgao(true)); |
|
469 | 6 | Util::appendNode($info, 'tpAmb', $this->getAmbiente(true)); |
|
470 | 6 | if ($this->isCNPJ()) { |
|
471 | 6 | Util::appendNode($info, 'CNPJ', $this->getIdentificador(true)); |
|
472 | } else { |
||
473 | 4 | Util::appendNode($info, 'CPF', $this->getIdentificador(true)); |
|
474 | } |
||
475 | 6 | Util::appendNode($info, 'chNFe', $this->getChave(true)); |
|
476 | 6 | Util::appendNode($info, 'dhEvento', $this->getData(true)); |
|
477 | 6 | Util::appendNode($info, 'tpEvento', $this->getTipo(true)); |
|
478 | 6 | Util::appendNode($info, 'nSeqEvento', $this->getSequencia(true)); |
|
479 | 6 | Util::appendNode($info, 'verEvento', self::VERSAO); |
|
480 | |||
481 | 6 | $detalhes = $dom->createElement('detEvento'); |
|
482 | 6 | $versao = $dom->createAttribute('versao'); |
|
483 | 6 | $versao->value = self::VERSAO; |
|
484 | 6 | $detalhes->appendChild($versao); |
|
485 | |||
486 | 6 | Util::appendNode($detalhes, 'descEvento', $this->getDescricao(true)); |
|
487 | 6 | Util::appendNode($detalhes, 'nProt', $this->getNumero(true)); |
|
488 | 6 | Util::appendNode($detalhes, 'xJust', $this->getJustificativa(true)); |
|
489 | 6 | $info->appendChild($detalhes); |
|
490 | |||
491 | 6 | $element->appendChild($info); |
|
492 | 6 | $dom->appendChild($element); |
|
493 | 6 | return $element; |
|
494 | } |
||
495 | |||
496 | 2 | public function loadNode($element, $name = null) |
|
497 | { |
||
498 | 2 | $root = $element; |
|
499 | 2 | $element = Util::findNode($element, 'evento'); |
|
500 | 2 | $name = is_null($name)?'infEvento':$name; |
|
501 | 2 | $element = Util::findNode($element, $name); |
|
502 | 2 | $this->setOrgao( |
|
503 | 2 | Util::loadNode( |
|
504 | 2 | $element, |
|
505 | 2 | 'cOrgao', |
|
506 | 2 | 'Tag "cOrgao" não encontrada no Evento' |
|
507 | ) |
||
508 | ); |
||
509 | 2 | $this->setAmbiente( |
|
510 | 2 | Util::loadNode( |
|
511 | 2 | $element, |
|
512 | 2 | 'tpAmb', |
|
513 | 2 | 'Tag "tpAmb" não encontrada no Evento' |
|
514 | ) |
||
515 | ); |
||
516 | 2 | if (Util::nodeExists($element, 'CNPJ')) { |
|
517 | 2 | $this->setIdentificador( |
|
518 | 2 | Util::loadNode( |
|
519 | 2 | $element, |
|
520 | 2 | 'CNPJ', |
|
521 | 2 | 'Tag "CNPJ" não encontrada no Evento' |
|
522 | ) |
||
523 | ); |
||
524 | } else { |
||
525 | $this->setIdentificador( |
||
526 | Util::loadNode( |
||
527 | $element, |
||
528 | 'CPF', |
||
529 | 'Tag "CPF" não encontrada no Evento' |
||
530 | ) |
||
531 | ); |
||
532 | } |
||
533 | 2 | $this->setChave( |
|
534 | 2 | Util::loadNode( |
|
535 | 2 | $element, |
|
536 | 2 | 'chNFe', |
|
537 | 2 | 'Tag "chNFe" não encontrada no Evento' |
|
538 | ) |
||
539 | ); |
||
540 | 2 | $this->setData( |
|
541 | 2 | Util::loadNode( |
|
542 | 2 | $element, |
|
543 | 2 | 'dhEvento', |
|
544 | 2 | 'Tag "dhEvento" não encontrada no Evento' |
|
545 | ) |
||
546 | ); |
||
547 | 2 | $this->setTipo( |
|
548 | 2 | Util::loadNode( |
|
549 | 2 | $element, |
|
550 | 2 | 'tpEvento', |
|
551 | 2 | 'Tag "tpEvento" não encontrada no Evento' |
|
552 | ) |
||
553 | ); |
||
554 | 2 | $this->setSequencia( |
|
555 | 2 | Util::loadNode( |
|
556 | 2 | $element, |
|
557 | 2 | 'nSeqEvento', |
|
558 | 2 | 'Tag "nSeqEvento" não encontrada no Evento' |
|
559 | ) |
||
560 | ); |
||
561 | |||
562 | 2 | $detalhes = Util::findNode($element, 'detEvento'); |
|
563 | 2 | $this->setDescricao( |
|
564 | 2 | Util::loadNode( |
|
565 | 2 | $detalhes, |
|
566 | 2 | 'descEvento', |
|
567 | 2 | 'Tag "descEvento" não encontrada no Evento' |
|
568 | ) |
||
569 | ); |
||
570 | 2 | $this->setNumero( |
|
571 | 2 | Util::loadNode( |
|
572 | 2 | $detalhes, |
|
573 | 2 | 'nProt', |
|
574 | 2 | 'Tag "nProt" não encontrada no Evento' |
|
575 | ) |
||
576 | ); |
||
577 | 2 | $this->setJustificativa( |
|
578 | 2 | Util::loadNode( |
|
579 | 2 | $detalhes, |
|
580 | 2 | 'xJust', |
|
581 | 2 | 'Tag "xJust" não encontrada no Evento' |
|
582 | ) |
||
583 | ); |
||
584 | 2 | $informacao = null; |
|
585 | 2 | if (Util::nodeExists($root, 'procEventoNFe')) { |
|
586 | 2 | $informacao = $this->loadResponse($root); |
|
587 | } |
||
588 | 2 | $this->setInformacao($informacao); |
|
589 | 2 | return $element; |
|
590 | } |
||
591 | |||
592 | 5 | public function loadResponse($resp) |
|
599 | |||
600 | 5 | public function loadStatusNode($element, $name = null) |
|
601 | { |
||
602 | 5 | $name = is_null($name)?self::TAG_RETORNO_ENVIO:$name; |
|
603 | 5 | $element = parent::loadNode($element, $name); |
|
604 | 5 | $this->setOrgao( |
|
605 | 5 | Util::loadNode( |
|
606 | 5 | $element, |
|
607 | 5 | 'cOrgao', |
|
608 | 5 | 'Tag "cOrgao" do campo "Orgao" não encontrada' |
|
609 | ) |
||
610 | ); |
||
611 | 5 | return $element; |
|
612 | } |
||
613 | |||
614 | 4 | public function getReturnNode() |
|
615 | { |
||
616 | 4 | $outros = parent::getNode('infEvento'); |
|
617 | 4 | $element = $this->getNode(self::TAG_RETORNO); |
|
618 | 4 | $dom = $element->ownerDocument; |
|
619 | 4 | $element->removeAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns'); |
|
620 | 4 | $info = $dom->getElementsByTagName('infEvento')->item(0); |
|
621 | 4 | $info->removeAttribute('Id'); |
|
622 | 4 | $remove_tags = ['detEvento', 'verEvento', 'dhEvento', 'CNPJ', 'CPF', 'cOrgao']; |
|
623 | 4 | foreach ($remove_tags as $key) { |
|
624 | 4 | $_fields = $info->getElementsByTagName($key); |
|
625 | 4 | if ($_fields->length == 0) { |
|
626 | 4 | continue; |
|
627 | } |
||
628 | 4 | $node = $_fields->item(0); |
|
629 | 4 | $info->removeChild($node); |
|
630 | } |
||
631 | 4 | $chave = $info->getElementsByTagName('chNFe')->item(0); |
|
632 | 4 | foreach ($outros->childNodes as $node) { |
|
633 | 4 | $node = $dom->importNode($node, true); |
|
634 | 4 | $list = $info->getElementsByTagName($node->nodeName); |
|
635 | 4 | if ($list->length == 1) { |
|
636 | 4 | continue; |
|
637 | } |
||
638 | 4 | $info->insertBefore($node, $chave); |
|
639 | } |
||
640 | 4 | $status = $info->getElementsByTagName('cStat')->item(0); |
|
641 | 4 | Util::appendNode($info, 'cOrgao', $this->getOrgao(true), $status); |
|
642 | 4 | $sequencia = $info->getElementsByTagName('nSeqEvento')->item(0); |
|
643 | 4 | Util::appendNode($info, 'xEvento', $this->getDescricao(true), $sequencia); |
|
644 | 4 | if (!is_null($this->getIdentificador())) { |
|
645 | if ($this->isCNPJ()) { |
||
646 | Util::appendNode($info, 'CNPJDest', $this->getIdentificador(true)); |
||
647 | } else { |
||
648 | Util::appendNode($info, 'CPFDest', $this->getIdentificador(true)); |
||
649 | } |
||
650 | } |
||
651 | 4 | if (!is_null($this->getEmail())) { |
|
652 | Util::appendNode($info, 'emailDest', $this->getEmail(true)); |
||
653 | } |
||
654 | 4 | Util::appendNode($info, 'dhRegEvento', $this->getData(true)); |
|
655 | 4 | Util::appendNode($info, 'nProt', $this->getNumero(true)); |
|
656 | 4 | return $element; |
|
657 | } |
||
658 | |||
659 | 5 | public function loadReturnNode($element, $name = null) |
|
660 | { |
||
661 | 5 | $element = Util::findNode($element, Evento::TAG_RETORNO); |
|
662 | 5 | $name = is_null($name)?'infEvento':$name; |
|
663 | 5 | $element = parent::loadNode($element, $name); |
|
664 | 5 | $this->setOrgao( |
|
665 | 5 | Util::loadNode( |
|
666 | 5 | $element, |
|
667 | 5 | 'cOrgao', |
|
668 | 5 | 'Tag "cOrgao" do campo "Orgao" não encontrada' |
|
669 | ) |
||
670 | ); |
||
671 | 5 | $this->setChave(Util::loadNode($element, 'chNFe')); |
|
672 | 5 | $this->setTipo(Util::loadNode($element, 'tpEvento')); |
|
673 | 5 | $this->setDescricao(Util::loadNode($element, 'xEvento')); |
|
674 | 5 | $this->setSequencia(Util::loadNode($element, 'nSeqEvento')); |
|
675 | 5 | if ($element->getElementsByTagName('CNPJDest')->length > 0) { |
|
676 | $this->setIdentificador(Util::loadNode($element, 'CNPJDest')); |
||
677 | } else { |
||
678 | 5 | $this->setIdentificador(Util::loadNode($element, 'CPFDest')); |
|
679 | } |
||
680 | 5 | $this->setEmail(Util::loadNode($element, 'emailDest')); |
|
681 | 5 | $this->setData( |
|
682 | 5 | Util::loadNode( |
|
683 | 5 | $element, |
|
684 | 5 | 'dhRegEvento', |
|
685 | 5 | 'Tag "dhRegEvento" do campo "Data" não encontrada' |
|
686 | ) |
||
687 | ); |
||
688 | 5 | $this->setNumero(Util::loadNode($element, 'nProt')); |
|
689 | 5 | return $element; |
|
690 | } |
||
691 | |||
692 | 3 | private function getConteudo($dom) |
|
712 | |||
713 | 3 | public function envia($dom) |
|
714 | { |
||
715 | 3 | $envio = new Envio(); |
|
716 | 3 | $envio->setServico(Envio::SERVICO_EVENTO); |
|
717 | 3 | $envio->setAmbiente($this->getAmbiente()); |
|
718 | 3 | $envio->setModelo($this->getModelo()); |
|
719 | 3 | $envio->setEmissao(Nota::EMISSAO_NORMAL); |
|
720 | 3 | $this->setVersao($envio->getVersao()); |
|
721 | 3 | $dom = $this->validar($dom); |
|
722 | 3 | $envio->setConteudo($this->getConteudo($dom)); |
|
723 | 3 | $resp = $envio->envia(); |
|
730 | |||
731 | /** |
||
732 | * Adiciona a informação no XML do evento |
||
733 | */ |
||
734 | 5 | public function addInformacao($dom) |
|
764 | |||
765 | /** |
||
766 | * Assina o XML com a assinatura eletrônica do tipo A1 |
||
767 | */ |
||
768 | 6 | public function assinar($dom = null) |
|
785 | |||
786 | /** |
||
787 | * Valida o documento após assinar |
||
788 | */ |
||
789 | 6 | public function validar($dom) |
|
812 | } |
||
813 |
The class complexity is the sum of the complexity of all methods. A very high value is usually an indication that your class does not follow the single reponsibility principle and does more than one job.
Some resources for further reading:
You can also find more detailed suggestions for refactoring in the “Code” section of your repository.