FactoryId::build()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace NFePHP\eFinanc\Common;
4
5
/**
6
 * Class FactoryId build ID event reference
7
 *
8
 * @category  API
9
 * @package   NFePHP\eFinanc
10
 * @copyright Copyright (c) 2018
11
 * @license   http://www.gnu.org/licenses/lesser.html LGPL v3
12
 * @author    Roberto L. Machado <linux.rlm at gmail dot com>
13
 * @link      http://github.com/nfephp-org/sped-efinanceira for the canonical source repository
14
 */
15
use DateTime;
16
17
class FactoryId
18
{
19
    /**
20
     * Build Id for EFDReinf event
21
     * @param int $sequential
22
     * @return string
23
     */
24
    public static function build($sequential)
25
    {
26
        if (empty($sequential)) {
27
            $sequential = 1;
28
        }
29
        return "ID".str_pad($sequential, 18, '0', STR_PAD_LEFT);
30
    }
31
}
32