Passed
Push — master ( b6c7f7...cb9572 )
by Roberto
09:19 queued 06:19
created

Dacte::cteDPEC()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace NFePHP\DA\CTe;
4
5
/**
6
 * Classe para ageração do PDF da CTe, conforme regras e estruturas
7
 * estabelecidas pela SEFAZ.
8
 *
9
 * @category  Library
10
 * @package   nfephp-org/sped-da
11
 * @name      Dacte .php
12
 * @copyright 2009-2019 NFePHP
13
 * @license   http://www.gnu.org/licenses/lesser.html LGPL v3
14
 * @link      http://github.com/nfephp-org/sped-da for the canonical source repository
15
 * @author    Roberto L. Machado <linux dot rlm at gmail dot com>
16
 */
17
18
use Com\Tecnick\Barcode\Barcode;
19
use Exception;
20
use NFePHP\DA\Legacy\Dom;
21
use NFePHP\DA\Legacy\Pdf;
22
use NFePHP\DA\Common\DaCommon;
23
24
class Dacte extends DaCommon
25
{
26
27
    protected $yDados = 0;
28
    protected $xml;
29
    protected $errMsg = '';
30
    protected $errStatus = false;
31
    
32
    protected $dom;
33
    protected $infCte;
34
    protected $infCteComp;
35
    protected $infCteAnu;
36
    protected $chaveCTeRef;
37
    protected $tpCTe;
38
    protected $ide;
39
    protected $emit;
40
    protected $enderEmit;
41
    protected $rem;
42
    protected $enderReme;
43
    protected $dest;
44
    protected $enderDest;
45
    protected $exped;
46
    protected $enderExped;
47
    protected $receb;
48
    protected $enderReceb;
49
    protected $infCarga;
50
    protected $infQ;
51
    protected $seg;
52
    protected $modal;
53
    protected $rodo;
54
    protected $moto;
55
    protected $veic;
56
    protected $ferrov;
57
    protected $Comp;
58
    protected $infNF;
59
    protected $infNFe;
60
    protected $compl;
61
    protected $ICMS;
62
    protected $ICMSSN;
63
    protected $ICMSOutraUF;
64
    protected $imp;
65
    protected $toma4;
66
    protected $toma03;
67
    protected $tpEmis;
68
    protected $tpImp;
69
    protected $tpAmb;
70
    protected $vPrest;
71
    protected $textoAdic = '';
72
    protected $aquav;
73
    protected $idDocAntEle = [];
74
    protected $qrCodCTe;
75
    protected $infCTeMultimodal = [];
76
    
77
    protected $wAdic = 150;
78
    protected $formatNegrito;
79
    protected $preVisualizar;
80
    protected $flagDocOrigContinuacao;
81
    protected $arrayNFe = array();
82
    protected $totPag;
83
    protected $margemInterna = 0;
84
    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
85
86
    /**
87
     * __construct
88
     *
89
     * @param string $xml Arquivo XML da CTe
90
     */
91
    public function __construct(
92
        $xml = ''
93
    ) {
94
        $this->loadDoc($xml);
95
    }
96
97
    private function loadDoc($xml)
98
    {
99
        $this->xml = $xml;
100
        if (!empty($xml)) {
101
            $this->dom = new Dom();
102
            $this->dom->loadXML($this->xml);
103
            $this->cteProc = $this->dom->getElementsByTagName("cteProc")->item(0);
0 ignored issues
show
Bug introduced by
The property cteProc does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
104
            if (empty($this->dom->getElementsByTagName("infCte")->item(0))) {
105
                throw new \Exception('Isso não é um CT-e.');
106
            }
107
            $this->infCte = $this->dom->getElementsByTagName("infCte")->item(0);
108
            $this->ide = $this->dom->getElementsByTagName("ide")->item(0);
109
            if ($this->getTagValue($this->ide, "mod") != '57') {
110
                throw new \Exception("O xml deve ser CT-e modelo 57.");
111
            }
112
            $this->tpCTe = $this->getTagValue($this->ide, "tpCTe");
113
            $this->emit = $this->dom->getElementsByTagName("emit")->item(0);
114
            $this->enderEmit = $this->dom->getElementsByTagName("enderEmit")->item(0);
115
            $this->rem = $this->dom->getElementsByTagName("rem")->item(0);
116
            $this->enderReme = $this->dom->getElementsByTagName("enderReme")->item(0);
117
            $this->dest = $this->dom->getElementsByTagName("dest")->item(0);
118
            $this->enderDest = $this->dom->getElementsByTagName("enderDest")->item(0);
119
            $this->exped = $this->dom->getElementsByTagName("exped")->item(0);
120
            $this->enderExped = $this->dom->getElementsByTagName("enderExped")->item(0);
121
            $this->receb = $this->dom->getElementsByTagName("receb")->item(0);
122
            $this->enderReceb = $this->dom->getElementsByTagName("enderReceb")->item(0);
123
            $this->infCarga = $this->dom->getElementsByTagName("infCarga")->item(0);
124
            $this->infQ = $this->dom->getElementsByTagName("infQ");
125
            $this->seg = $this->dom->getElementsByTagName("seg")->item(0);
126
            $this->rodo = $this->dom->getElementsByTagName("rodo")->item(0);
127
            $this->aereo = $this->dom->getElementsByTagName("aereo")->item(0);
0 ignored issues
show
Bug introduced by
The property aereo does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
128
            $this->lota = $this->getTagValue($this->rodo, "lota");
0 ignored issues
show
Bug introduced by
The property lota does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
129
            $this->moto = $this->dom->getElementsByTagName("moto")->item(0);
130
            $this->veic = $this->dom->getElementsByTagName("veic");
131
            $this->ferrov = $this->dom->getElementsByTagName("ferrov")->item(0);
132
            // adicionar outros modais
133
            $this->infCteComp = $this->dom->getElementsByTagName("infCteComp")->item(0);
134
            $this->infCteAnu = $this->dom->getElementsByTagName("infCteAnu")->item(0);
135
            if ($this->tpCTe == 1) {
136
                $this->chaveCTeRef = $this->getTagValue($this->infCteComp, "chCTe");
137
            } else {
138
                $this->chaveCTeRef = $this->getTagValue($this->infCteAnu, "chCte");
139
            }
140
            $this->vPrest = $this->dom->getElementsByTagName("vPrest")->item(0);
141
            $this->Comp = $this->dom->getElementsByTagName("Comp");
142
            $this->infNF = $this->dom->getElementsByTagName("infNF");
143
            $this->infNFe = $this->dom->getElementsByTagName("infNFe");
144
            $this->infOutros = $this->dom->getElementsByTagName("infOutros");
0 ignored issues
show
Bug introduced by
The property infOutros does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
145
            $this->infCTeMultimodal = $this->dom->getElementsByTagName("infCTeMultimodal");
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->dom->getElementsB...ame('infCTeMultimodal') of type object<DOMNodeList> is incompatible with the declared type array of property $infCTeMultimodal.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
146
            $this->compl = $this->dom->getElementsByTagName("compl");
147
            $this->ICMS = $this->dom->getElementsByTagName("ICMS")->item(0);
148
            $this->ICMSSN = $this->dom->getElementsByTagName("ICMSSN")->item(0);
149
            $this->ICMSOutraUF = $this->dom->getElementsByTagName("ICMSOutraUF")->item(0);
150
            $this->imp = $this->dom->getElementsByTagName("imp")->item(0);
151
            if (!empty($this->getTagValue($this->imp, "vTotTrib"))) {
152
                $textoAdic = number_format($this->getTagValue($this->imp, "vTotTrib"), 2, ",", ".");
153
                $this->textoAdic = "o valor aproximado de tributos incidentes sobre o preço deste serviço é de R$"
154
                    . $textoAdic;
155
            }
156
            $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0);
157
            $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0);
158
            //Tag tomador é identificado por toma03 na versão 2.00
159
            if ($this->infCte->getAttribute("versao") == "2.00") {
160
                $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0);
161
            }
162
            //modal aquaviário
163
            $this->aquav = $this->dom->getElementsByTagName("aquav")->item(0);
164
            $tomador = $this->getTagValue($this->toma03, "toma");
165
            //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4-Outros
166
            switch ($tomador) {
167
                case '0':
168
                    $this->toma = $this->rem;
0 ignored issues
show
Bug introduced by
The property toma does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
169
                    $this->enderToma = $this->enderReme;
0 ignored issues
show
Bug introduced by
The property enderToma does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
170
                    break;
171
                case '1':
172
                    $this->toma = $this->exped;
173
                    $this->enderToma = $this->enderExped;
174
                    break;
175
                case '2':
176
                    $this->toma = $this->receb;
177
                    $this->enderToma = $this->enderReceb;
178
                    break;
179
                case '3':
180
                    $this->toma = $this->dest;
181
                    $this->enderToma = $this->enderDest;
182
                    break;
183
                default:
184
                    $this->toma = $this->toma4;
185
                    $this->enderToma = $this->getTagValue($this->toma4, "enderToma");
186
                    break;
187
            }
188
            $this->tpEmis = $this->getTagValue($this->ide, "tpEmis");
189
            $this->tpImp = $this->getTagValue($this->ide, "tpImp");
190
            $this->tpAmb = $this->getTagValue($this->ide, "tpAmb");
191
            $this->tpCTe = $this->getTagValue($this->ide, "tpCTe");
192
            $this->qrCodCTe = $this->dom->getElementsByTagName('qrCodCTe')->item(0) ?
193
                $this->dom->getElementsByTagName('qrCodCTe')->item(0)->nodeValue : 'SEM INFORMAÇÃO DE QRCODE';
194
            $this->protCTe = $this->dom->getElementsByTagName("protCTe")->item(0);
0 ignored issues
show
Bug introduced by
The property protCTe does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
195
            //01-Rodoviário; //02-Aéreo; //03-Aquaviário; //04-Ferroviário;//05-Dutoviário
196
            $this->modal = $this->getTagValue($this->ide, "modal");
197
        }
198
    }
199
200
    /**
201
     * montaDACTE
202
     * Esta função monta a DACTE conforme as informações fornecidas para a classe
203
     * durante sua construção.
204
     * A definição de margens e posições iniciais para a impressão são estabelecidas no
205
     * pelo conteúdo da funçao e podem ser modificados.
206
     *
207
     * @param  string $orientacao (Opcional) Estabelece a orientação da
0 ignored issues
show
Bug introduced by
There is no parameter named $orientacao. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
208
     *                impressão (ex. P-retrato), se nada for fornecido será
209
     *                usado o padrão da NFe
210
     * @param  string $papel (Opcional) Estabelece o tamanho do papel (ex. A4)
0 ignored issues
show
Bug introduced by
There is no parameter named $papel. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
211
     * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
212
     */
