Completed
Push — master ( 2973a2...01fa63 )
by Roberto
04:58 queued 02:26
created

EvtTSVAltContr::toNode()   F

Complexity

Conditions 22
Paths 72

Size

Total Lines 282

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 506

Importance

Changes 0
Metric Value
dl 0
loc 282
ccs 0
cts 279
cp 0
rs 3.3333
c 0
b 0
f 0
cc 22
nc 72
nop 0
crap 506

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace NFePHP\eSocial\Factories;
4
5
/**
6
 * Class eSocial EvtTSVAltContr Event S-2306 constructor
7
8
 * Read for 2.5.0 layout
9
 *
10
 * @category  library
11
 * @package   NFePHP\eSocial
12
 * @copyright NFePHP Copyright (c) 2017
13
 * @license   http://www.gnu.org/licenses/lgpl.txt LGPLv3+
14
 * @license   https://opensource.org/licenses/MIT MIT
15
 * @license   http://www.gnu.org/licenses/gpl.txt GPLv3+
16
 * @author    Roberto L. Machado <linux.rlm at gmail dot com>
17
 * @link      http://github.com/nfephp-org/sped-esocial for the canonical source repository
18
 */
19
20
use NFePHP\Common\Certificate;
21
use NFePHP\eSocial\Common\Factory;
22
use NFePHP\eSocial\Common\FactoryId;
23
use NFePHP\eSocial\Common\FactoryInterface;
24
use stdClass;
25
26
class EvtTSVAltContr extends Factory implements FactoryInterface
27
{
28
    /**
29
     * @var int
30
     */
31
    public $sequencial;
32
    /**
33
     * @var string
34
     */
35
    protected $evtName = 'evtTSVAltContr';
36
    /**
37
     * @var string
38
     */
39
    protected $evtAlias = 'S-2306';
40
    /**
41
     * Parameters patterns
42
     *
43
     * @var array
44
     */
45
    protected $parameters = [];
46
    
47
    //Trait que contêm os métodos construtores das versões diferentes ainda ativas
48
    //quando uma versão for desativada o metodo correspondente pode e deve ser removido
49
    use Traits\TraitS2306;
50
51
    /**
52
     * Constructor
53
     *
54
     * @param string $config
55
     * @param stdClass $std
56
     * @param Certificate $certificate | null
57
     * @param string $date
58
     */
59
    public function __construct(
60
        $config,
61
        stdClass $std,
62
        Certificate $certificate = null,
63
        $date = ''
64
    ) {
65
        parent::__construct($config, $std, $certificate, $date);
66
    }
67
}
68