|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace NFePHP\EFDReinf\Factories; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class EFD-Reinf EvtFech Event R-4099 constructor |
|
7
|
|
|
* |
|
8
|
|
|
* @category API |
|
9
|
|
|
* @package NFePHP\EFDReinf |
|
10
|
|
|
* @copyright NFePHP Copyright (c) 2017-2019 |
|
11
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPLv3+ |
|
12
|
|
|
* @license https://opensource.org/licenses/MIT MIT |
|
13
|
|
|
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+ |
|
14
|
|
|
* @author Roberto L. Machado <linux.rlm at gmail dot com> |
|
15
|
|
|
* @link http://github.com/nfephp-org/sped-efdreinf for the canonical source repository |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
use NFePHP\EFDReinf\Common\Factory; |
|
19
|
|
|
use NFePHP\EFDReinf\Common\FactoryInterface; |
|
20
|
|
|
use NFePHP\EFDReinf\Common\FactoryId; |
|
21
|
|
|
use NFePHP\Common\Certificate; |
|
22
|
|
|
use stdClass; |
|
23
|
|
|
|
|
24
|
|
|
class EvtFech extends Factory implements FactoryInterface |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* Constructor |
|
28
|
|
|
* @param string $config |
|
29
|
|
|
* @param stdClass $std |
|
30
|
|
|
* @param Certificate $certificate |
|
31
|
|
|
* @param string $data |
|
32
|
|
|
*/ |
|
33
|
|
|
public function __construct( |
|
34
|
|
|
$config, |
|
35
|
|
|
stdClass $std, |
|
36
|
|
|
Certificate $certificate = null, |
|
37
|
|
|
$data = '' |
|
38
|
|
|
) { |
|
39
|
|
|
$params = new \stdClass(); |
|
40
|
|
|
$params->evtName = 'evtFech'; |
|
41
|
|
|
$params->evtTag = 'evtFech'; |
|
42
|
|
|
$params->evtAlias = 'R-4099'; |
|
43
|
|
|
parent::__construct($config, $std, $params, $certificate, $data); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Node constructor |
|
48
|
|
|
*/ |
|
49
|
|
|
protected function toNode() |
|
50
|
|
|
{ |
|
51
|
|
|
$ideContri = $this->node->getElementsByTagName('ideContri')->item(0); |
|
|
|
|
|
|
52
|
|
|
//o idEvento pode variar de evento para evento |
|
53
|
|
|
//então cada factory individualmente terá de construir o seu |
|
54
|
|
|
$ideEvento = $this->dom->createElement("ideEvento"); |
|
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
$this->reinf->appendChild($this->node); |
|
58
|
|
|
//$this->xml = $this->dom->saveXML($this->reinf); |
|
|
|
|
|
|
59
|
|
|
$this->sign($this->evtTag); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.