213
    protected function monta(
214
        $logo = ''
215
    ) {
216
        if (!empty($logo)) {
217
            $this->logomarca = $this->adjustImage($logo);
218
        }
219
        $this->pdf = '';
0 ignored issues
show
Documentation Bug introduced by
It seems like '' of type string is incompatible with the declared type object<NFePHP\DA\Legacy\Pdf> of property $pdf.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
220
        //pega o orientação do documento
221
        if (empty($this->orientacao)) {
222
            $this->orientacao = 'P';
223
            if ($this->tpImp == 2) {
224
                $this->orientacao = 'L';
225
            }
226
        }
227
        //instancia a classe pdf
228
        $this->pdf = new Pdf($this->orientacao, 'mm', $this->papel);
0 ignored issues
show
Bug introduced by
It seems like $this->papel can also be of type array; however, NFePHP\DA\Legacy\Pdf::__construct() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
229
        // verifica se foi passa a fonte a ser usada
230
        $this->formatPadrao = array(
0 ignored issues
show
Bug introduced by
The property formatPadrao does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
231
            'font' => $this->fontePadrao,
232
            'size' => 6,
233
            'style' => '');
234
        $this->formatNegrito = array(
235
            'font' => $this->fontePadrao,
236
            'size' => 7,
237
            'style' => 'B');
238
        if ($this->orientacao == 'P') {
239
            // margens do PDF
240
            $margSup = 2;
241
            $margEsq = 2;
242
            $margDir = 2;
243
            // posição inicial do relatorio
244
            $xInic = 1;
245
            $yInic = 1;
246
            if ($this->papel == 'A4') {
247
                //A4 210x297mm
248
                $maxW = 210;
249
                $maxH = 297;
250
            }
251
        } else {
252
            // margens do PDF
253
            $margSup = 3;
254
            $margEsq = 3;
255
            $margDir = 3;
256
            // posição inicial do relatorio
257
            $xInic = 5;
258
            $yInic = 5;
259
            if ($this->papel == 'A4') {
260
                //A4 210x297mm
261
                $maxH = 210;
262
                $maxW = 297;
263
                $this->wCanhoto = 25;
0 ignored issues
show
Bug introduced by
The property wCanhoto does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
264
            }
265
        }
266
        //total inicial de paginas
267
        $totPag = 1;
0 ignored issues
show
Unused Code introduced by
$totPag is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
268
        //largura imprimivel em mm
269
        $this->wPrint = $maxW - ($margEsq + $xInic);
0 ignored issues
show
Bug introduced by
The variable $maxW does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Documentation Bug introduced by
The property $wPrint was declared of type double, but $maxW - ($margEsq + $xInic) is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
270
        //comprimento imprimivel em mm
271
        $this->hPrint = $maxH - ($margSup + $yInic);
0 ignored issues
show
Bug introduced by
The variable $maxH does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Documentation Bug introduced by
The property $hPrint was declared of type double, but $maxH - ($margSup + $yInic) is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
272
        // estabelece contagem de paginas
273
        $this->pdf->aliasNbPages();
274
        // fixa as margens
275
        $this->pdf->setMargins($margEsq, $margSup, $margDir);
276
        $this->pdf->setDrawColor(0, 0, 0);
277
        $this->pdf->setFillColor(255, 255, 255);
278
        // inicia o documento
279
        $this->pdf->Open();
280
        // adiciona a primeira página
281
        $this->pdf->addPage($this->orientacao, $this->papel);
0 ignored issues
show
Bug introduced by
It seems like $this->papel can also be of type array; however, NFePHP\DA\Legacy\FPDF\Fpdf::addPage() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
282
        $this->pdf->setLineWidth(0.1);
283
        $this->pdf->setTextColor(0, 0, 0);
284
        //calculo do numero de páginas ???
285
        $totPag = 1;
286
        //montagem da primeira página
287
        $pag = 1;
288
        $x = $xInic;
289
        $y = $yInic;
290
        //coloca o cabeçalho
291
        $y = $this->canhoto($x, $y);
292
        $y += 24;
293
        $r = $this->cabecalho($x, $y, $pag, $totPag);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
294
        $y += 70;
295
        $r = $this->remetente($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
296
        $x = $this->wPrint * 0.5 + 2;
297
        $r = $this->destinatario($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
298
        $y += 19;
299
        $x = $xInic;
300
        $r = $this->expedidor($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
301
        $x = $this->wPrint * 0.5 + 2;
302
        $r = $this->recebedor($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
303
        $y += 19;
304
        $x = $xInic;
305
        $r = $this->tomador($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
306
        if ($this->tpCTe == '0') {
307
            //Normal
308
            $y += 10;
309
            $x = $xInic;
310
            $r = $this->descricaoCarga($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
311
            $y += 17;
312
            $x = $xInic;
313
            $r = $this->compValorServ($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
314
            $y += 25;
315
            $x = $xInic;
316
            $r = $this->impostos($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
317
            $y += 13;
318
            $x = $xInic;
319
            $r = $this->docOrig($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
320
            if ($this->modal == '1') {
321
                if ($this->lota == 1) {
322
                    //$y += 24.95;
323
                    $y += 35;
324
                } else {
325
                    $y += 53;
326
                }
327
            } elseif ($this->modal == '2') {
328
                $y += 53;
329
            } elseif ($this->modal == '3') {
330
                $y += 37.75;
331
            } else {
332
                $y += 24.95;
333
            }
334
            $x = $xInic;
335
            $r = $this->observacao($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
336
            $y = $y - 6;
337
            switch ($this->modal) {
338
                case '1':
339
                    $y += 25.9;
340
                    $x = $xInic;
341
                    $r = $this->modalRod($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
342
                    break;
343
                case '2':
344
                    $y += 25.9;
345
                    $x = $xInic;
346
                    $r = $this->modalAereo($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
347
                    break;
348
                case '3':
349
                    $y += 17.9;
350
                    $x = $xInic;
351
                    $r = $this->modalAquaviario($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
352
                    break;
353
                case '4':
354
                    $y += 17.9;
355
                    $x = $xInic;
356
                    $r = $this->modalFerr($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
357
                    break;
358
                case '5':
359
                    $y += 17.9;
360
                    $x = $xInic;
361
                    // TODO fmertins 31/10/14: este método não existe...
362
                    $r = $this->modalDutoviario($x, $y);
0 ignored issues
show
Bug introduced by
The method modalDutoviario() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
363
                    break;
364
            }
365
            if ($this->modal == '1') {
366
                if ($this->lota == 1) {
367
                    $y += 37;
368
                } else {
369
                    $y += 8.9;
370
                }
371
            } elseif ($this->modal == '2') {
372
                $y += 8.9;
373
            } elseif ($this->modal == '3') {
374
                $y += 24.15;
375
            } else {
376
                $y += 37;
377
            }
378
        } else {
379
            //$r = $this->cabecalho(1, 1, $pag, $totPag);
380
            //Complementado
381
            $y += 10;
382
            $x = $xInic;
383
            $r = $this->docCompl($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
384
            $y += 80;
385
            $x = $xInic;
386
            $r = $this->compValorServ($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
387
            $y += 25;
388
            $x = $xInic;
389
            $r = $this->impostos($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
390
            $y += 13;
391
            $x = $xInic;
392
            $r = $this->observacao($x, $y);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
393
            $y += 15;
394
        }
395
        $x = $xInic;
396
        $r = $this->dadosAdic($x, $y, $pag, $totPag);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
397
        //$y += 19;
398
        //$y += 11;
399
        //$y = $this->canhoto($x, $y);
400
        //coloca o rodapé da página
401
        if ($this->orientacao == 'P') {
402
            $this->rodape(2, $this->hPrint - 2);
403
        } else {
404
            $this->rodape($xInic, $this->hPrint + 2.3);
405
        }
406
        if ($this->flagDocOrigContinuacao == 1) {
407
            $this->docOrigContinuacao(1, 71);
408
        }
409
    }
410
411
    /**
412
     * cabecalho
413
     * Monta o cabelhalho da DACTE ( retrato e paisagem )
414
     *
415
     * @param  number $x Posição horizontal inicial, canto esquerdo
416
     * @param  number $y Posição vertical inicial, canto superior
417
     * @param  number $pag Número da Página
418
     * @param  number $totPag Total de páginas
419
     * @return number Posição vertical final
420
     */
421
    protected function cabecalho($x = 0, $y = 0, $pag = '1', $totPag = '1')
422
    {
423
        $oldX = $x;
424
        $oldY = $y;
425
        if ($this->orientacao == 'P') {
426
            $maxW = $this->wPrint;
427
        } else {
428
            if ($pag == 1) {
429
                // primeira página
430
                $maxW = $this->wPrint - $this->wCanhoto;
431
            } else {
432
                // páginas seguintes
433
                $maxW = $this->wPrint;
434
            }
435
        }
436
        //##################################################################
437
        //coluna esquerda identificação do emitente
438
        //$w = round($maxW * 0.42);
439
        $w = round($maxW * 0.32);
440
        if ($this->orientacao == 'P') {
441
            $aFont = array(
0 ignored issues
show
Unused Code introduced by
$aFont is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
442
                'font' => $this->fontePadrao,
443
                'size' => 6,
444
                'style' => '');
445
        } else {
446
            $aFont = $this->formatNegrito;
0 ignored issues
show
Unused Code introduced by
$aFont is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
447
        }
448
        $w1 = $w;
0 ignored issues
show
Unused Code introduced by
$w1 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
449
        $h = 35;
450
        $oldY += $h;
451
        //desenha a caixa
452
        $this->pdf->textBox($x, $y, $w + 2, $h + 1);
453
        // coloca o logo
454
        if (!empty($this->logomarca)) {
455
            $logoInfo = getimagesize($this->logomarca);
456
            //largura da imagem em mm
457
            $logoWmm = ($logoInfo[0] / 72) * 25.4;
458
            //altura da imagem em mm
459
            $logoHmm = ($logoInfo[1] / 72) * 25.4;
460
            if ($this->logoAlign == 'L') {
461
                $nImgW = round($w / 3, 0);
462
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
463
                $xImg = $x + 1;
464
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
465
                //estabelecer posições do texto
466
                $x1 = round($xImg + $nImgW + 1, 0);
467
                $y1 = round($h / 3 + $y, 0);
468
                $tw = round(2 * $w / 3, 0);
469
            } elseif ($this->logoAlign == 'C') {
470
                $nImgH = round($h / 3, 0);
471
                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
472
                $xImg = round(($w - $nImgW) / 2 + $x, 0);
473
                $yImg = $y + 3;
474
                $x1 = $x;
475
                $y1 = round($yImg + $nImgH + 1, 0);
476
                $tw = $w;
477
            } elseif ($this->logoAlign == 'R') {
478
                $nImgW = round($w / 3, 0);
479
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
480
                $xImg = round($x + ($w - (1 + $nImgW)), 0);
481
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
482
                $x1 = $x;
483
                $y1 = round($h / 3 + $y, 0);
484
                $tw = round(2 * $w / 3, 0);
485
            }
486
            $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
0 ignored issues
show
Bug introduced by
The variable $xImg does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $yImg does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $nImgW does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $nImgH does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
487
        } else {
488
            $x1 = $x;
489
            $y1 = round($h / 3 + $y, 0);
490
            $tw = $w;
491
        }
492
        //Nome emitente
493
        $aFont = array(
494
            'font' => $this->fontePadrao,
495
            'size' => 9,
496
            'style' => 'B');
497
        $texto = $this->getTagValue($this->emit, "xNome");
498
        $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Bug introduced by
The variable $x1 does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $y1 does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $tw does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
499
        //endereço
500
        $y1 = $y1 + 3;
501
        $aFont = array(
502
            'font' => $this->fontePadrao,
503
            'size' => 7,
504
            'style' => '');
505
        $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->formatFone($this->enderEmit) : '';
0 ignored issues
show
Documentation introduced by
$this->enderEmit is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
506
        $lgr = $this->getTagValue($this->enderEmit, "xLgr");
507
        $nro = $this->getTagValue($this->enderEmit, "nro");
508
        $cpl = $this->getTagValue($this->enderEmit, "xCpl");
0 ignored issues
show
Unused Code introduced by
$cpl is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
509
        $bairro = $this->getTagValue($this->enderEmit, "xBairro");
510
        $CEP = $this->getTagValue($this->enderEmit, "CEP");
511
        $CEP = $this->formatField($CEP, "#####-###");
512
        $mun = $this->getTagValue($this->enderEmit, "xMun");
513
        $UF = $this->getTagValue($this->enderEmit, "UF");
514
        $xPais = $this->getTagValue($this->enderEmit, "xPais");
515
        $texto = $lgr . "," . $nro . "\n" . $bairro . " - "
516
            . $CEP . " - " . $mun . " - " . $UF . " " . $xPais
517
            . "\n  Fone/Fax: " . $fone;
518
        $this->pdf->textBox($x1 - 5, $y1 + 2, $tw + 5, 8, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
519
        //CNPJ/CPF IE
520
        $cpfCnpj = $this->formatCNPJCPF($this->emit);
0 ignored issues
show
Documentation introduced by
$this->emit is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
521
        $ie = $this->getTagValue($this->emit, "IE");
522
        $texto = 'CNPJ/CPF:  ' . $cpfCnpj . '     Insc.Estadual: ' . $ie;
523
        $this->pdf->textBox($x1 - 1, $y1 + 12, $tw + 5, 8, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
524
        //outra caixa
525
        $h1 = 17.5;
526
        $y1 = $y + $h + 1;
527
        $this->pdf->textBox($x, $y1, $w + 2, $h1);
528
        //TIPO DO CT-E
529
        $texto = 'TIPO DO CTE';
530
        //$wa = 37;
531
        $wa = 34;
532
        $aFont = array(
533
            'font' => $this->fontePadrao,
534
            'size' => 8,
535
            'style' => '');
536
        $this->pdf->textBox($x, $y1, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
537
        $tpCTe = $this->getTagValue($this->ide, "tpCTe");
538
        //0 - CT-e Normal,1 - CT-e de Complemento de Valores,
539
        //2 - CT-e de Anulação de Valores,3 - CT-e Substituto
540
        switch ($tpCTe) {
541
            case '0':
542
                $texto = 'Normal';
543
                break;
544
            case '1':
545
                $texto = 'Complemento de Valores';
546
                break;
547
            case '2':
548
                $texto = 'Anulação de Valores';
549
                break;
550
            case '3':
551
                $texto = 'Substituto';
552
                break;
553
            default:
554
                $texto = 'ERRO' . $tpCTe . $tpServ;
0 ignored issues
show
Bug introduced by
The variable $tpServ seems only to be defined at a later point. Did you maybe move this code here without moving the variable definition?

This error can happen if you refactor code and forget to move the variable initialization.

Let’s take a look at a simple example:

function someFunction() {
    $x = 5;
    echo $x;
}

The above code is perfectly fine. Now imagine that we re-order the statements:

function someFunction() {
    echo $x;
    $x = 5;
}

In that case, $x would be read before it is initialized. This was a very basic example, however the principle is the same for the found issue.

Loading history...
555
        }
556
        $aFont = $this->formatNegrito;
557
        $this->pdf->textBox($x, $y1 + 3, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
558
        //TIPO DO SERVIÇO
559
        $texto = 'TIPO DO SERVIÇO';
560
        $wb = 36;
0 ignored issues
show
Unused Code introduced by
$wb is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
561
        $aFont = array(
562
            'font' => $this->fontePadrao,
563
            'size' => 8,
564
            'style' => '');
565
        $this->pdf->textBox($x + $wa, $y1, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
566
        $tpServ = $this->getTagValue($this->ide, "tpServ");
567
        //0 - Normal;1 - Subcontratação;2 - Redespacho;3 - Redespacho Intermediário
568
        switch ($tpServ) {
569
            case '0':
570
                $texto = 'Normal';
571
                break;
572
            case '1':
573
                $texto = 'Subcontratação';
574
                break;
575
            case '2':
576
                $texto = 'Redespacho';
577
                break;
578
            case '3':
579
                $texto = 'Redespacho Intermediário';
580
                break;
581
            case '4':
582
                $texto = 'Serviço Vinculado a Multimodal';
583
                break;
584
            default:
585
                $texto = 'ERRO' . $tpServ;
586
        }
587
        $aFont = $this->formatNegrito;
588
        $this->pdf->textBox($x + $wa, $y1 + 3, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
589
        $this->pdf->line($w * 0.5, $y1, $w * 0.5, $y1 + $h1);
590
        //TOMADOR DO SERVIÇO
591
        $texto = 'IND.DO CT-E GLOBALIZADO';
592
        $wc = 37;
0 ignored issues
show
Unused Code introduced by
$wc is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
593
        $y2 = $y1 + 8;
594
        $aFont = array(
595
            'font' => $this->fontePadrao,
596
            'size' => 6,
597
            'style' => '');
598
        $this->pdf->textBox($x, $y2, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
599
        $this->pdf->line($x, $y1 + 8, $w + 3, $y1 + 8);
600
        $toma = $this->getTagValue($this->ide, "indGlobalizado");
601
        //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros
602
        if ($toma == 1) {
603
            $aFont = array(
604
                'font' => $this->fontePadrao,
605
                'size' => 11,
606
                'style' => '');
607
            $this->pdf->textBox($x - 14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
608
        } else {
609
            $aFont = array(
610
                'font' => $this->fontePadrao,
611
                'size' => 11,
612
                'style' => '');
613
            $this->pdf->textBox($x + 3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
614
        }
615
        $aFont = $this->formatNegrito;
616
        $this->pdf->line($x + 3, $x + 71, $x + 3, $x + 75);
617
        $this->pdf->line($x + 8, $x + 71, $x + 8, $x + 75);
618
        $this->pdf->line($x + 3, $x + 71, $x + 8, $x + 71);
619
        $this->pdf->line($x + 3, $x + 75, $x + 8, $x + 75);
620
        $this->pdf->textBox($x - 6, $y2 + 1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
621
        $this->pdf->line($x + 18, $x + 71, $x + 18, $x + 75);
622
        $this->pdf->line($x + 23, $x + 71, $x + 23, $x + 75);
623
        $this->pdf->line($x + 18, $x + 71, $x + 23, $x + 71);
624
        $this->pdf->line($x + 18, $x + 75, $x + 23, $x + 75);
625
        $this->pdf->textBox($x + 9.8, $y2 + 1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
626
        //FORMA DE PAGAMENTO
627
        $texto = 'INF.DO CT-E GLOBALIZADO';
628
        $wd = 36;
0 ignored issues
show
Unused Code introduced by
$wd is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
629
        $aFont = array(
630
            'font' => $this->fontePadrao,
631
            'size' => 8,
632
            'style' => '');
633
        $this->pdf->textBox($x + $wa, $y2 - 0.5, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
634
        $forma = $this->getTagValue($this->ide, "forPag");
0 ignored issues
show
Unused Code introduced by
$forma is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
635
        //##################################################################
636
        //coluna direita
637
        $x += $w + 2;
638
        $w = round($maxW * 0.212);
639
        $w1 = $w;
640
        $h = 11;
641
        $this->pdf->textBox($x, $y, $w + 48.5, $h + 1);
642
        $texto = "DACTE";
643
        $aFont = array(
644
            'font' => $this->fontePadrao,
645
            'size' => 10,
646
            'style' => 'B');
647
        $this->pdf->textBox($x + 25, $y + 2, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
648
        $aFont = array(
649
            'font' => $this->fontePadrao,
650
            'size' => 9,
651
            'style' => '');
652
        $texto = "Documento Auxiliar do Conhecimento de Transporte Eletrônico";
653
        $h = 10;
654
        $this->pdf->textBox($x + 5, $y + 6, $w + 40, $h, $texto, $aFont, 'T', 'C', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
655
        $x1 = $x + $w + 2;
656
        $w = round($maxW * 0.22, 0);
657
        $w2 = $w;
658
        $h = 11;
659
        $this->pdf->textBox($x1 + 46.5, $y, $w - 0.5, $h + 1);
660
        $texto = "MODAL";
661
        $aFont = array(
662
            'font' => $this->fontePadrao,
663
            'size' => 8,
664
            'style' => '');
665
        $this->pdf->textBox($x1 + 47, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
666
        switch ($this->modal) {
667
            case '1':
668
                $texto = 'Rodoviário';
669
                break;
670
            case '2':
671
                $texto = 'Aéreo';
672
                break;
673
            case '3':
674
                $texto = 'Aquaviário';
675
                break;
676
            case '4':
677
                $texto = 'Ferroviário';
678
                break;
679
            case '5':
680
                $texto = 'Dutoviário';
681
                break;
682
        }
683
        $aFont = array(
684
            'font' => $this->fontePadrao,
685
            'size' => 10,
686
            'style' => 'B');
687
        $this->pdf->textBox($x1 + 47, $y + 5, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
688
        //outra caixa
689
        $y += 12;
690
        $h = 9;
691
        $w = $w1 + $w2 + 2;
692
        $this->pdf->textBox($x, $y, $w + 0.5, $h + 1);
693
        //modelo
694
        $wa = 12;
695
        $xa = $x;
696
        $texto = 'MODELO';
697
        $aFont = array(
698
            'font' => $this->fontePadrao,
699
            'size' => 8,
700
            'style' => '');
701
        $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
702
        $texto = $this->getTagValue($this->ide, "mod");
703
        $aFont = $this->formatNegrito;
704
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
705
        $this->pdf->line($x + $wa, $y, $x + $wa, $y + $h + 1);
706
        //serie
707
        $wa = 11;
708
        $xa += $wa;
709
        $texto = 'SÉRIE';
710
        $aFont = array(
711
            'font' => $this->fontePadrao,
712
            'size' => 8,
713
            'style' => '');
714
        $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
715
        $texto = $this->getTagValue($this->ide, "serie");
716
        $aFont = $this->formatNegrito;
717
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
718
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
719
        //numero
720
        $xa += $wa;
721
        $wa = 14;
722
        $texto = 'NÚMERO';
723
        $aFont = array(
724
            'font' => $this->fontePadrao,
725
            'size' => 8,
726
            'style' => '');
727
        $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
728
        $texto = $this->getTagValue($this->ide, "nCT");
729
        $aFont = $this->formatNegrito;
730
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
731
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
732
        //folha
733
        $xa += $wa;
734
        $wa = 6;
735
        $texto = 'FL';
736
        $aFont = array(
737
            'font' => $this->fontePadrao,
738
            'size' => 8,
739
            'style' => '');
740
        $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
741
        //$texto = '1/1';
742
        $texto = $pag . "/" . $totPag;
743
        $aFont = $this->formatNegrito;
744
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
745
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
746
        //data  hora de emissão
747
        $xa += $wa;
748
        $wa = 28;
749
        $texto = 'DATA E HORA DE EMISSÃO';
750
        $aFont = array(
751
            'font' => $this->fontePadrao,
752
            'size' => 8,
753
            'style' => '');
754
        $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
755
        $texto = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
756
            date('d/m/Y H:i:s', $this->toTimestamp($this->getTagValue($this->ide, "dhEmi"))) : '';
757
        $aFont = $this->formatNegrito;
758
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
759
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
760
        //ISUF
761
        $xa += $wa;
762
        $wa = 30;
763
        $texto = 'INSC.SUF.DO DEST';
764
        $aFont = $this->formatPadrao;
765
        $this->pdf->textBox($xa - 5, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
766
        $texto = $this->getTagValue($this->dest, "ISUF");
767
        $aFont = array(
768
            'font' => $this->fontePadrao,
769
            'size' => 7,
770
            'style' => 'B');
771
        $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
772
        //outra caixa
773
        $y += $h + 1;
774
        $h = 23;
775
        $h1 = 14;
776
        $this->pdf->textBox($x, $y, $w + 0.5, $h1);
777
        //CODIGO DE BARRAS
778
        $chave_acesso = str_replace('CTe', '', $this->infCte->getAttribute("Id"));
779
        $bW = 85;
780
        $bH = 10;
781
        //codigo de barras
782
        $this->pdf->setFillColor(0, 0, 0);
783
        $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
784
        $this->pdf->textBox($x, $y + $h1, $w + 0.5, $h1 - 6);
785
        $texto = 'CHAVE DE ACESSO';
786
        $aFont = $this->formatPadrao;
787
        $this->pdf->textBox($x, $y + $h1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
788
        $aFont = $this->formatNegrito;
789
        $texto = $this->formatField($chave_acesso, $this->formatoChave);
790
        $this->pdf->textBox($x, $y + $h1 + 3, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
791
        $this->pdf->textBox($x, $y + $h1 + 8, $w + 0.5, $h1 - 4.5);
792
        $texto = "Consulta em http://www.cte.fazenda.gov.br/portal";
793
        if ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
794
            $texto = "";
795
            $this->pdf->setFillColor(0, 0, 0);
796
            if ($this->tpEmis == 5) {
797
                $chaveContingencia = $this->geraChaveAdicCont();
798
                $this->pdf->code128($x + 20, $y1 + 10, $chaveContingencia, $bW * .9, $bH / 2);
799
            } else {
800
                $chaveContingencia = $this->getTagValue($this->protCTe, "nProt");
801
                $this->pdf->Code128($x + 40, $y1 + 10, $chaveContingencia, $bW * .4, $bH / 2);
802
            }
803
            //codigo de barras
804
        }
805
        $aFont = array(
806
            'font' => $this->fontePadrao,
807
            'size' => 8,
808
            'style' => '');
809
        $this->pdf->textBox($x, $y + $h1 + 11, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
810
        //outra caixa
811
        $y += $h + 1;
812
        $h = 8.5;
813
        $wa = $w;
814
        $this->pdf->textBox($x, $y + 7.5, $w + 0.5, $h);
815
        if ($this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
816
            $texto = 'NÚMERO DE REGISTRO DPEC';
817
        } elseif ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
818
            $texto = "DADOS DO CT-E";
819
        } else {
820
            $texto = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
821
        }
822
        $aFont = $this->formatPadrao;
823
        $this->pdf->textBox($x, $y + 7.5, $wa, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
824
        if ($this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
825
            $texto = $this->numdepec;
826
        } elseif ($this->tpEmis == 5) {
827
            $chaveContingencia = $this->geraChaveAdicCont();
828
            $aFont = array(
0 ignored issues
show
Unused Code introduced by
$aFont is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
829
                'font' => $this->fontePadrao,
830
                'size' => 8,
831
                'style' => 'B');
832
            $texto = $this->formatField($chaveContingencia, "#### #### #### #### #### #### #### #### ####");
833
            $cStat = '';
0 ignored issues
show
Unused Code introduced by
$cStat is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
834
        } else {
835
            $texto = $this->getTagValue($this->protCTe, "nProt") . " - ";
836
            if (!empty($this->protCTe)
837
                && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue)
838
            ) {
839
                $texto .= date(
840
                    'd/m/Y   H:i:s',
841
                    $this->toTimestamp($this->getTagValue($this->protCTe, "dhRecbto"))
842
                );
843
            }
844
            $texto = $this->getTagValue($this->protCTe, "nProt") == '' ? '' : $texto;
845
        }
846
        $aFont = $this->formatNegrito;
847
        $this->pdf->textBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
848
        if ($this->qrCodCTe !== null) {
849
            $this->qrCodeDacte($y - 27);
850
            $w = 45;
851
            $x += 92.5;
852
            $this->pdf->textBox($x, $y - 34, $w + 0.5, $h + 41.5);
853
        }
854
        //CFOP
855
        $x = $oldX;
856
        $h = 8.5;
857
        $w = round($maxW * 0.32);
858
        $y1 = $y + 7.5;
859
        $this->pdf->textBox($x, $y1, $w + 2, $h);
860
        $texto = 'CFOP - NATUREZA DA PRESTAÇÃO';
861
        $aFont = array(
862
            'font' => $this->fontePadrao,
863
            'size' => 8,
864
            'style' => '');
865
        $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
866
        $texto = $this->getTagValue($this->ide, "CFOP") . ' - ' . $this->getTagValue($this->ide, "natOp");
867
        $aFont = $this->formatNegrito;
868
        $this->pdf->textBox($x, $y1 + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
869
        //ORIGEM DA PRESTAÇÃO
870
        $y += $h + 7.5;
871
        $x = $oldX;
872
        $h = 8;
873
        $w = ($maxW * 0.5);
874
        $this->pdf->textBox($x, $y, $w + 0.5, $h);
875
        $texto = 'INÍCIO DA PRESTAÇÃO';
876
        $aFont = array(
877
            'font' => $this->fontePadrao,
878
            'size' => 8,
879
            'style' => '');
880
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
881
        $texto = $this->getTagValue($this->ide, "xMunIni") . ' - ' . $this->getTagValue($this->ide, "UFIni");
882
        $aFont = $this->formatNegrito;
883
        $this->pdf->textBox($x, $y + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
884
        //DESTINO DA PRESTAÇÃO
885
        $x = $oldX + $w + 1;
886
        $h = 8;
887
        $w = $w - 1.3;
888
        $this->pdf->textBox($x - 0.5, $y, $w + 0.5, $h);
889
        $texto = 'TÉRMINO DA PRESTAÇÃO';
890
        $aFont = array(
891
            'font' => $this->fontePadrao,
892
            'size' => 8,
893
            'style' => '');
894
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
895
        $texto = $this->getTagValue($this->ide, "xMunFim") . ' - ' . $this->getTagValue($this->ide, "UFFim");
896
        $aFont = $this->formatNegrito;
897
        $this->pdf->textBox($x, $y + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
898
        //#########################################################################
899
        //Indicação de CTe Homologação, cancelamento e falta de protocolo
900
        $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue;
901
        //indicar cancelamento
902
        $cStat = $this->getTagValue($this->cteProc, "cStat");
903
        if ($cStat == '101' || $cStat == '135') {
904
            //101 Cancelamento
905
            $x = 10;
906
            $y = $this->hPrint - 130;
907
            $h = 25;
908
            $w = $maxW - (2 * $x);
909
            $this->pdf->setTextColor(90, 90, 90);
910
            $texto = "CTe CANCELADO";
911
            $aFont = array(
912
                'font' => $this->fontePadrao,
913
                'size' => 48,
914
                'style' => 'B');
915
            $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
916
            $this->pdf->setTextColor(0, 0, 0);
917
        }
918
        $cStat = $this->getTagValue($this->cteProc, "cStat");
919
        if ($cStat == '110' ||
920
            $cStat == '301' ||
921
            $cStat == '302'
922
        ) {
923
            //110 Denegada
924
            $x = 10;
925
            $y = $this->hPrint - 130;
926
            $h = 25;
927
            $w = $maxW - (2 * $x);
928
            $this->pdf->setTextColor(90, 90, 90);
929
            $texto = "CTe USO DENEGADO";
930
            $aFont = array(
931
                'font' => $this->fontePadrao,
932
                'size' => 48,
933
                'style' => 'B');
934
            $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
935
            $y += $h;
936
            $h = 5;
937
            $w = $maxW - (2 * $x);
938
            $texto = "SEM VALOR FISCAL";
939
            $aFont = array(
940
                'font' => $this->fontePadrao,
941
                'size' => 48,
942
                'style' => 'B');
943
            $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
944
            $this->pdf->setTextColor(0, 0, 0);
945
        }
946
        //indicar sem valor
947
        if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção
948
            $x = 10;
949
            if ($this->orientacao == 'P') {
950
                $y = round($this->hPrint * 2 / 3, 0);
951
            } else {
952
                $y = round($this->hPrint / 2, 0);
953
            }
954
            $h = 5;
955
            $w = $maxW - (2 * $x);
956
            $this->pdf->setTextColor(90, 90, 90);
957
            $texto = "SEM VALOR FISCAL";
958
            $aFont = array(
959
                'font' => $this->fontePadrao,
960
                'size' => 48,
961
                'style' => 'B');
962
            $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
963
            $aFont = array(
964
                'font' => $this->fontePadrao,
965
                'size' => 30,
966
                'style' => 'B');
967
            $texto = "AMBIENTE DE HOMOLOGAÇÃO";
968
            $this->pdf->textBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
969
            $this->pdf->setTextColor(0, 0, 0);
970
        } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização
971
            $h = 5;
972
            $w = $maxW - (2 * 10);
973
            $x = 55;
974
            $y = 240;
975
            $this->pdf->setTextColor(255, 100, 100);
976
            $aFont = array(
977
                'font' => $this->fontePadrao,
978
                'size' => 40,
979
                'style' => 'B');
980
            $texto = "Pré-visualização";
981
            $this->pTextBox90($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Bug introduced by
The method pTextBox90() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
982
            $this->pdf->setTextColor(255, 100, 100);
983
            $aFont = array(
984
                'font' => $this->fontePadrao,
985
                'size' => 41,
986
                'style' => 'B');
987
            $texto = "Sem Validade Jurídica";
988
            $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Bug introduced by
The method pTextBox90() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
989
            $this->pdf->setTextColor(90, 90, 90);
990
            $texto = "SEM VALOR FISCAL";
991
            $aFont = array(
992
                'font' => $this->fontePadrao,
993
                'size' => 48,
994
                'style' => 'B');
995
            $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Bug introduced by
The method pTextBox90() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
996
            $this->pdf->setTextColor(0, 0, 0); // voltar a cor default
997
        } else {
998
            $x = 10;
999
            if ($this->orientacao == 'P') {
1000
                $y = round($this->hPrint * 2 / 3, 0);
1001
            } else {
1002
                $y = round($this->hPrint / 2, 0);
1003
            } //fim orientacao
1004
            $h = 5;
1005
            $w = $maxW - (2 * $x);
1006
            $this->pdf->setTextColor(90, 90, 90);
1007
            //indicar FALTA DO PROTOCOLO se NFe não for em contingência
1008
            if (($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) && !$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
1009
                //Contingência
1010
                $texto = "DACTE Emitido em Contingência";
1011
                $aFont = array(
1012
                    'font' => $this->fontePadrao,
1013
                    'size' => 48,
1014
                    'style' => 'B');
1015
                $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1016
                $aFont = array(
1017
                    'font' => $this->fontePadrao,
1018
                    'size' => 30,
1019
                    'style' => 'B');
1020
                $texto = "devido à problemas técnicos";
1021
                $this->pdf->textBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1022
            } else {
1023
                if (!isset($this->protCTe)) {
1024
                    if (!$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
1025
                        $texto = "SEM VALOR FISCAL";
1026
                        $aFont = array(
1027
                            'font' => $this->fontePadrao,
1028
                            'size' => 48,
1029
                            'style' => 'B');
1030
                        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1031
                    }
1032
                    $aFont = array(
1033
                        'font' => $this->fontePadrao,
1034
                        'size' => 30,
1035
                        'style' => 'B');
1036
                    $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ";
1037
                    if (!$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\Dacte>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
1038
                        $this->pdf->textBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1039
                    } else {
1040
                        $this->pdf->textBox($x, $y + 25, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1041
                    }
1042
                } //fim cteProc
1043
                if ($this->tpEmis == 4) {
1044
                    //DPEC
1045
                    $x = 10;
1046
                    $y = $this->hPrint - 130;
1047
                    $h = 25;
1048
                    $w = $maxW - (2 * $x);
1049
                    $this->pdf->setTextColor(200, 200, 200); // 90,90,90 é muito escuro
1050
                    $texto = "DACTE impresso em contingência -\n"
1051
                        . "DPEC regularmente recebido pela Receita\n"
1052
                        . "Federal do Brasil";
1053
                    $aFont = array(
1054
                        'font' => $this->fontePadrao,
1055
                        'size' => 48,
1056
                        'style' => 'B');
1057
                    $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1058
                    $this->pdf->setTextColor(0, 0, 0);
1059
                }
1060
            } //fim tpEmis
1061
            $this->pdf->setTextColor(0, 0, 0);
1062
        }
1063
        return $oldY;
1064
    }
1065
1066
    /**
1067
     * rodapeDACTE
1068
     * Monta o rodape no final da DACTE ( retrato e paisagem )
1069
     *
1070
     * @param number $xInic Posição horizontal canto esquerdo
0 ignored issues
show
Bug introduced by
There is no parameter named $xInic. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
1071
     * @param number $yFinal Posição vertical final para impressão
0 ignored issues
show
Bug introduced by
There is no parameter named $yFinal. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
1072
     */
1073
    protected function rodape($x, $y)
1074
    {
1075
        $texto = "Impresso em  " . date('d/m/Y   H:i:s');
1076
        $w = $this->wPrint - 4;
1077
        $aFont = array(
1078
            'font' => $this->fontePadrao,
1079
            'size' => 6,
1080
            'style' => '');
1081
        $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1082
        $texto = $this->creditos .  "  Powered by NFePHP®";
1083
        $aFont = array(
1084
            'font' => $this->fontePadrao,
1085
            'size' => 6,
1086
            'style' => '');
1087
        $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'R', false, '');
1088
    }
1089
1090
    /**
1091
     * remetente
1092
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1093
     *
1094
     * @param  number $x Posição horizontal canto esquerdo
1095
     * @param  number $y Posição vertical canto superior
1096
     * @return number Posição vertical final
1097
     */
1098
    protected function remetente($x = 0, $y = 0)
1099
    {
1100
        $oldX = $x;
1101
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1102
        if ($this->orientacao == 'P') {
1103
            $maxW = $this->wPrint;
1104
        } else {
1105
            $maxW = $this->wPrint - $this->wCanhoto;
1106
        }
1107
        $w = $maxW * 0.5 + 0.5;
1108
        $h = 19;
1109
        $x1 = $x + 16;
1110
        $texto = 'REMETENTE';
1111
        $aFont = $this->formatPadrao;
1112
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1113
        $aFont = $this->formatNegrito;
1114
        $texto = $this->getTagValue($this->rem, "xNome");
1115
        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1116
        $y += 3;
1117
        $texto = 'ENDEREÇO';
1118
        $aFont = $this->formatPadrao;
1119
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1120
        $aFont = $this->formatNegrito;
1121
        $texto = $this->getTagValue($this->enderReme, "xLgr") . ',';
1122
        $texto .= $this->getTagValue($this->enderReme, "nro");
1123
        $texto .= ($this->getTagValue($this->enderReme, "xCpl") != "") ?
1124
            ' - ' . $this->getTagValue($this->enderReme, "xCpl") : '';
1125
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1126
        $y += 3;
1127
        $texto = $this->getTagValue($this->enderReme, "xBairro");
1128
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1129
        $y += 3;
1130
        $texto = 'MUNICÍPIO';
1131
        $aFont = $this->formatPadrao;
1132
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1133
        $texto = $this->getTagValue($this->enderReme, "xMun") . ' - ';
1134
        $texto .= $this->getTagValue($this->enderReme, "UF");
1135
        $aFont = $this->formatNegrito;
1136
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1137
        $x = $w - 18;
1138
        $texto = 'CEP';
1139
        $aFont = $this->formatPadrao;
1140
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1141
        $texto = $this->formatField($this->getTagValue($this->enderReme, "CEP"), "#####-###");
1142
        $aFont = $this->formatNegrito;
1143
        $this->pdf->textBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1144
        $x = $oldX;
1145
        $y += 3;
1146
        $texto = 'CNPJ/CPF';
1147
        $aFont = $this->formatPadrao;
1148
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1149
        $cpfCnpj = $this->formatCNPJCPF($this->rem);
0 ignored issues
show
Documentation introduced by
$this->rem is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1150
        $aFont = $this->formatNegrito;
1151
        $this->pdf->textBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1152
        $x = $w - 45;
1153
        $texto = 'INSCRIÇÃO ESTADUAL';
1154
        $aFont = $this->formatPadrao;
1155
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1156
        $texto = $this->getTagValue($this->rem, "IE");
1157
        $aFont = $this->formatNegrito;
1158
        $this->pdf->textBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1159
        $x = $oldX;
1160
        $y += 3;
1161
        $texto = 'PAÍS';
1162
        $aFont = $this->formatPadrao;
1163
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1164
        $texto = $this->getTagValue($this->rem, "xPais") != "" ?
1165
            $this->getTagValue($this->rem, "xPais") : 'BRASIL';
1166
        $aFont = $this->formatNegrito;
1167
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1168
        $x = $w - 25;
1169
        $texto = 'FONE';
1170
        $aFont = $this->formatPadrao;
1171
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1172
        //$texto = $this->formatFone($this->rem);
1173
        $texto = $this->getTagValue($this->rem, "fone") != "" ? $this->formatFone($this->rem) : '';
0 ignored issues
show
Documentation introduced by
$this->rem is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1174
        $aFont = $this->formatNegrito;
1175
        $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1176
    }
1177
1178
    /**
1179
     * destinatario
1180
     * Monta o campo com os dados do destinatário na DACTE.
1181
     *
1182
     * @param  number $x Posição horizontal canto esquerdo
1183
     * @param  number $y Posição vertical canto superior
1184
     * @return number Posição vertical final
1185
     */
1186
    protected function destinatario($x = 0, $y = 0)
1187
    {
1188
        $oldX = $x;
1189
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1190
        if ($this->orientacao == 'P') {
1191
            $maxW = $this->wPrint;
1192
        } else {
1193
            $maxW = $this->wPrint - $this->wCanhoto;
1194
        }
1195
        $w = ($maxW * 0.5) - 0.7;
1196
        $h = 19;
1197
        $x1 = $x + 19;
1198
        $texto = 'DESTINATÁRIO';
1199
        $aFont = $this->formatPadrao;
1200
        $this->pdf->textBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1201
        $aFont = $this->formatNegrito;
1202
        $texto = $this->getTagValue($this->dest, "xNome");
1203
        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1204
        $y += 3;
1205
        $texto = 'ENDEREÇO';
1206
        $aFont = $this->formatPadrao;
1207
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1208
        $aFont = $this->formatNegrito;
1209
        $texto = $this->getTagValue($this->enderDest, "xLgr") . ',';
1210
        $texto .= $this->getTagValue($this->enderDest, "nro");
1211
        $texto .= $this->getTagValue($this->enderDest, "xCpl") != "" ?
1212
            ' - ' . $this->getTagValue($this->enderDest, "xCpl") : '';
1213
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1214
        $y += 3;
1215
        $texto = $this->getTagValue($this->enderDest, "xBairro");
1216
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1217
        $y += 3;
1218
        $texto = 'MUNICÍPIO';
1219
        $aFont = $this->formatPadrao;
1220
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1221
        $texto = $this->getTagValue($this->enderDest, "xMun") . ' - ';
1222
        $texto .= $this->getTagValue($this->enderDest, "UF");
1223
        $aFont = $this->formatNegrito;
1224
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1225
        $x = $w - 19 + $oldX;
1226
        $texto = 'CEP';
1227
        $aFont = $this->formatPadrao;
1228
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1229
        $texto = $this->formatField($this->getTagValue($this->enderDest, "CEP"), "#####-###");
1230
        $aFont = $this->formatNegrito;
1231
        $this->pdf->textBox($x + 5, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1232
        $x = $oldX;
1233
        $y += 3;
1234
        $texto = 'CNPJ/CPF';
1235
        $aFont = $this->formatPadrao;
1236
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1237
        $cpfCnpj = $this->formatCNPJCPF($this->dest);
0 ignored issues
show
Documentation introduced by
$this->dest is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1238
        $aFont = $this->formatNegrito;
1239
        $this->pdf->textBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1240
        $x = $w - 47.5 + $oldX;
1241
        $texto = 'INSCRIÇÃO ESTADUAL';
1242
        $aFont = $this->formatPadrao;
1243
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1244
        $texto = $this->getTagValue($this->dest, "IE");
1245
        $aFont = $this->formatNegrito;
1246
        $this->pdf->textBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1247
        $x = $oldX;
1248
        $y += 3;
1249
        $texto = 'PAÍS';
1250
        $aFont = $this->formatPadrao;
1251
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1252
        $texto = $this->getTagValue($this->dest, "xPais");
1253
        $aFont = $this->formatNegrito;
1254
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1255
        $x = $w - 27 + $oldX;
1256
        $texto = 'FONE';
1257
        $aFont = $this->formatPadrao;
1258
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1259
        //$texto = $this->formatFone($this->dest);
1260
        $texto = $this->getTagValue($this->dest, "fone") != "" ? $this->formatFone($this->dest) : '';
0 ignored issues
show
Documentation introduced by
$this->dest is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1261
        $aFont = $this->formatNegrito;
1262
        $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1263
    }
1264
1265
    /**
1266
     * expedidor
1267
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1268
     *
1269
     * @param  number $x Posição horizontal canto esquerdo
1270
     * @param  number $y Posição vertical canto superior
1271
     * @return number Posição vertical final
1272
     */
1273
    protected function expedidor($x = 0, $y = 0)
1274
    {
1275
        $oldX = $x;
1276
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1277
        if ($this->orientacao == 'P') {
1278
            $maxW = $this->wPrint;
1279
        } else {
1280
            $maxW = $this->wPrint - $this->wCanhoto;
1281
        }
1282
        $w = $maxW * 0.5 + 0.5;
1283
        $h = 19;
1284
        $x1 = $x + 16;
1285
        $texto = 'EXPEDIDOR';
1286
        $aFont = $this->formatPadrao;
1287
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1288
        $aFont = $this->formatNegrito;
1289
        $texto = $this->getTagValue($this->exped, "xNome");
1290
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1291
        $y += 3;
1292
        $texto = 'ENDEREÇO';
1293
        $aFont = $this->formatPadrao;
1294
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1295
        $aFont = $this->formatNegrito;
1296
        if (isset($this->enderExped)) {
1297
            $texto = $this->getTagValue($this->enderExped, "xLgr") . ', ';
1298
            $texto .= $this->getTagValue($this->enderExped, "nro");
1299
            $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ?
1300
                ' - ' . $this->getTagValue($this->enderExped, "xCpl") :
1301
                '';
1302
        } else {
1303
            $texto = '';
1304
        }
1305
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1306
        $y += 3;
1307
        $texto = $this->getTagValue($this->enderExped, "xBairro");
0 ignored issues
show
Bug introduced by
It seems like $this->enderExped can be null; however, getTagValue() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
1308
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1309
        $y += 3;
1310
        $texto = 'MUNICÍPIO';
1311
        $aFont = $this->formatPadrao;
1312
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1313
        if (isset($this->enderExped)) {
1314
            $texto = $this->getTagValue($this->enderExped, "xMun") . ' - ';
1315
            $texto .= $this->getTagValue($this->enderExped, "UF");
1316
        } else {
1317
            $texto = '';
1318
        }
1319
        $aFont = $this->formatNegrito;
1320
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1321
        $x = $w - 18;
1322
        $texto = 'CEP';
1323
        $aFont = $this->formatPadrao;
1324
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1325
        $texto = $this->formatField($this->getTagValue($this->enderExped, "CEP"), "#####-###");
0 ignored issues
show
Bug introduced by
It seems like $this->enderExped can be null; however, getTagValue() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
1326
        $aFont = $this->formatNegrito;
1327
        $this->pdf->textBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1328
        $x = $oldX;
1329
        $y += 3;
1330
        $texto = 'CNPJ/CPF';
1331
        $aFont = $this->formatPadrao;
1332
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1333
        $cpfCnpj = $this->formatCNPJCPF($this->exped);
0 ignored issues
show
Documentation introduced by
$this->exped is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1334
        $aFont = $this->formatNegrito;
1335
        $this->pdf->textBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1336
        $x = $w - 45;
1337
        $texto = 'INSCRIÇÃO ESTADUAL';
1338
        $aFont = $this->formatPadrao;
1339
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1340
        $texto = $this->getTagValue($this->exped, "IE");
1341
        $aFont = $this->formatNegrito;
1342
        $this->pdf->textBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1343
        $x = $oldX;
1344
        $y += 3;
1345
        $texto = 'PAÍS';
1346
        $aFont = $this->formatPadrao;
1347
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1348
        $texto = $this->getTagValue($this->exped, "xPais");
1349
        $aFont = $this->formatNegrito;
1350
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1351
        $x = $w - 25;
1352
        $texto = 'FONE';
1353
        $aFont = $this->formatPadrao;
1354
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1355
        if (isset($this->exped)) {
1356
            $texto = $this->getTagValue($this->exped, "fone") != "" ? $this->formatFone($this->exped) : '';
0 ignored issues
show
Documentation introduced by
$this->exped is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1357
            $aFont = $this->formatNegrito;
1358
            $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1359
        }
1360
    }
1361
1362
    /**
1363
     * recebedor
1364
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1365
     *
1366
     * @param  number $x Posição horizontal canto esquerdo
1367
     * @param  number $y Posição vertical canto superior
1368
     * @return number Posição vertical final
1369
     */
1370
    protected function recebedor($x = 0, $y = 0)
1371
    {
1372
        $oldX = $x;
1373
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1374
        if ($this->orientacao == 'P') {
1375
            $maxW = $this->wPrint;
1376
        } else {
1377
            $maxW = $this->wPrint - $this->wCanhoto;
1378
        }
1379
        $w = ($maxW * 0.5) - 0.7;
1380
        $h = 19;
1381
        $x1 = $x + 19;
1382
        $texto = 'RECEBEDOR';
1383
        $aFont = $this->formatPadrao;
1384
        $this->pdf->textBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1385
        $aFont = $this->formatNegrito;
1386
        $texto = $this->getTagValue($this->receb, "xNome");
1387
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1388
        $y += 3;
1389
        $texto = 'ENDEREÇO';
1390
        $aFont = $this->formatPadrao;
1391
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1392
        $aFont = $this->formatNegrito;
1393
        if (isset($this->enderReceb)) {
1394
            $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', ';
1395
            $texto .= $this->getTagValue($this->enderReceb, "nro");
1396
            $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ?
1397
                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") :
1398
                '';
1399
        } else {
1400
            $texto = '';
1401
        }
1402
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1403
        $y += 3;
1404
        $texto = $this->getTagValue($this->enderReceb, "xBairro");
0 ignored issues
show
Bug introduced by
It seems like $this->enderReceb can be null; however, getTagValue() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
1405
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1406
        $y += 3;
1407
        $texto = 'MUNICÍPIO';
1408
        $aFont = $this->formatPadrao;
1409
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1410
        if (isset($this->enderReceb)) {
1411
            $texto = $this->getTagValue($this->enderReceb, "xMun") . ' - ';
1412
            $texto .= $this->getTagValue($this->enderReceb, "UF");
1413
        } else {
1414
            $texto = '';
1415
        }
1416
        $aFont = $this->formatNegrito;
1417
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1418
        $x = $w - 19 + $oldX;
1419
        $texto = 'CEP';
1420
        $aFont = $this->formatPadrao;
1421
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1422
        $texto = $this->formatField($this->getTagValue($this->enderReceb, "CEP"), "#####-###");
0 ignored issues
show
Bug introduced by
It seems like $this->enderReceb can be null; however, getTagValue() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
1423
        $aFont = $this->formatNegrito;
1424
        $this->pdf->textBox($x + 5, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1425
        $x = $oldX;
1426
        $y += 3;
1427
        $texto = 'CNPJ/CPF';
1428
        $aFont = $this->formatPadrao;
1429
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1430
        $texto = $this->formatCNPJCPF($this->receb);
0 ignored issues
show
Documentation introduced by
$this->receb is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1431
        $aFont = $this->formatNegrito;
1432
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1433
        $x = $w - 47 + $oldX;
1434
        $texto = 'INSCRIÇÃO ESTADUAL';
1435
        $aFont = $this->formatPadrao;
1436
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1437
        $texto = $this->getTagValue($this->receb, "IE");
1438
        $aFont = $this->formatNegrito;
1439
        $this->pdf->textBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1440
        $x = $oldX;
1441
        $y += 3;
1442
        $texto = 'PAÍS';
1443
        $aFont = $this->formatPadrao;
1444
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1445
        $texto = $this->getTagValue($this->receb, "xPais");
1446
        $aFont = $this->formatNegrito;
1447
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1448
        $x = $w - 27 + $oldX;
1449
        $texto = 'FONE';
1450
        $aFont = $this->formatPadrao;
1451
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1452
        if (isset($this->receb)) {
1453
            $texto = $this->getTagValue($this->receb, "fone") != "" ? $this->formatFone($this->receb) : '';
0 ignored issues
show
Documentation introduced by
$this->receb is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1454
            $aFont = $this->formatNegrito;
1455
            $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1456
        }
1457
    }
1458
1459
    /**
1460
     * tomador
1461
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1462
     *
1463
     * @param  number $x Posição horizontal canto esquerdo
1464
     * @param  number $y Posição vertical canto superior
1465
     * @return number Posição vertical final
1466
     */
1467
    protected function tomador($x = 0, $y = 0)
1468
    {
1469
        $oldX = $x;
1470
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1471
        if ($this->orientacao == 'P') {
1472
            $maxW = $this->wPrint;
1473
        } else {
1474
            $maxW = $this->wPrint - $this->wCanhoto;
1475
        }
1476
        $w = $maxW;
1477
        $h = 10;
1478
        $texto = 'TOMADOR DO SERVIÇO';
1479
        $aFont = $this->formatPadrao;
1480
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1481
        $aFont = $this->formatNegrito;
1482
        $texto = $this->getTagValue($this->toma, "xNome");
1483
        $this->pdf->textBox($x + 29, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1484
        $x = $maxW * 0.60;
1485
        $texto = 'MUNICÍPIO';
1486
        $aFont = $this->formatPadrao;
1487
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1488
        $texto = $this->getTagValue($this->toma, "xMun");
1489
        $aFont = $this->formatNegrito;
1490
        $this->pdf->textBox($x + 15, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1491
        $x = $maxW * 0.85;
1492
        $texto = 'UF';
1493
        $aFont = $this->formatPadrao;
1494
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1495
        $texto = $this->getTagValue($this->toma, "UF");
1496
        $aFont = $this->formatNegrito;
1497
        $this->pdf->textBox($x + 4, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1498
        $x = $w - 18;
1499
        $texto = 'CEP';
1500
        $aFont = $this->formatPadrao;
1501
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1502
        $texto = $this->formatField($this->getTagValue($this->toma, "CEP"), "#####-###");
1503
        $aFont = $this->formatNegrito;
1504
        $this->pdf->textBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1505
        $y += 3;
1506
        $x = $oldX;
1507
        $texto = 'ENDEREÇO';
1508
        $aFont = $this->formatPadrao;
1509
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1510
        $aFont = $this->formatNegrito;
1511
        $texto = $this->getTagValue($this->toma, "xLgr") . ',';
1512
        $texto .= $this->getTagValue($this->toma, "nro");
1513
        $texto .= ($this->getTagValue($this->toma, "xCpl") != "") ?
1514
            ' - ' . $this->getTagValue($this->toma, "xCpl") : '';
1515
        $texto .= ' - ' . $this->getTagValue($this->toma, "xBairro");
1516
        $this->pdf->textBox($x + 16, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1517
        $y += 3;
1518
        $texto = 'CNPJ/CPF';
1519
        $aFont = $this->formatPadrao;
1520
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1521
        $texto = $this->formatCNPJCPF($this->toma);
1522
        $aFont = $this->formatNegrito;
1523
        $this->pdf->textBox($x + 13, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1524
        $x = $x + 65;
1525
        $texto = 'INSCRIÇÃO ESTADUAL';
1526
        $aFont = $this->formatPadrao;
1527
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1528
        $texto = $this->getTagValue($this->toma, "IE");
1529
        $aFont = $this->formatNegrito;
1530
        $this->pdf->textBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1531
        $x = $w * 0.75;
1532
        $texto = 'PAÍS';
1533
        $aFont = $this->formatPadrao;
1534
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1535
        $texto = $this->getTagValue($this->toma, "xPais") != "" ?
1536
            $this->getTagValue($this->toma, "xPais") : 'BRASIL';
1537
        $aFont = $this->formatNegrito;
1538
        $this->pdf->textBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1539
        $x = $w - 27;
1540
        $texto = 'FONE';
1541
        $aFont = $this->formatPadrao;
1542
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1543
        $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->formatFone($this->toma) : '';
1544
        $aFont = $this->formatNegrito;
1545
        $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1546
    }
1547
1548
    /**
1549
     * descricaoCarga
1550
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1551
     *
1552
     * @param  number $x Posição horizontal canto esquerdo
1553
     * @param  number $y Posição vertical canto superior
1554
     * @return number Posição vertical final
1555
     */
1556
    protected function descricaoCarga($x = 0, $y = 0)
1557
    {
1558
        $oldX = $x;
1559
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1560
        if ($this->orientacao == 'P') {
1561
            $maxW = $this->wPrint;
1562
        } else {
1563
            $maxW = $this->wPrint - $this->wCanhoto;
1564
        }
1565
        $w = $maxW;
1566
        $h = 17;
1567
        $texto = 'PRODUTO PREDOMINANTE';
1568
        $aFont = array(
1569
            'font' => $this->fontePadrao,
1570
            'size' => 6,
1571
            'style' => '');
1572
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1573
        $texto = $this->getTagValue($this->infCarga, "proPred");
1574
        $aFont = $this->formatNegrito;
1575
        $this->pdf->textBox($x, $y + 2.8, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1576
        $x = $w * 0.56;
1577
        $this->pdf->line($x, $y, $x, $y + 8);
1578
        $aFont = $this->formatPadrao;
1579
        $texto = 'OUTRAS CARACTERÍSTICAS DA CARGA';
1580
        $this->pdf->textBox($x + 1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1581
        $texto = $this->getTagValue($this->infCarga, "xOutCat");
1582
        $aFont = $this->formatNegrito;
1583
        $this->pdf->textBox($x + 1, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1584
        $x = $w * 0.8;
1585
        $this->pdf->line($x, $y, $x, $y + 8);
1586
        $aFont = $this->formatPadrao;
1587
        $texto = 'VALOR TOTAL DA CARGA';
1588
        $this->pdf->textBox($x + 1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1589
        $texto = $this->getTagValue($this->infCarga, "vCarga") == "" ?
1590
            $this->getTagValue($this->infCarga, "vMerc") : $this->getTagValue($this->infCarga, "vCarga");
1591
        $texto = number_format($texto, 2, ",", ".");
1592
        $aFont = $this->formatNegrito;
1593
        $this->pdf->textBox($x + 1, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1594
        $y += 8;
1595
        $x = $oldX;
1596
        $this->pdf->line($x, $y, $w + 1, $y);
1597
        //Identifica código da unidade
1598
        //01 = KG (QUILOS)
1599
        $qCarga = 0;
1600
        foreach ($this->infQ as $infQ) {
1601
            if (in_array($this->getTagValue($infQ, "cUnid"), array('01', '02'))) {
1602
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1603
            }
1604
        }
1605
        $texto = 'PESO BRUTO (KG)';
1606
        $aFont = array(
1607
            'font' => $this->fontePadrao,
1608
            'size' => 5,
1609
            'style' => '');
1610
        $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1611
        $texto = number_format($qCarga, 3, ",", ".");
1612
        $aFont = array(
1613
            'font' => $this->fontePadrao,
1614
            'size' => 7,
1615
            'style' => 'B');
1616
        $this->pdf->textBox($x + 2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1617
        $x = $w * 0.12;
1618
        $this->pdf->line($x + 13.5, $y, $x + 13.5, $y + 9);
1619
        $texto = 'PESO BASE CÁLCULO (KG)';
1620
        $aFont = array(
1621
            'font' => $this->fontePadrao,
1622
            'size' => 5,
1623
            'style' => '');
1624
        $this->pdf->textBox($x + 20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1625
        $texto = number_format($qCarga, 3, ",", ".");
1626
        $aFont = array(
1627
            'font' => $this->fontePadrao,
1628
            'size' => 7,
1629
            'style' => 'B');
1630
        $this->pdf->textBox($x + 17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1631
        $x = $w * 0.24;
1632
        $this->pdf->line($x + 25, $y, $x + 25, $y + 9);
1633
        $texto = 'PESO AFERIDO (KG)';
1634
        $aFont = array(
1635
            'font' => $this->fontePadrao,
1636
            'size' => 5,
1637
            'style' => '');
1638
        $this->pdf->textBox($x + 35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1639
        $texto = number_format($qCarga, 3, ",", ".");
1640
        $aFont = array(
1641
            'font' => $this->fontePadrao,
1642
            'size' => 7,
1643
            'style' => 'B');
1644
        $this->pdf->textBox($x + 28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1645
        $x = $w * 0.36;
1646
        $this->pdf->line($x + 41.3, $y, $x + 41.3, $y + 9);
1647
        $texto = 'CUBAGEM(M3)';
1648
        $aFont = $this->formatPadrao;
1649
        $this->pdf->textBox($x + 60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1650
        $qCarga = 0;
1651
        foreach ($this->infQ as $infQ) {
1652
            if ($this->getTagValue($infQ, "cUnid") == '00') {
1653
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1654
            }
1655
        }
1656
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1657
        $aFont = array(
1658
            'font' => $this->fontePadrao,
1659
            'size' => 7,
1660
            'style' => 'B');
1661
        $this->pdf->textBox($x + 50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1662
        $x = $w * 0.45;
1663
        //$this->pdf->line($x+37, $y, $x+37, $y + 9);
1664
        $texto = 'QTDE(VOL)';
1665
        $aFont = $this->formatPadrao;
1666
        $this->pdf->textBox($x + 85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1667
        $qCarga = 0;
1668
        foreach ($this->infQ as $infQ) {
1669
            if ($this->getTagValue($infQ, "cUnid") == '03') {
1670
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1671
            }
1672
        }
1673
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1674
        $aFont = array(
1675
            'font' => $this->fontePadrao,
1676
            'size' => 7,
1677
            'style' => 'B');
1678
        $this->pdf->textBox($x + 85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1679
        $x = $w * 0.53;
1680
        $this->pdf->line($x + 56, $y, $x + 56, $y + 9);
1681
        /*$texto = 'NOME DA SEGURADORA';
1682
        $aFont = $this->formatPadrao;
1683
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1684
        $texto = $this->getTagValue($this->seg, "xSeg");
1685
        $aFont = array(
1686
            'font' => $this->fontePadrao,
1687
            'size' => 7,
1688
            'style' => 'B');
1689
        $this->pdf->textBox($x + 31, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1690
        $y += 3;
1691
        $this->pdf->line($x, $y, $w + 1, $y);
1692
        $texto = 'RESPONSÁVEL';
1693
        $aFont = $this->formatPadrao;
1694
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1695
        $texto = $this->respSeg;
1696
        $aFont = array(
1697
            'font' => $this->fontePadrao,
1698
            'size' => 7,
1699
            'style' => 'B');
1700
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1701
        $x = $w * 0.68;
1702
        $this->pdf->line($x, $y, $x, $y + 6);
1703
        $texto = 'NÚMERO DA APOLICE';
1704
        $aFont = $this->formatPadrao;
1705
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1706
        $texto = $this->getTagValue($this->seg, "nApol");
1707
        $aFont = array(
1708
            'font' => $this->fontePadrao,
1709
            'size' => 7,
1710
            'style' => 'B');
1711
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1712
        $x = $w * 0.85;
1713
        $this->pdf->line($x, $y, $x, $y + 6);
1714
        $texto = 'NÚMERO DA AVERBAÇÃO';
1715
        $aFont = $this->formatPadrao;
1716
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1717
        $texto = $this->getTagValue($this->seg, "nAver");
1718
        $aFont = array(
1719
            'font' => $this->fontePadrao,
1720
            'size' => 7,
1721
            'style' => 'B');
1722
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1723
    }
1724
1725
    /**
1726
     * compValorServ
1727
     * Monta o campo com os componentes da prestação de serviços.
1728
     *
1729
     * @param  number $x Posição horizontal canto esquerdo
1730
     * @param  number $y Posição vertical canto superior
1731
     * @return number Posição vertical final
1732
     */
1733
    protected function compValorServ($x = 0, $y = 0)
1734
    {
1735
        $oldX = $x;
1736
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1737
        if ($this->orientacao == 'P') {
1738
            $maxW = $this->wPrint;
1739
        } else {
1740
            $maxW = $this->wPrint - $this->wCanhoto;
1741
        }
1742
        $w = $maxW;
1743
        $h = 25;
1744
        $texto = 'COMPONENTES DO VALOR DA PRESTAÇÃO DO SERVIÇO';
1745
        $aFont = $this->formatPadrao;
1746
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1747
        $y += 3.4;
1748
        $this->pdf->line($x, $y, $w + 1, $y);
1749
        $texto = 'NOME';
1750
        $aFont = $this->formatPadrao;
1751
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1752
        $yIniDados = $y;
1753
        $x = $w * 0.14;
1754
        $texto = 'VALOR';
1755
        $aFont = $this->formatPadrao;
1756
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1757
        $x = $w * 0.28;
1758
        $this->pdf->line($x, $y, $x, $y + 21.5);
1759
        $texto = 'NOME';
1760
        $aFont = $this->formatPadrao;
1761
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1762
        $x = $w * 0.42;
1763
        $texto = 'VALOR';
1764
        $aFont = $this->formatPadrao;
1765
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1766
        $x = $w * 0.56;
1767
        $this->pdf->line($x, $y, $x, $y + 21.5);
1768
        $texto = 'NOME';
1769
        $aFont = $this->formatPadrao;
1770
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1771
        $x = $w * 0.70;
1772
        $texto = 'VALOR';
1773
        $aFont = $this->formatPadrao;
1774
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1775
        $x = $w * 0.86;
1776
        $this->pdf->line($x, $y, $x, $y + 21.5);
1777
        $y += 1;
1778
        $texto = 'VALOR TOTAL DO SERVIÇO';
1779
        $aFont = $this->formatPadrao;
1780
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1781
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
1782
        $aFont = array(
1783
            'font' => $this->fontePadrao,
1784
            'size' => 9,
1785
            'style' => 'B');
1786
        $this->pdf->textBox($x, $y + 4, $w * 0.14, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1787
        $y += 10;
1788
        $this->pdf->line($x, $y, $w + 1, $y);
1789
        $y += 1;
1790
        $texto = 'VALOR A RECEBER';
1791
        $aFont = $this->formatPadrao;
1792
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1793
        $texto = number_format($this->getTagValue($this->vPrest, "vRec"), 2, ",", ".");
1794
        $aFont = array(
1795
            'font' => $this->fontePadrao,
1796
            'size' => 9,
1797
            'style' => 'B');
1798
        $this->pdf->textBox($x, $y + 4, $w * 0.14, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1799
        $auxX = $oldX;
1800
        $yIniDados += 4;
1801
        foreach ($this->Comp as $k => $d) {
1802
            $nome = $this->Comp->item($k)->getElementsByTagName('xNome')->item(0)->nodeValue;
1803
            $valor = number_format(
1804
                $this->Comp->item($k)->getElementsByTagName('vComp')->item(0)->nodeValue,
1805
                2,
1806
                ",",
1807
                "."
1808
            );
1809
            if ($auxX > $w * 0.60) {
1810
                $yIniDados = $yIniDados + 4;
1811
                $auxX = $oldX;
1812
            }
1813
            $texto = $nome;
1814
            $aFont = $this->formatPadrao;
1815
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1816
            $auxX += $w * 0.14;
1817
            $texto = $valor;
1818
            $aFont = $this->formatPadrao;
1819
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1820
            $auxX += $w * 0.14;
1821
        }
1822
    }
1823
1824
    /**
1825
     * impostos
1826
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1827
     *
1828
     * @param  number $x Posição horizontal canto esquerdo
1829
     * @param  number $y Posição vertical canto superior
1830
     * @return number Posição vertical final
1831
     */
1832
    protected function impostos($x = 0, $y = 0)
1833
    {
1834
        $oldX = $x;
1835
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1836
        if ($this->orientacao == 'P') {
1837
            $maxW = $this->wPrint;
1838
        } else {
1839
            $maxW = $this->wPrint - $this->wCanhoto;
1840
        }
1841
        $w = $maxW;
1842
        $h = 13;
1843
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
1844
        $aFont = $this->formatPadrao;
1845
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1846
        $y += 3.4;
1847
        $this->pdf->line($x, $y, $w + 1, $y);
1848
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
1849
        $aFont = $this->formatPadrao;
1850
        $this->pdf->textBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1851
        $x += $w * 0.26;
1852
        $this->pdf->line($x, $y, $x, $y + 9.5);
1853
        $texto = 'BASE DE CALCULO';
1854
        $aFont = $this->formatPadrao;
1855
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1856
        $wCol02 = 0.15;
1857
        $x += $w * $wCol02;
1858
        $this->pdf->line($x, $y, $x, $y + 9.5);
1859
        $texto = 'ALÍQ ICMS';
1860
        $aFont = $this->formatPadrao;
1861
        $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1862
        $x += $w * $wCol02;
1863
        $this->pdf->line($x, $y, $x, $y + 9.5);
1864
        $texto = 'VALOR ICMS';
1865
        $aFont = $this->formatPadrao;
1866
        $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1867
        $x += $w * $wCol02;
1868
        $this->pdf->line($x, $y, $x, $y + 9.5);
1869
        $texto = '% RED. BC ICMS';
1870
        $aFont = $this->formatPadrao;
1871
        $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1872
        $x += $w * $wCol02;
1873
        $this->pdf->line($x, $y, $x, $y + 9.5);
1874
        $texto = 'VALOR ICMS ST';
1875
        $aFont = $this->formatPadrao;
1876
        $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1877
        /*$x += $w * 0.14;
1878
        $this->pdf->line($x, $y, $x, $y + 9.5);
1879
        $texto = 'ICMS ST';
1880
        $aFont = $this->formatPadrao;
1881
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
1882
         * */
1883
        $x = $oldX;
1884
        $y = $y + 4;
1885
        $texto = $this->getTagValue($this->ICMS, "CST");
1886
        switch ($texto) {
1887
            case '00':
1888
                $texto = "00 - Tributação normal ICMS";
1889
                break;
1890
            case '20':
1891
                $texto = "20 - Tributação com BC reduzida do ICMS";
1892
                break;
1893
            case '40':
1894
                $texto = "40 - ICMS isenção";
1895
                break;
1896
            case '41':
1897
                $texto = "41 - ICMS não tributada";
1898
                break;
1899
            case '51':
1900
                $texto = "51 - ICMS diferido";
1901
                break;
1902
            case '60':
1903
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
1904
                break;
1905
            case '90':
1906
                if ($this->ICMSOutraUF) {
1907
                    $texto = "90 - ICMS Outra UF";
1908
                } else {
1909
                    $texto = "90 - ICMS Outros";
1910
                }
1911
                break;
1912
        }
1913
        if ($this->getTagValue($this->ICMS, "CST") == '60') {
1914
            $aFont = $this->formatNegrito;
1915
            $this->pdf->textBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1916
            $x += $w * 0.26;
1917
            $texto = !empty($this->ICMS->getElementsByTagName("vBCSTRet")->item(0)->nodeValue) ?
1918
                number_format($this->getTagValue($this->ICMS, "vBCSTRet"), 2, ",", ".") : (
1919
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1920
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1921
                );
1922
            $aFont = $this->formatNegrito;
1923
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1924
            $x += $w * $wCol02;
1925
            $texto = !empty($this->ICMS->getElementsByTagName("pICMSSTRet")->item(0)->nodeValue) ?
1926
                number_format($this->getTagValue($this->ICMS, "pICMSSTRet"), 2, ",", ".") : (
1927
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1928
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
1929
                );
1930
            $aFont = $this->formatNegrito;
1931
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1932
            $x += $w * $wCol02;
1933
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1934
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
1935
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
1936
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
1937
                );
1938
            $aFont = $this->formatNegrito;
1939
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1940
            $x += $w * $wCol02;
1941
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1942
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
1943
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
1944
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
1945
                );
1946
            $aFont = $this->formatNegrito;
1947
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1948
            $x += $w * $wCol02;
1949
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
1950
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
1951
            $aFont = $this->formatNegrito;
1952
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1953
        } else {
1954
            $texto = $this->getTagValue($this->ICMSSN, "indSN") == 1 ? 'Simples Nacional' : $texto;
1955
            $aFont = $this->formatNegrito;
1956
            $this->pdf->textBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1957
            $x += $w * 0.26;
1958
            $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
1959
                number_format($this->getTagValue($this->ICMS, "vBC"), 2, ",", ".") : (
1960
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1961
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1962
                );
1963
            $aFont = $this->formatNegrito;
1964
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1965
            $x += $w * $wCol02;
1966
            $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
1967
                number_format($this->getTagValue($this->ICMS, "pICMS"), 2, ",", ".") : (
1968
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1969
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
1970
                );
1971
            $aFont = $this->formatNegrito;
1972
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1973
            $x += $w * $wCol02;
1974
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1975
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
1976
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
1977
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
1978
                );
1979
            $aFont = $this->formatNegrito;
1980
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1981
            $x += $w * $wCol02;
1982
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1983
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
1984
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
1985
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
1986
                );
1987
            $aFont = $this->formatNegrito;
1988
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1989
            $x += $w * $wCol02;
1990
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
1991
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
1992
            $aFont = $this->formatNegrito;
1993
            $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1994
        }
1995
        /*$x += $w * 0.14;
1996
        $texto = '';
1997
        $aFont = $this->formatNegrito;
1998
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1999
    }
2000
2001
    /**
2002
     * geraChaveAdicCont
2003
     *
2004
     * @return string chave
2005
     */
2006
    protected function geraChaveAdicCont()
2007
    {
2008
        //cUF tpEmis CNPJ vNF ICMSp ICMSs DD  DV
2009
        // Quantidade de caracteres  02   01      14  14    01    01  02 01
2010
        $forma = "%02d%d%s%014d%01d%01d%02d";
2011
        $cUF = $this->ide->getElementsByTagName('cUF')->item(0)->nodeValue;
2012
        $CNPJ = "00000000000000" . $this->emit->getElementsByTagName('CNPJ')->item(0)->nodeValue;
2013
        $CNPJ = substr($CNPJ, -14);
2014
        $vCT = number_format($this->getTagValue($this->vPrest, "vRec"), 2, "", "") * 100;
2015
        $ICMS_CST = $this->getTagValue($this->ICMS, "CST");
2016
        switch ($ICMS_CST) {
2017
            case '00':
2018
            case '20':
2019
                $ICMSp = '1';
2020
                $ICMSs = '2';
2021
                break;
2022
            case '40':
2023
            case '41':
2024
            case '51':
2025
            case '90':
2026
                $ICMSp = '2';
2027
                $ICMSs = '2';
2028
                break;
2029
            case '60':
2030
                $ICMSp = '2';
2031
                $ICMSs = '1';
2032
                break;
2033
        }
2034
        $dd = $this->ide->getElementsByTagName('dhEmi')->item(0)->nodeValue;
2035
        $rpos = strrpos($dd, '-');
2036
        $dd = substr($dd, $rpos + 1);
2037
        $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vCT, $ICMSp, $ICMSs, $dd);
0 ignored issues
show
Bug introduced by
The variable $ICMSp does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
Bug introduced by
The variable $ICMSs does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
2038
        $chave = $chave . $this->modulo11($chave);
2039
        return $chave;
2040
    }
2041
2042
    /**
2043
     * docOrig
2044
     * Monta o campo com os documentos originarios.
2045
     *
2046
     * @param  number $x Posição horizontal canto esquerdo
2047
     * @param  number $y Posição vertical canto superior
2048
     * @return number Posição vertical final
2049
     */
2050
    protected function docOrig($x = 0, $y = 0)
2051
    {
2052
        $oldX = $x;
2053
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2054
        if ($this->orientacao == 'P') {
2055
            $maxW = $this->wPrint;
2056
        } else {
2057
            $maxW = $this->wPrint - $this->wCanhoto;
2058
        }
2059
        $w = $maxW;
2060
        // SE FOR RODOVIARIO ( BTR-SEMPRE SERÁ )
2061
        if ($this->modal == '1') {
2062
            // 0 - Não; 1 - Sim Será lotação quando houver um único conhecimento de transporte por veículo,
2063
            // ou combinação veicular, e por viagem
2064
            $h = $this->lota == 1 ? 35 : 53;
2065
        } elseif ($this->modal == '2') {
2066
            $h = 53;
2067
        } elseif ($this->modal == '3') {
2068
            $h = 37.6;
2069
        } else {
2070
            $h = 35;
2071
        }
2072
        $texto = 'DOCUMENTOS ORIGINÁRIOS';
2073
        $aFont = $this->formatPadrao;
2074
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2075
        $descr1 = 'TIPO DOC';
2076
        $descr2 = 'CNPJ/CHAVE/OBS';
2077
        $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2078
        $y += 3.4;
2079
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
2080
        $texto = $descr1;
2081
        $aFont = $this->formatPadrao;
2082
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2083
        $yIniDados = $y;
2084
        $x += $w * 0.07;
2085
        $texto = $descr2;
2086
        $aFont = $this->formatPadrao;
2087
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2088
        $x += $w * 0.28;
2089
        $texto = $descr3;
2090
        $aFont = $this->formatPadrao;
2091
        $this->pdf->textBox($x, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2092
        $x += $w * 0.14;
2093
        if ($this->modal == '1') {
2094
            if ($this->lota == 1) {
2095
                $this->pdf->line($x, $y, $x, $y + 31.5); // TESTE
2096
            } else {
2097
                $this->pdf->line($x, $y, $x, $y + 49.5); // TESTE
2098
            }
2099
        } elseif ($this->modal == '2') {
2100
            $this->pdf->line($x, $y, $x, $y + 49.5);
2101
        } elseif ($this->modal == '3') {
2102
            $this->pdf->line($x, $y, $x, $y + 34.1);
2103
        } else {
2104
            $this->pdf->line($x, $y, $x, $y + 21.5);
2105
        }
2106
        $texto = $descr1;
2107
        $aFont = $this->formatPadrao;
2108
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2109
        $x += $w * 0.08;
2110
        $texto = $descr2;
2111
        $aFont = $this->formatPadrao;
2112
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2113
        $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2114
        $texto = $descr3;
2115
        $aFont = $this->formatPadrao;
2116
        $this->pdf->textBox($x, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2117
        $auxX = $oldX;
2118
        $yIniDados += 3;
2119
        foreach ($this->infNF as $k => $d) {
2120
            $mod = $this->infNF->item($k)->getElementsByTagName('mod');
2121
            $tp = ($mod && $mod->length > 0) ? $mod->item(0)->nodeValue : '';
2122
            $cnpj = $this->formatCNPJCPF($this->rem);
0 ignored issues
show
Documentation introduced by
$this->rem is of type object<DOMNode>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2123
            $doc = $this->infNF->item($k)->getElementsByTagName('serie')->item(0)->nodeValue;
2124
            $doc .= '/' . $this->infNF->item($k)->getElementsByTagName('nDoc')->item(0)->nodeValue;
2125
            if ($auxX > $w * 0.90) {
2126
                $yIniDados = $yIniDados + 3;
2127
                $auxX = $oldX;
2128
            }
2129
            $texto = $tp;
2130
            $aFont = array(
2131
                'font' => $this->fontePadrao,
2132
                'size' => 8,
2133
                'style' => '');
2134
            //$this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
2135
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2136
            //$auxX += $w * 0.09;
2137
            $auxX += $w * 0.07;
2138
            $texto = $cnpj;
2139
            $aFont = array(
2140
                'font' => $this->fontePadrao,
2141
                'size' => 8,
2142
                'style' => '');
2143
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2144
            $auxX += $w * 0.28;
2145
            $texto = $doc;
2146
            $aFont = array(
2147
                'font' => $this->fontePadrao,
2148
                'size' => 8,
2149
                'style' => '');
2150
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2151
            $auxX += $w * 0.15;
2152
        }
2153
        foreach ($this->infNFe as $k => $d) {
2154
            $chaveNFe = $this->infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue;
2155
            $this->arrayNFe[] = $chaveNFe;
2156
        }
2157
        $qtdeNFe = 1;
2158
        if (count($this->arrayNFe) > 15) {
2159
            $this->flagDocOrigContinuacao = 1;
2160
            $qtdeNFe = count($this->arrayNFe);
2161
        }
2162
//        $totPag = count($this->arrayNFe) > 15 ? '2' : '1';
2163
        switch ($qtdeNFe) {
2164
            default:
2165
                $this->totPag = 1;
2166
            case ($qtdeNFe >= 1044):
2167
                $this->totPag = 11;
2168
                break;
2169
            case ($qtdeNFe > 928):
2170
                $this->totPag = 10;
2171
                break;
2172
            case ($qtdeNFe > 812):
2173
                $this->totPag = 9;
2174
                break;
2175
            case ($qtdeNFe > 696):
2176
                $this->totPag = 8;
2177
                break;
2178
            case ($qtdeNFe > 580):
2179
                $this->totPag = 7;
2180
                break;
2181
            case ($qtdeNFe > 464):
2182
                $this->totPag = 6;
2183
                break;
2184
            case ($qtdeNFe > 348):
2185
                $this->totPag = 5;
2186
                break;
2187
            case ($qtdeNFe > 232):
2188
                $this->totPag = 4;
2189
                break;
2190
            case ($qtdeNFe > 116):
2191
                $this->totPag = 3;
2192
                break;
2193
            case ($qtdeNFe > 16):
2194
                $this->totPag = 2;
2195
                break;
2196
            case ($qtdeNFe <= 16):
2197
                $this->totPag = 1;
2198
                break;
2199
        }
2200
        //$r = $this->cabecalho(1, 1, '1', $this->totPag);
2201
        $contador = 0;
2202
        while ($contador < count($this->arrayNFe)) {
2203
            if ($contador == 16) {
2204
                break;
2205
            }
2206
            $tp = 'NF-e';
2207
            $chaveNFe = $this->arrayNFe[$contador];
2208
            $numNFe = substr($chaveNFe, 25, 9);
2209
            $serieNFe = substr($chaveNFe, 22, 3);
2210
            $doc = $serieNFe . '/' . $numNFe;
2211
            if ($auxX > $w * 0.90) {
2212
                $yIniDados = $yIniDados + 3.5;
2213
                $auxX = $oldX;
2214
            }
2215
            $texto = $tp;
2216
            $aFont = array(
2217
                'font' => $this->fontePadrao,
2218
                'size' => 7,
2219
                'style' => '');
2220
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2221
            $auxX += $w * 0.07;
2222
            $texto = $chaveNFe;
2223
            $aFont = array(
2224
                'font' => $this->fontePadrao,
2225
                'size' => 7,
2226
                'style' => '');
2227
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.27, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2228
            $auxX += $w * 0.28;
2229
            $texto = $doc;
2230
            $aFont = array(
2231
                'font' => $this->fontePadrao,
2232
                'size' => 7,
2233
                'style' => '');
2234
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.30, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2235
            $auxX += $w * 0.15;
2236
            $contador++;
2237
        }
2238
        foreach ($this->infOutros as $k => $d) {
2239
            $temp = $this->infOutros->item($k);
2240
            $tpDoc = $this->getTagValue($temp, "tpDoc");
2241
            $descOutros = $this->getTagValue($temp, "descOutros");
2242
            $nDoc = $this->getTagValue($temp, "nDoc");
2243
            $dEmi = "Emissão: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dEmi")));
2244
            $vDocFisc = $this->getTagValue($temp, "vDocFisc", "Valor: ");
2245
            $dPrev = "Entrega: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dPrev")));
2246
            switch ($tpDoc) {
2247
                case "00":
2248
                    $tpDoc = "00 - Declaração";
2249
                    break;
2250
                case "10":
2251
                    $tpDoc = "10 - Dutoviário";
2252
                    break;
2253
                case "99":
2254
                    $tpDoc = "99 - Outros: [" . $descOutros . "]";
2255
                    break;
2256
                default:
2257
                    break;
2258
            }
2259
            $numeroDocumento = $nDoc;
0 ignored issues
show
Unused Code introduced by
$numeroDocumento is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2260
            $cnpjChave = $dEmi . " " . $vDocFisc . " " . $dPrev;
2261
            if ($auxX > $w * 0.90) {
2262
                $yIniDados = $yIniDados + 4;
2263
                $auxX = $oldX;
2264
            }
2265
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $tpDoc, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2266
            $auxX += $w * 0.09;
2267
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.27, $h, $cnpjChave, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2268
            $auxX += $w * 0.28;
2269
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.30, $h, $nDoc, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2270
            $auxX += $w * 0.14;
2271
        }
2272
        foreach ($this->idDocAntEle as $k => $d) {
2273
            $tp = 'CT-e';
2274
            $chaveCTe = $this->idDocAntEle->item($k)->getElementsByTagName('chave')->item(0)->nodeValue;
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->idDocAntEle (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
2275
            $numCTe = substr($chaveCTe, 25, 9);
2276
            $serieCTe = substr($chaveCTe, 22, 3);
2277
            $doc = $serieCTe . '/' . $numCTe;
2278
            if ($auxX > $w * 0.90) {
2279
                $yIniDados = $yIniDados + 4;
2280
                $auxX = $oldX;
2281
            }
2282
            $texto = $tp;
2283
            $aFont = array(
2284
                'font' => $this->fontePadrao,
2285
                'size' => 8,
2286
                'style' => '');
2287
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2288
            $auxX += $w * 0.09;
2289
            $texto = $chaveCTe;
2290
            $aFont = array(
2291
                'font' => $this->fontePadrao,
2292
                'size' => 8,
2293
                'style' => '');
2294
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.27, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2295
            $auxX += $w * 0.28;
2296
            $texto = $doc;
2297
            $aFont = array(
2298
                'font' => $this->fontePadrao,
2299
                'size' => 8,
2300
                'style' => '');
2301
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.30, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2302
            $auxX += $w * 0.14;
2303
        }
2304
        foreach ($this->infCTeMultimodal as $k => $d) {
2305
            $tp = 'CT-e';
2306
            $chaveCTe = $this->infCTeMultimodal->item($k)->getElementsByTagName('chCTeMultimodal')->item(0)->nodeValue;
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->infCTeMultimodal (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
2307
            $numCTe = substr($chaveCTe, 25, 9);
2308
            $serieCTe = substr($chaveCTe, 22, 3);
2309
            $doc = $serieCTe . '/' . $numCTe;
2310
            if ($auxX > $w * 0.90) {
2311
                $yIniDados = $yIniDados + 4;
2312
                $auxX = $oldX;
2313
            }
2314
            $texto = $tp;
2315
            $aFont = array(
2316
                'font' => $this->fontePadrao,
2317
                'size' => 8,
2318
                'style' => '');
2319
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2320
            $auxX += $w * 0.09;
2321
            $texto = $chaveCTe;
2322
            $aFont = array(
2323
                'font' => $this->fontePadrao,
2324
                'size' => 8,
2325
                'style' => '');
2326
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.27, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2327
            $auxX += $w * 0.28;
2328
            $texto = $doc;
2329
            $aFont = array(
2330
                'font' => $this->fontePadrao,
2331
                'size' => 8,
2332
                'style' => '');
2333
            $this->pdf->textBox($auxX, $yIniDados, $w * 0.30, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2334
            $auxX += $w * 0.14;
2335
        }
2336
    }
2337
2338
    /**
2339
     * docOrigContinuacao
2340
     * Monta o campo com os documentos originarios.
2341
     *
2342
     * @param  number $x Posição horizontal canto esquerdo
2343
     * @param  number $y Posição vertical canto superior
2344
     * @return number Posição vertical final
2345
     */
2346
    protected function docOrigContinuacao($x = 0, $y = 0)
2347
    {
2348
        $x2 = $x;
2349
        $y2 = $y;
2350
        $contador = 16;
2351
        for ($i = 2; $i <= $this->totPag; $i++) {
2352
            $x = $x2;
2353
            $y = $y2;
2354
            $this->pdf->AddPage($this->orientacao, $this->papel);
0 ignored issues
show
Bug introduced by
It seems like $this->papel can also be of type array; however, NFePHP\DA\Legacy\FPDF\Fpdf::addPage() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
2355
            $r = $this->cabecalho(1, 1, $i, $this->totPag);
0 ignored issues
show
Unused Code introduced by
$r is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2356
            $oldX = $x;
2357
            $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2358
            if ($this->orientacao == 'P') {
2359
                $maxW = $this->wPrint;
2360
            } else {
2361
                $maxW = $this->wPrint - $this->wCanhoto;
2362
            }
2363
            $w = $maxW;
2364
            //$h = 6; // de sub-titulo
2365
            //$h = 6 + 3; // de altura do texto (primeira linha
2366
            //$h = 9 + 3.5 ;// segunda linha
2367
            //$h = 9 + 3.5+ 3.5 ;// segunda linha
2368
            $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9;
2369
            if (count($this->arrayNFe) % 2 != 0) {
2370
                $h = $h + 3.5;
2371
            } // Caso tenha apenas 1 registro na ultima linha
2372
            $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO';
2373
            $aFont = $this->formatPadrao;
2374
            $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2375
            $descr1 = 'TIPO DOC';
2376
            $descr2 = 'CNPJ/CHAVE/OBS';
2377
            $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2378
            $y += 3.4;
2379
            $this->pdf->line($x, $y, $w + 1, $y);
2380
            $texto = $descr1;
2381
            $aFont = $this->formatPadrao;
2382
            $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2383
            $yIniDados = $y;
2384
            $x += $w * 0.07; // COLUNA CNPJ/CHAVE/OBS
2385
            $texto = $descr2;
2386
            $aFont = $this->formatPadrao;
2387
            $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2388
            $x += $w * 0.28;
2389
            $texto = $descr3;
2390
            $aFont = $this->formatPadrao;
2391
            $this->pdf->textBox($x, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2392
            $x += $w * 0.14;
2393
            if ($this->modal == '1') {
2394
                if ($this->lota == 1) {
2395
                    $this->pdf->line($x, $y, $x, $y + 31.5);
2396
                } else {
2397
                    $this->pdf->line($x, $y, $x, $y + 49.5);
2398
                }
2399
            } elseif ($this->modal == '2') {
2400
                $this->pdf->line($x, $y, $x, $y + 49.5);
2401
            } elseif ($this->modal == '3') {
2402
                $this->pdf->line($x, $y, $x, $y + 34.1);
2403
            } else {
2404
                $this->pdf->line($x, $y, $x, $y + 21.5);
2405
            }
2406
            $texto = $descr1;
2407
            $aFont = $this->formatPadrao;
2408
            $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2409
            $x += $w * 0.08;
2410
            $texto = $descr2;
2411
            $aFont = $this->formatPadrao;
2412
            $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2413
            $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2414
            $texto = $descr3;
2415
            $aFont = $this->formatPadrao;
2416
            $this->pdf->textBox($x, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2417
            $auxX = $oldX;
2418
            $yIniDados += 3;
2419
            while ($contador < (count($this->arrayNFe))) {
2420
                if ($contador % (116 * ($i - 1)) == 0) {
2421
//                    $contador++;
2422
                    break;
2423
                }
2424
                $tp = 'NF-e';
2425
                $chaveNFe = $this->arrayNFe[$contador];
2426
                $numNFe = substr($chaveNFe, 25, 9);
2427
                $serieNFe = substr($chaveNFe, 22, 3);
2428
                $doc = $serieNFe . '/' . $numNFe;
2429
                if ($auxX > $w * 0.90) {
2430
                    $yIniDados = $yIniDados + 3.5;
2431
                    $auxX = $oldX;
2432
                }
2433
                $texto = $tp;
2434
                $aFont = array(
2435
                    'font' => $this->fontePadrao,
2436
                    'size' => 7,
2437
                    'style' => '');
2438
                $this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2439
                $auxX += $w * 0.07;
2440
                $texto = $chaveNFe;
2441
                $aFont = array(
2442
                    'font' => $this->fontePadrao,
2443
                    'size' => 7,
2444
                    'style' => '');
2445
                $this->pdf->textBox($auxX, $yIniDados, $w * 0.27, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2446
                $auxX += $w * 0.28;
2447
                $texto = $doc;
2448
                $aFont = array(
2449
                    'font' => $this->fontePadrao,
2450
                    'size' => 7,
2451
                    'style' => '');
2452
                $this->pdf->textBox($auxX, $yIniDados, $w * 0.30, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2453
                $auxX += $w * 0.15;
2454
                $contador++;
2455
            }
2456
        }
2457
    }
2458
2459
    /**
2460
     * docCompl
2461
     * Monta o campo com os dados do remetente na DACTE.
2462
     *
2463
     * @param number $x Posição horizontal canto esquerdo
2464
     * @param number $y Posição vertical canto superior
2465
     * @return number Posição vertical final
2466
     */
2467
    protected function docCompl($x = 0, $y = 0)
2468
    {
2469
        $oldX = $x;
2470
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2471
        if ($this->orientacao == 'P') {
2472
            $maxW = $this->wPrint;
2473
        } else {
2474
            $maxW = $this->wPrint - $this->wCanhoto;
2475
        }
2476
        $w = $maxW;
2477
        $h = 80;
2478
        if ($this->tpCTe == 1) {
2479
            $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
2480
            $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
2481
            $descr2 = 'VALOR COMPLEMENTADO';
2482
        } else {
2483
            $texto = 'DETALHAMENTO DO CT-E ANULADO';
2484
            $descr1 = 'CHAVE DO CT-E ANULADO';
2485
            $descr2 = 'VALOR ANULADO';
2486
        }
2487
        $aFont = $this->formatPadrao;
2488
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2489
        $y += 3.4;
2490
        $this->pdf->line($x, $y, $w + 1, $y);
2491
        $texto = $descr1;
2492
        $aFont = $this->formatPadrao;
2493
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2494
        $yIniDados = $y;
2495
        $x += $w * 0.37;
2496
        $texto = $descr2;
2497
        $aFont = $this->formatPadrao;
2498
        $this->pdf->textBox($x - 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2499
        $x += $w * 0.13;
2500
        $this->pdf->line($x, $y, $x, $y + 76.5);
2501
        $texto = $descr1;
2502
        $aFont = $this->formatPadrao;
2503
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2504
        $x += $w * 0.3;
2505
        $texto = $descr2;
2506
        $aFont = $this->formatPadrao;
2507
        $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2508
        $auxX = $oldX;
2509
        $yIniDados += 4;
2510
        if ($auxX > $w * 0.90) {
2511
            $yIniDados = $yIniDados + 4;
2512
            $auxX = $oldX;
2513
        }
2514
        $texto = $this->chaveCTeRef;
2515
        $aFont = array(
2516
            'font' => $this->fontePadrao,
2517
            'size' => 8,
2518
            'style' => '');
2519
        $this->pdf->textBox($auxX, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2520
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
2521
        $aFont = array(
2522
            'font' => $this->fontePadrao,
2523
            'size' => 8,
2524
            'style' => '');
2525
        $this->pdf->textBox($w * 0.40, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2526
    }
2527
2528
    /**
2529
     * observacao
2530
     * Monta o campo com os dados do remetente na DACTE.
2531
     *
2532
     * @param  number $x Posição horizontal canto esquerdo
2533
     * @param  number $y Posição vertical canto superior
2534
     * @return number Posição vertical final
2535
     */
2536
    protected function observacao($x = 0, $y = 0)
2537
    {
2538
        $oldX = $x;
2539
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2540
        if ($this->orientacao == 'P') {
2541
            $maxW = $this->wPrint;
2542
        } else {
2543
            $maxW = $this->wPrint - $this->wCanhoto;
2544
        }
2545
        $w = $maxW;
2546
        //$h = 18;
2547
        $h = 18.8;
2548
        $texto = 'OBSERVAÇÕES';
2549
        $aFont = $this->formatPadrao;
2550
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2551
        $y += 3.4;
2552
        $this->pdf->line($x, $y, $w + 1, $y);
2553
        $auxX = $oldX;
0 ignored issues
show
Unused Code introduced by
$auxX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2554
        $yIniDados = $y;
0 ignored issues
show
Unused Code introduced by
$yIniDados is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2555
        $texto = '';
2556
        foreach ($this->compl as $k => $d) {
2557
            $xObs = $this->getTagValue($this->compl->item($k), "xObs");
2558
            $texto .= $xObs;
2559
        }
2560
        $textoObs = explode("Motorista:", $texto);
2561
        $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : '';
2562
        $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n");
2563
        $aFont = array(
2564
            'font' => $this->fontePadrao,
2565
            'size' => 7.5,
2566
            'style' => '');
2567
        $this->pdf->textBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2568
        $this->pdf->textBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2569
    }
2570
2571
    /**
2572
     * modalRod
2573
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2574
     *
2575
     * @param  number $x Posição horizontal canto esquerdo
2576
     * @param  number $y Posição vertical canto superior
2577
     * @return number Posição vertical final
2578
     */
2579
    protected function modalRod($x = 0, $y = 0)
2580
    {
2581
        $oldX = $x;
0 ignored issues
show
Unused Code introduced by
$oldX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2582
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2583
        $lotacao = '';
0 ignored issues
show
Unused Code introduced by
$lotacao is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2584
        if ($this->orientacao == 'P') {
2585
            $maxW = $this->wPrint;
2586
        } else {
2587
            $maxW = $this->wPrint - $this->wCanhoto;
2588
        }
2589
        $w = $maxW;
2590
        $h = 3;
2591
        $texto = 'DADOS ESPECÍFICOS DO MODAL RODOVIÁRIO';
2592
        $aFont = $this->formatPadrao;
2593
        $this->pdf->textBox($x, $y, $w, $h * 3.2, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2594
        if ($this->lota == 1) {
2595
            $this->pdf->line($x, $y + 12, $w + 1, $y + 12); // LINHA DE BAIXO
2596
        }
2597
        $y += 3.4;
2598
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2599
        $texto = 'RNTRC DA EMPRESA';
2600
        $aFont = $this->formatPadrao;
2601
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2602
        $texto = $this->getTagValue($this->rodo, "RNTRC");
2603
        $aFont = $this->formatNegrito;
2604
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2605
        $x += $w * 0.23;
2606
        $this->pdf->line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA
2607
        $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR';
2608
        $aFont = $this->formatPadrao;
2609
        $this->pdf->textBox($x - 20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2610
    }
2611
2612
    /**
2613
     * modalAereo
2614
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2615
     *
2616
     * @param  number $x Posição horizontal canto esquerdo
2617
     * @param  number $y Posição vertical canto superior
2618
     * @return number Posição vertical final
2619
     */
2620
    protected function modalAereo($x = 0, $y = 0)
2621
    {
2622
        $oldX = $x;
0 ignored issues
show
Unused Code introduced by
$oldX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2623
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2624
        $lotacao = '';
0 ignored issues
show
Unused Code introduced by
$lotacao is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2625
        if ($this->orientacao == 'P') {
2626
            $maxW = $this->wPrint;
2627
        } else {
2628
            $maxW = $this->wPrint - $this->wCanhoto;
2629
        }
2630
        $w = $maxW;
2631
        $h = 3;
2632
        $texto = 'DADOS ESPECÍFICOS DO MODAL AÉREO';
2633
        $aFont = $this->formatPadrao;
2634
        $this->pdf->textBox($x, $y, $w, $h * 3.2, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2635
        $y += 3.4;
2636
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2637
        $texto = 'NÚMERO OPERACIONAL DO CONHECIMENTO AÉREO';
2638
        $aFont = $this->formatPadrao;
2639
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2640
        $texto = 'CLASSE DA TARIFA';
2641
        $aFont = $this->formatPadrao;
2642
        $this->pdf->textBox($x + 50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2643
        $texto = 'CÓDIGO DA TARIFA';
2644
        $aFont = $this->formatPadrao;
2645
        $this->pdf->textBox($x + 80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2646
        $texto = 'VALOR DA TARIFA';
2647
        $aFont = $this->formatPadrao;
2648
        $this->pdf->textBox($x + 110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2649
        $texto = $this->getTagValue($this->aereo, "nOCA");
2650
        $aFont = $this->formatNegrito;
2651
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2652
        $x += $w * 0.23;
2653
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS NÚMERO OP. DO CT-E AEREO
2654
        $texto = $this->getTagValue($this->aereo, "CL");
2655
        $aFont = $this->formatNegrito;
2656
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2657
        $x += 30;
2658
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS CLASSE DA TARIFA
2659
        $texto = $this->getTagValue($this->aereo, "cTar");
2660
        $aFont = $this->formatNegrito;
2661
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2662
        $x += 30;
2663
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS COD DA TARIFA
2664
        $texto = $this->getTagValue($this->aereo, "vTar");
2665
        $aFont = $this->formatNegrito;
2666
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2667
    }
2668
2669
    /**
2670
     * modalAquaviario
2671
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2672
     *
2673
     * @param  number $x Posição horizontal canto esquerdo
2674
     * @param  number $y Posição vertical canto superior
2675
     * @return number Posição vertical final
2676
     */
2677
    protected function modalAquaviario($x = 0, $y = 0)
2678
    {
2679
        $oldX = $x;
0 ignored issues
show
Unused Code introduced by
$oldX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2680
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2681
        if ($this->orientacao == 'P') {
2682
            $maxW = $this->wPrint;
2683
        } else {
2684
            $maxW = $this->wPrint - $this->wCanhoto;
2685
        }
2686
        $w = $maxW;
2687
        $h = 8.5;
2688
        $texto = 'DADOS ESPECÍFICOS DO MODAL AQUAVIÁRIO';
2689
        $aFont = $this->formatPadrao;
2690
        $this->pdf->textBox($x, $y, $w, $h * 3.2, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2691
        $y += 3.4;
2692
        $this->pdf->line($x, $y, $w + 1, $y);
2693
        $texto = 'PORTO DE EMBARQUE';
2694
        $aFont = $this->formatPadrao;
2695
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2696
        $texto = $this->getTagValue($this->aquav, "prtEmb");
2697
        $aFont = $this->formatNegrito;
2698
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2699
        $x += $w * 0.50;
2700
        $this->pdf->line($x, $y, $x, $y + 7.7);
2701
        $texto = 'PORTO DE DESTINO';
2702
        $aFont = $this->formatPadrao;
2703
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2704
        $texto = $this->getTagValue($this->aquav, "prtDest");
2705
        $aFont = $this->formatNegrito;
2706
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2707
        $y += 8;
2708
        $this->pdf->line(208, $y, 1, $y);
2709
        $x = 1;
2710
        $texto = 'IDENTIFICAÇÃO DO NAVIO / REBOCADOR';
2711
        $aFont = $this->formatPadrao;
2712
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2713
        $texto = $this->getTagValue($this->aquav, "xNavio");
2714
        $aFont = $this->formatNegrito;
2715
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2716
        $x += $w * 0.50;
2717
        $this->pdf->line($x, $y, $x, $y + 7.7);
2718
        $texto = 'VR DA B. DE CALC. AFRMM';
2719
        $aFont = $this->formatPadrao;
2720
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2721
        $texto = $this->getTagValue($this->aquav, "vPrest");
2722
        $aFont = $this->formatNegrito;
2723
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2724
        $x += $w * 0.17;
2725
        $this->pdf->line($x, $y, $x, $y + 7.7);
2726
        $texto = 'VALOR DO AFRMM';
2727
        $aFont = $this->formatPadrao;
2728
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2729
        $texto = $this->getTagValue($this->aquav, "vAFRMM");
2730
        $aFont = $this->formatNegrito;
2731
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2732
        $x += $w * 0.12;
2733
        $this->pdf->line($x, $y, $x, $y + 7.7);
2734
        $texto = 'TIPO DE NAVEGAÇÃO';
2735
        $aFont = $this->formatPadrao;
2736
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2737
        $texto = $this->getTagValue($this->aquav, "tpNav");
2738
        switch ($texto) {
2739
            case '0':
2740
                $texto = 'INTERIOR';
2741
                break;
2742
            case '1':
2743
                $texto = 'CABOTAGEM';
2744
                break;
2745
        }
2746
        $aFont = $this->formatNegrito;
2747
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2748
        $x += $w * 0.14;
2749
        $this->pdf->line($x, $y, $x, $y + 7.7);
2750
        $texto = 'DIREÇÃO';
2751
        $aFont = $this->formatPadrao;
2752
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2753
        $texto = $this->getTagValue($this->aquav, "direc");
2754
        switch ($texto) {
2755
            case 'N':
2756
                $texto = 'NORTE';
2757
                break;
2758
            case 'L':
2759
                $texto = 'LESTE';
2760
                break;
2761
            case 'S':
2762
                $texto = 'SUL';
2763
                break;
2764
            case 'O':
2765
                $texto = 'OESTE';
2766
                break;
2767
        }
2768
        $aFont = $this->formatNegrito;
2769
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2770
        $y += 8;
2771
        $this->pdf->line(208, $y, 1, $y);
2772
        $x = 1;
2773
        $texto = 'IDENTIFICAÇÃO DOS CONTEINERS';
2774
        $aFont = $this->formatPadrao;
2775
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2776
        if (($this->infNF->item(0) !== null)
2777
            && ($this->infNF->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2778
            $texto = $this->infNF
2779
                ->item(0)
2780
                ->getElementsByTagName('infUnidCarga')
2781
                ->item(0)
2782
                ->getElementsByTagName('idUnidCarga')
2783
                ->item(0)->nodeValue;
2784
        } elseif (($this->infNFe->item(0) !== null)
2785
            && ($this->infNFe->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2786
            $texto = $this->infNFe
2787
                ->item(0)
2788
                ->getElementsByTagName('infUnidCarga')
2789
                ->item(0)
2790
                ->getElementsByTagName('idUnidCarga')
2791
                ->item(0)
2792
                ->nodeValue;
2793
        } elseif (($this->infOutros->item(0) !== null)
2794
            && ($this->infOutros->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2795
            $texto = $this->infOutros
2796
                ->item(0)
2797
                ->getElementsByTagName('infUnidCarga')
2798
                ->item(0)
2799
                ->getElementsByTagName('idUnidCarga')
2800
                ->item(0)
2801
                ->nodeValue;
2802
        } else {
2803
            $texto = '';
2804
        }
2805
        $aFont = $this->formatNegrito;
2806
        $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2807
        $x += $w * 0.50;
2808
        $this->pdf->line($x, $y, $x, $y + 7.7);
2809
        $texto = 'IDENTIFICAÇÃO DAS BALSAS';
2810
        $aFont = $this->formatPadrao;
2811
        $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2812
        $texto = '';
2813
        if ($this->getTagValue($this->aquav, "balsa") !== '') {
2814
            foreach ($this->aquav->getElementsByTagName('balsa') as $k => $d) {
2815
                if ($k == 0) {
2816
                    $texto = $this->aquav
2817
                        ->getElementsByTagName('balsa')
2818
                        ->item($k)
2819
                        ->getElementsByTagName('xBalsa')
2820
                        ->item(0)
2821
                        ->nodeValue;
2822
                } else {
2823
                    $texto = $texto
2824
                        . ' / '
2825
                        . $this->aquav
2826
                            ->getElementsByTagName('balsa')
2827
                            ->item($k)
2828
                            ->getElementsByTagName('xBalsa')
2829
                            ->item(0)
2830
                            ->nodeValue;
2831
                }
2832
            }
2833
        }
2834
        $aFont = $this->formatNegrito;
2835
        $this->pdf->textBox($x, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2836
    }
2837
2838
    /**
2839
     * modalFerr
2840
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2841
     *
2842
     * @param  number $x Posição horizontal canto esquerdo
2843
     * @param  number $y Posição vertical canto superior
2844
     * @return number Posição vertical final
2845
     */
2846
    protected function modalFerr($x = 0, $y = 0)
2847
    {
2848
        $oldX = $x;
0 ignored issues
show
Unused Code introduced by
$oldX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2849
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
2850
        if ($this->orientacao == 'P') {
2851
            $maxW = $this->wPrint;
2852
        } else {
2853
            $maxW = $this->wPrint - $this->wCanhoto;
2854
        }
2855
        $w = $maxW;
2856
        $h = 19.6;
2857
        $texto = 'DADOS ESPECÍFICOS DO MODAL FERROVIÁRIO';
2858
        $aFont = $this->formatPadrao;
2859
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2860
        $y += 3.4;
2861
        $this->pdf->line($x, $y, $w + 1, $y);
2862
        $texto = 'DCL';
2863
        $aFont = array(
2864
            'font' => $this->fontePadrao,
2865
            'size' => 7,
2866
            'style' => 'B');
2867
        $this->pdf->textBox($x, $y, $w * 0.25, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2868
        $this->pdf->line($x + 49.6, $y, $x + 49.6, $y + 3.5);
2869
        $texto = 'VAGÕES';
2870
        $aFont = array(
2871
            'font' => $this->fontePadrao,
2872
            'size' => 7,
2873
            'style' => 'B');
2874
        $this->pdf->textBox($x + 50, $y, $w * 0.5, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2875
        $y += 3.4;
2876
        $this->pdf->line($x, $y, $w + 1, $y);
2877
        // DCL
2878
        $texto = 'ID TREM';
2879
        $aFont = array(
2880
            'font' => $this->fontePadrao,
2881
            'size' => 6,
2882
            'style' => '');
2883
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2884
        $texto = $this->getTagValue($this->ferrov, "idTrem");
2885
        $aFont = array(
2886
            'font' => $this->fontePadrao,
2887
            'size' => 6,
2888
            'style' => 'B');
2889
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2890
        $x += $w * 0.06;
2891
        $y1 = $y + 12.5;
2892
        $this->pdf->line($x, $y, $x, $y1);
2893
        $texto = 'NUM';
2894
        $aFont = array(
2895
            'font' => $this->fontePadrao,
2896
            'size' => 6,
2897
            'style' => '');
2898
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2899
        $texto = $this->getTagValue($this->rem, "nDoc");
2900
        $aFont = array(
2901
            'font' => $this->fontePadrao,
2902
            'size' => 6,
2903
            'style' => 'B');
2904
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2905
        $x += $w * 0.06;
2906
        $this->pdf->line($x, $y, $x, $y1);
2907
        $texto = 'SÉRIE';
2908
        $aFont = array(
2909
            'font' => $this->fontePadrao,
2910
            'size' => 6,
2911
            'style' => '');
2912
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2913
        $texto = $this->getTagValue($this->rem, "serie");
2914
        $aFont = array(
2915
            'font' => $this->fontePadrao,
2916
            'size' => 6,
2917
            'style' => 'B');
2918
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2919
        $x += $w * 0.06;
2920
        $this->pdf->line($x, $y, $x, $y1);
2921
        $texto = 'EMISSÃO';
2922
        $aFont = array(
2923
            'font' => $this->fontePadrao,
2924
            'size' => 6,
2925
            'style' => '');
2926
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2927
        $texto = $this->ymdTodmy($this->getTagValue($this->rem, "dEmi"));
2928
        $aFont = array(
2929
            'font' => $this->fontePadrao,
2930
            'size' => 6,
2931
            'style' => 'B');
2932
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2933
        // VAGOES
2934
        $x += $w * 0.06;
2935
        $this->pdf->line($x, $y, $x, $y1);
2936
        $texto = 'NUM';
2937
        $aFont = array(
2938
            'font' => $this->fontePadrao,
2939
            'size' => 6,
2940
            'style' => '');
2941
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2942
        $texto = $this->getTagValue($this->ferrov, "nVag");
2943
        $aFont = array(
2944
            'font' => $this->fontePadrao,
2945
            'size' => 6,
2946
            'style' => 'B');
2947
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2948
        $x += $w * 0.06;
2949
        $this->pdf->line($x, $y, $x, $y1);
2950
        $texto = 'TIPO';
2951
        $aFont = array(
2952
            'font' => $this->fontePadrao,
2953
            'size' => 6,
2954
            'style' => '');
2955
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2956
        $texto = $this->getTagValue($this->ferrov, "tpVag");
2957
        $aFont = array(
2958
            'font' => $this->fontePadrao,
2959
            'size' => 6,
2960
            'style' => 'B');
2961
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2962
        $x += $w * 0.06;
2963
        $this->pdf->line($x, $y, $x, $y1);
2964
        $texto = 'CAPACIDADE';
2965
        $aFont = array(
2966
            'font' => $this->fontePadrao,
2967
            'size' => 6,
2968
            'style' => '');
2969
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2970
        $texto = $this->getTagValue($this->ferrov, "cap");
2971
        $aFont = array(
2972
            'font' => $this->fontePadrao,
2973
            'size' => 6,
2974
            'style' => 'B');
2975
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2976
        $x += $w * 0.08;
2977
        $this->pdf->line($x, $y, $x, $y1);
2978
        $texto = 'PESO REAL/TON';
2979
        $aFont = array(
2980
            'font' => $this->fontePadrao,
2981
            'size' => 6,
2982
            'style' => '');
2983
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2984
        $texto = $this->getTagValue($this->ferrov, "pesoR");
2985
        $aFont = array(
2986
            'font' => $this->fontePadrao,
2987
            'size' => 6,
2988
            'style' => 'B');
2989
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2990
        $x += $w * 0.09;
2991
        $this->pdf->line($x, $y, $x, $y1);
2992
        $texto = 'PESO BRUTO/TON';
2993
        $aFont = array(
2994
            'font' => $this->fontePadrao,
2995
            'size' => 6,
2996
            'style' => '');
2997
        $this->pdf->textBox($x, $y, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2998
        $texto = $this->getTagValue($this->ferrov, "pesoBC");
2999
        $aFont = array(
3000
            'font' => $this->fontePadrao,
3001
            'size' => 6,
3002
            'style' => 'B');
3003
        $this->pdf->textBox($x, $y + 3, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3004
        $x += $w * 0.1;
3005
        $this->pdf->line($x, $y, $x, $y1);
3006
        $texto = 'IDENTIFICAÇÃO DOS CONTÊINERES';
3007
        $aFont = array(
3008
            'font' => $this->fontePadrao,
3009
            'size' => 6,
3010
            'style' => '');
3011
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3012
        $texto = $this->getTagValue($this->ferrov, "nCont");
3013
        $aFont = array(
3014
            'font' => $this->fontePadrao,
3015
            'size' => 6,
3016
            'style' => 'B');
3017
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3018
        // FLUXO
3019
        $x = 1;
3020
        $y += 12.9;
3021
        $h1 = $h * 0.5 + 0.27;
3022
        $wa = round($w * 0.103) + 0.5;
3023
        $texto = 'FLUXO FERROVIARIO';
3024
        $aFont = $this->formatPadrao;
3025
        $this->pdf->textBox($x, $y, $wa, $h1, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3026
        $texto = $this->getTagValue($this->ferrov, "fluxo");
3027
        $aFont = array(
3028
            'font' => $this->fontePadrao,
3029
            'size' => 7,
3030
            'style' => 'B');
3031
        $this->pdf->textBox($x, $y + 3, $wa, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3032
        $y += 10;
3033
        $texto = 'TIPO DE TRÁFEGO';
3034
        $aFont = $this->formatPadrao;
3035
        $this->pdf->textBox($x, $y, $wa, $h1, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3036
        $texto = $this->convertUnidTrafego($this->getTagValue($this->ferrov, "tpTraf"));
3037
        $aFont = array(
3038
            'font' => $this->fontePadrao,
3039
            'size' => 7,
3040
            'style' => 'B');
3041
        $this->pdf->textBox($x, $y + 3, $wa, $h1, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3042
        // Novo Box Relativo a Modal Ferroviário
3043
        $x = 22.5;
3044
        $y += -10.2;
3045
        $texto = 'INFORMAÇÕES DAS FERROVIAS ENVOLVIDAS';
3046
        $aFont = $this->formatPadrao;
3047
        $this->pdf->textBox($x, $y, $w - 21.5, $h1 * 2.019, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3048
        $y += 3.4;
3049
        $this->pdf->line($x, $y, $w + 1, $y);
3050
        $w = $w * 0.2;
3051
        $h = $h * 1.04;
3052
        $texto = 'CÓDIGO INTERNO';
3053
        $aFont = array(
3054
            'font' => $this->fontePadrao,
3055
            'size' => 6,
3056
            'style' => '');
3057
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3058
        $texto = $this->getTagValue($this->ferrov, "cInt");
3059
        $aFont = array(
3060
            'font' => $this->fontePadrao,
3061
            'size' => 6,
3062
            'style' => 'B');
3063
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3064
        $texto = 'CNPJ';
3065
        $aFont = array(
3066
            'font' => $this->fontePadrao,
3067
            'size' => 6,
3068
            'style' => '');
3069
        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3070
        $texto = $this->getTagValue($this->ferrov, "CNPJ");
3071
        $aFont = array(
3072
            'font' => $this->fontePadrao,
3073
            'size' => 6,
3074
            'style' => 'B');
3075
        $this->pdf->textBox($x, $y + 9, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3076
        $x += 50;
3077
        $texto = 'NOME';
3078
        $aFont = array(
3079
            'font' => $this->fontePadrao,
3080
            'size' => 6,
3081
            'style' => '');
3082
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3083
        $texto = $this->getTagValue($this->ferrov, "xNome");
3084
        $aFont = array(
3085
            'font' => $this->fontePadrao,
3086
            'size' => 6,
3087
            'style' => 'B');
3088
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3089
        $texto = 'INSCRICAO ESTADUAL';
3090
        $aFont = array(
3091
            'font' => $this->fontePadrao,
3092
            'size' => 6,
3093
            'style' => '');
3094
        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3095
        $texto = $this->getTagValue($this->ferrov, "IE");
3096
        $aFont = array(
3097
            'font' => $this->fontePadrao,
3098
            'size' => 6,
3099
            'style' => 'B');
3100
        $this->pdf->textBox($x, $y + 9, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3101
        $x += 50;
3102
        $texto = 'PARTICIPAÇÃO OUTRA FERROVIA';
3103
        $aFont = array(
3104
            'font' => $this->fontePadrao,
3105
            'size' => 6,
3106
            'style' => '');
3107
        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3108
        $texto = '';
3109
        $aFont = array(
3110
            'font' => $this->fontePadrao,
3111
            'size' => 6,
3112
            'style' => 'B');
3113
        $this->pdf->textBox($x, $y + 9, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3114
    }
3115
3116
    /**
3117
     * canhoto
3118
     * Monta o campo com os dados do remetente na DACTE.
3119
     *
3120
     * @param  number $x Posição horizontal canto esquerdo
3121
     * @param  number $y Posição vertical canto superior
3122
     * @return number Posição vertical final
3123
     */
3124
    protected function canhoto($x = 0, $y = 0)
3125
    {
3126
        $oldX = $x;
3127
        $oldY = $y;
0 ignored issues
show
Unused Code introduced by
$oldY is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
3128
        if ($this->orientacao == 'P') {
3129
            $maxW = $this->wPrint;
3130
        } else {
3131
            $maxW = $this->wPrint - $this->wCanhoto;
3132
        }
3133
        $w = $maxW - 1;
3134
        $h = 20;
3135
        $y = $y + 1;
3136
        $texto = 'DECLARO QUE RECEBI OS VOLUMES DESTE CONHECIMENTO EM PERFEITO ESTADO ';
3137
        $texto .= 'PELO QUE DOU POR CUMPRIDO O PRESENTE CONTRATO DE TRANSPORTE';
3138
        $aFont = $this->formatPadrao;
3139
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3140
        $y += 3.4;
3141
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAICO DO TEXTO DECLARO QUE RECEBI...
3142
        $texto = 'NOME';
3143
        $aFont = array(
3144
            'font' => $this->fontePadrao,
3145
            'size' => 6,
3146
            'style' => '');
3147
        $this->pdf->textBox($x, $y, $w * 0.25, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3148
        $x += $w * 0.25;
3149
        $this->pdf->line($x, $y, $x, $y + 16.5);
3150
        $texto = 'ASSINATURA / CARIMBO';
3151
        $aFont = array(
3152
            'font' => $this->fontePadrao,
3153
            'size' => 6,
3154
            'style' => '');
3155
        $this->pdf->textBox($x, $y, $w * 0.25, $h - 3.4, $texto, $aFont, 'B', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3156
        $x += $w * 0.25;
3157
        $this->pdf->line($x, $y, $x, $y + 16.5);
3158
        $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n";
3159
        $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA';
3160
        $aFont = array(
3161
            'font' => $this->fontePadrao,
3162
            'size' => 6,
3163
            'style' => '');
3164
        $this->pdf->textBox($x + 10, $y, $w * 0.25, $h - 3.4, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3165
        $x = $oldX;
3166
        $y = $y + 5;
3167
        $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME
3168
        $texto = 'RG';
3169
        $aFont = array(
3170
            'font' => $this->fontePadrao,
3171
            'size' => 6,
3172
            'style' => '');
3173
        $this->pdf->textBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3174
        $x += $w * 0.85;
3175
        $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E
3176
        $texto = "CT-E";
3177
        $aFont = $this->formatNegrito;
3178
        $this->pdf->textBox($x, $y - 5, $w * 0.15, $h, $texto, $aFont, 'T', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3179
        $texto = "\r\n Nº. DOCUMENTO  " . $this->getTagValue($this->ide, "nCT") . " \n";
3180
        $texto .= "\r\n SÉRIE  " . $this->getTagValue($this->ide, "serie");
3181
        $aFont = array(
3182
            'font' => $this->fontePadrao,
3183
            'size' => 6,
3184
            'style' => '');
3185
        $this->pdf->textBox($x, $y - 8, $w * 0.15, $h, $texto, $aFont, 'C', 'C', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3186
        $x = $oldX;
3187
        $this->pdf->dashedHLine($x, $y + 12.7, $this->wPrint, 0.1, 80);
3188
    }
3189
3190
    /**
3191
     * dadosAdic
3192
     * Coloca o grupo de dados adicionais da DACTE.
3193
     *
3194
     * @param  number $x Posição horizontal canto esquerdo
3195
     * @param  number $y Posição vertical canto superior
3196
     * @param  number $h altura do campo
3197
     * @return number Posição vertical final
3198
     */
3199
    protected function dadosAdic($x, $y, $pag, $h)
0 ignored issues
show
Unused Code introduced by
The parameter $pag is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $h is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
3200
    {
3201
        $oldX = $x;
0 ignored issues
show
Unused Code introduced by
$oldX is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
3202
        //###########################################################################
3203
        //DADOS ADICIONAIS DACTE
3204
        if ($this->orientacao == 'P') {
3205
            $w = $this->wPrint;
0 ignored issues
show
Unused Code introduced by
$w is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
3206
        } else {
3207
            $w = $this->wPrint - $this->wCanhoto;
0 ignored issues
show
Unused Code introduced by
$w is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
3208
        }
3209
        //INFORMAÇÕES COMPLEMENTARES
3210
        $texto = "USO EXCLUSIVO DO EMISSOR DO CT-E";
3211
        $y += 3;
3212
        $w = $this->wAdic;
3213
        $h = 8; //mudar
3214
        $aFont = array(
3215
            'font' => $this->fontePadrao,
3216
            'size' => 6,
3217
            'style' => '');
3218
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3219
        //$this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3220
        $this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3221
        //o texto com os dados adicionais foi obtido na função xxxxxx
3222
        //e carregado em uma propriedade privada da classe
3223
        //$this->wAdic com a largura do campo
3224
        //$this->textoAdic com o texto completo do campo
3225
        $y += 1;
3226
        $aFont = $this->formatPadrao;
3227
        $this->pdf->textBox($x, $y + 3, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3228
        //RESERVADO AO FISCO
3229
        $texto = "RESERVADO AO FISCO";
3230
        $x += $w;
3231
        $y -= 1;
3232
        if ($this->orientacao == 'P') {
3233
            $w = $this->wPrint - $w;
3234
        } else {
3235
            $w = $this->wPrint - $w - $this->wCanhoto;
3236
        }
3237
        $aFont = array(
3238
            'font' => $this->fontePadrao,
3239
            'size' => 6,
3240
            'style' => '');
3241
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
0 ignored issues
show
Documentation introduced by
1 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3242
        //inserir texto informando caso de contingência
3243
        //1 – Normal – emissão normal;
3244
        //2 – Contingência FS – emissão em contingência com impressão do DACTE em Formulário de Segurança;
3245
        //3 – Contingência SCAN – emissão em contingência  – SCAN;
3246
        //4 – Contingência DPEC - emissão em contingência com envio da Declaração Prévia de
3247
        //Emissão em Contingência – DPEC;
3248
        //5 – Contingência FS-DA - emissão em contingência com impressão do DACTE em Formulário de
3249
        //Segurança para Impressão de Documento Auxiliar de Documento Fiscal Eletrônico (FS-DA).
3250
        $xJust = $this->getTagValue($this->ide, 'xJust', 'Justificativa: ');
3251
        $dhCont = $this->getTagValue($this->ide, 'dhCont', ' Entrada em contingência : ');
3252
        $texto = '';
3253
        switch ($this->tpEmis) {
3254
            case 2:
3255
                $texto = 'CONTINGÊNCIA FS' . $dhCont . $xJust;
3256
                break;
3257
            case 3:
3258
                $texto = 'CONTINGÊNCIA SCAN' . $dhCont . $xJust;
3259
                break;
3260
            case 4:
3261
                $texto = 'CONTINGÊNCIA DPEC' . $dhCont . $xJust;
3262
                break;
3263
            case 5:
3264
                $texto = 'CONTINGÊNCIA FSDA' . $dhCont . $xJust;
3265
                break;
3266
        }
3267
        $y += 2;
3268
        $aFont = $this->formatPadrao;
3269
        $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false);
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3270
        return $y + $h;
3271
    }
3272
3273
    /**
3274
     * formatCNPJCPF
3275
     * Formata campo CnpjCpf contida na CTe
3276
     *
3277
     * @param  string $field campo cnpjCpf da CT-e
3278
     * @return string
3279
     */
3280
    protected function formatCNPJCPF($field)
3281
    {
3282
        if (!isset($field)) {
3283
            return '';
3284
        }
3285
        $cnpj = !empty($field->getElementsByTagName("CNPJ")->item(0)->nodeValue) ?
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3286
            $field->getElementsByTagName("CNPJ")->item(0)->nodeValue : "";
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3287
        if ($cnpj != "" && $cnpj != "00000000000000") {
3288
            $cnpj = $this->formatField($cnpj, '###.###.###/####-##');
3289
        } else {
3290
            $cnpj = !empty($field->getElementsByTagName("CPF")->item(0)->nodeValue) ?
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3291
                $this->formatField($field->getElementsByTagName("CPF")->item(0)->nodeValue, '###.###.###.###-##') : '';
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3292
        }
3293
        return $cnpj;
3294
    }
3295
3296
    /**
3297
     * formatFone
3298
     * Formata campo fone contida na CTe
3299
     *
3300
     * @param  string $field campo fone da CT-e
3301
     * @return string
3302
     */
3303
    protected function formatFone($field)
3304
    {
3305
        try {
3306
            $fone = !empty($field->getElementsByTagName("fone")->item(0)->nodeValue) ?
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3307
                $field->getElementsByTagName("fone")->item(0)->nodeValue : '';
0 ignored issues
show
Bug introduced by
The method getElementsByTagName cannot be called on $field (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
3308
            $foneLen = strlen($fone);
3309
            if ($foneLen > 0) {
3310
                $fone2 = substr($fone, 0, $foneLen - 4);
3311
                $fone1 = substr($fone, 0, $foneLen - 8);
3312
                $fone = '(' . $fone1 . ') ' . substr($fone2, -4) . '-' . substr($fone, -4);
3313
            } else {
3314
                $fone = '';
3315
            }
3316
            return $fone;
3317
        } catch (Exception $exc) {
3318
            return '';
3319
        }
3320
    }
3321
3322
    /**
3323
     * unidade
3324
     * Converte a imformação de peso contida na CTe
3325
     *
3326
     * @param  string $c unidade de trafego extraida da CTe
3327
     * @return string
3328
     */
3329
    protected function unidade($c = '')
3330
    {
3331
        switch ($c) {
3332
            case '00':
3333
                $r = 'M3';
3334
                break;
3335
            case '01':
3336
                $r = 'KG';
3337
                break;
3338
            case '02':
3339
                $r = 'TON';
3340
                break;
3341
            case '03':
3342
                $r = 'UN';
3343
                break;
3344
            case '04':
3345
                $r = 'LT';
3346
                break;
3347
            case '05':
3348
                $r = 'MMBTU';
3349
                break;
3350
            default:
3351
                $r = '';
3352
        }
3353
        return $r;
3354
    }
3355
3356
    /**
3357
     * convertUnidTrafego
3358
     * Converte a imformação de peso contida na CTe
3359
     *
3360
     * @param  string $U Informação de trafego extraida da CTe
3361
     * @return string
3362
     */
3363
    protected function convertUnidTrafego($U = '')
3364
    {
3365
        if ($U) {
3366
            switch ($U) {
3367
                case '0':
3368
                    $stringU = 'Próprio';
3369
                    break;
3370
                case '1':
3371
                    $stringU = 'Mútuo';
3372
                    break;
3373
                case '2':
3374
                    $stringU = 'Rodoferroviário';
3375
                    break;
3376
                case '3':
3377
                    $stringU = 'Rodoviário';
3378
                    break;
3379
            }
3380
            return $stringU;
0 ignored issues
show
Bug introduced by
The variable $stringU does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
3381
        }
3382
    }
3383
3384
    /**
3385
     * multiUniPeso
3386
     * Fornece a imformação multiplicação de peso contida na CTe
3387
     *
3388
     * @param  interger $U Informação de peso extraida da CTe
3389
     * @return interger
3390
     */
3391
    protected function multiUniPeso($U = '')
3392
    {
3393
        if ($U === "01") {
3394
            // tonelada
3395
            //return 1000;
3396
            return 1;
3397
        }
3398
        return 1; // M3, KG, Unidade, litros, mmbtu
3399
    }
3400
3401
    protected function qrCodeDacte($y = 0)
3402
    {
3403
        $margemInterna = $this->margemInterna;
3404
        $barcode = new Barcode();
3405
        $bobj = $barcode->getBarcodeObj(
3406
            'QRCODE,M',
3407
            $this->qrCodCTe,
3408
            -4,
3409
            -4,
3410
            'black',
3411
            array(-2, -2, -2, -2)
3412
        )->setBackgroundColor('white');
3413
        $qrcode = $bobj->getPngData();
3414
        $wQr = 36;
3415
        $hQr = 36;
3416
        $yQr = ($y + $margemInterna);
3417
        if ($this->orientacao == 'P') {
3418
            $xQr = 170;
3419
        } else {
3420
            $xQr = 250;
3421
        }
3422
        // prepare a base64 encoded "data url"
3423
        $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
3424
        $this->pdf->image($pic, $xQr - 3, $yQr, $wQr, $hQr, 'PNG');
3425
    }
3426
3427
    /**
3428
     * Add the credits to the integrator in the footer message
3429
     * @param string $message
3430
     */
3431
    public function creditsIntegratorFooter($message = '')
3432
    {
3433
        $this->creditos = trim($message);
3434
    }
3435
}
3436