Test Failed
Pull Request — master (#304)
by Roberto
02:29
created

EvtFGTS::toNode()   C

Complexity

Conditions 13
Paths 15

Size

Total Lines 134

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 182

Importance

Changes 0
Metric Value
dl 0
loc 134
ccs 0
cts 128
cp 0
rs 5.2933
c 0
b 0
f 0
cc 13
nc 15
nop 0
crap 182

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