Completed
Push — master ( e40ab2...2d4eb1 )
by Roberto
05:08 queued 12s
created

Dacte::creditsIntegratorFooter()   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 1
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 (!empty($this->numdepec)) {
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 (!empty($this->numdepec)) {
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) && !empty($this->numdepec)) {
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 (!empty($this->numdepec)) {
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 (!empty($this->numdepec)) {
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') . ' ' . $this->creditos ;
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 = '';
0 ignored issues
show
Unused Code introduced by
$texto 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...
1083
        $texto = $this->powered ? "Powered by NFePHP®" : '';
1084
        $aFont = array(
1085
            'font' => $this->fontePadrao,
1086
            'size' => 6,
1087
            'style' => '');
1088
        $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'R', false, '');
1089
    }
1090
1091
    /**
1092
     * remetente
1093
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1094
     *
1095
     * @param  number $x Posição horizontal canto esquerdo
1096
     * @param  number $y Posição vertical canto superior
1097
     * @return number Posição vertical final
1098
     */
1099
    protected function remetente($x = 0, $y = 0)
1100
    {
1101
        $oldX = $x;
1102
        $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...
1103
        if ($this->orientacao == 'P') {
1104
            $maxW = $this->wPrint;
1105
        } else {
1106
            $maxW = $this->wPrint - $this->wCanhoto;
1107
        }
1108
        $w = $maxW * 0.5 + 0.5;
1109
        $h = 19;
1110
        $x1 = $x + 16;
1111
        $texto = 'REMETENTE';
1112
        $aFont = $this->formatPadrao;
1113
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1114
        $aFont = $this->formatNegrito;
1115
        $texto = $this->getTagValue($this->rem, "xNome");
1116
        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1117
        $y += 3;
1118
        $texto = 'ENDEREÇO';
1119
        $aFont = $this->formatPadrao;
1120
        $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...
1121
        $aFont = $this->formatNegrito;
1122
        $texto = $this->getTagValue($this->enderReme, "xLgr") . ',';
1123
        $texto .= $this->getTagValue($this->enderReme, "nro");
1124
        $texto .= ($this->getTagValue($this->enderReme, "xCpl") != "") ?
1125
            ' - ' . $this->getTagValue($this->enderReme, "xCpl") : '';
1126
        $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...
1127
        $y += 3;
1128
        $texto = $this->getTagValue($this->enderReme, "xBairro");
1129
        $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...
1130
        $y += 3;
1131
        $texto = 'MUNICÍPIO';
1132
        $aFont = $this->formatPadrao;
1133
        $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...
1134
        $texto = $this->getTagValue($this->enderReme, "xMun") . ' - ';
1135
        $texto .= $this->getTagValue($this->enderReme, "UF");
1136
        $aFont = $this->formatNegrito;
1137
        $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...
1138
        $x = $w - 18;
1139
        $texto = 'CEP';
1140
        $aFont = $this->formatPadrao;
1141
        $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...
1142
        $texto = $this->formatField($this->getTagValue($this->enderReme, "CEP"), "#####-###");
1143
        $aFont = $this->formatNegrito;
1144
        $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...
1145
        $x = $oldX;
1146
        $y += 3;
1147
        $texto = 'CNPJ/CPF';
1148
        $aFont = $this->formatPadrao;
1149
        $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...
1150
        $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...
1151
        $aFont = $this->formatNegrito;
1152
        $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...
1153
        $x = $w - 45;
1154
        $texto = 'INSCRIÇÃO ESTADUAL';
1155
        $aFont = $this->formatPadrao;
1156
        $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...
1157
        $texto = $this->getTagValue($this->rem, "IE");
1158
        $aFont = $this->formatNegrito;
1159
        $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...
1160
        $x = $oldX;
1161
        $y += 3;
1162
        $texto = 'PAÍS';
1163
        $aFont = $this->formatPadrao;
1164
        $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...
1165
        $texto = $this->getTagValue($this->rem, "xPais") != "" ?
1166
            $this->getTagValue($this->rem, "xPais") : 'BRASIL';
1167
        $aFont = $this->formatNegrito;
1168
        $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...
1169
        $x = $w - 25;
1170
        $texto = 'FONE';
1171
        $aFont = $this->formatPadrao;
1172
        $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...
1173
        //$texto = $this->formatFone($this->rem);
1174
        $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...
1175
        $aFont = $this->formatNegrito;
1176
        $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...
1177
    }
1178
1179
    /**
1180
     * destinatario
1181
     * Monta o campo com os dados do destinatário na DACTE.
1182
     *
1183
     * @param  number $x Posição horizontal canto esquerdo
1184
     * @param  number $y Posição vertical canto superior
1185
     * @return number Posição vertical final
1186
     */
1187
    protected function destinatario($x = 0, $y = 0)
1188
    {
1189
        $oldX = $x;
1190
        $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...
1191
        if ($this->orientacao == 'P') {
1192
            $maxW = $this->wPrint;
1193
        } else {
1194
            $maxW = $this->wPrint - $this->wCanhoto;
1195
        }
1196
        $w = ($maxW * 0.5) - 0.7;
1197
        $h = 19;
1198
        $x1 = $x + 19;
1199
        $texto = 'DESTINATÁRIO';
1200
        $aFont = $this->formatPadrao;
1201
        $this->pdf->textBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1202
        $aFont = $this->formatNegrito;
1203
        $texto = $this->getTagValue($this->dest, "xNome");
1204
        $this->pdf->textBox($x1, $y, $w-18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1205
        $y += 3;
1206
        $texto = 'ENDEREÇO';
1207
        $aFont = $this->formatPadrao;
1208
        $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...
1209
        $aFont = $this->formatNegrito;
1210
        $texto = $this->getTagValue($this->enderDest, "xLgr") . ',';
1211
        $texto .= $this->getTagValue($this->enderDest, "nro");
1212
        $texto .= $this->getTagValue($this->enderDest, "xCpl") != "" ?
1213
            ' - ' . $this->getTagValue($this->enderDest, "xCpl") : '';
1214
        $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...
1215
        $y += 3;
1216
        $texto = $this->getTagValue($this->enderDest, "xBairro");
1217
        $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...
1218
        $y += 3;
1219
        $texto = 'MUNICÍPIO';
1220
        $aFont = $this->formatPadrao;
1221
        $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...
1222
        $texto = $this->getTagValue($this->enderDest, "xMun") . ' - ';
1223
        $texto .= $this->getTagValue($this->enderDest, "UF");
1224
        $aFont = $this->formatNegrito;
1225
        $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...
1226
        $x = $w - 19 + $oldX;
1227
        $texto = 'CEP';
1228
        $aFont = $this->formatPadrao;
1229
        $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...
1230
        $texto = $this->formatField($this->getTagValue($this->enderDest, "CEP"), "#####-###");
1231
        $aFont = $this->formatNegrito;
1232
        $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...
1233
        $x = $oldX;
1234
        $y += 3;
1235
        $texto = 'CNPJ/CPF';
1236
        $aFont = $this->formatPadrao;
1237
        $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...
1238
        $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...
1239
        $aFont = $this->formatNegrito;
1240
        $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...
1241
        $x = $w - 47.5 + $oldX;
1242
        $texto = 'INSCRIÇÃO ESTADUAL';
1243
        $aFont = $this->formatPadrao;
1244
        $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...
1245
        $texto = $this->getTagValue($this->dest, "IE");
1246
        $aFont = $this->formatNegrito;
1247
        $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...
1248
        $x = $oldX;
1249
        $y += 3;
1250
        $texto = 'PAÍS';
1251
        $aFont = $this->formatPadrao;
1252
        $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...
1253
        $texto = $this->getTagValue($this->dest, "xPais");
1254
        $aFont = $this->formatNegrito;
1255
        $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...
1256
        $x = $w - 27 + $oldX;
1257
        $texto = 'FONE';
1258
        $aFont = $this->formatPadrao;
1259
        $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...
1260
        //$texto = $this->formatFone($this->dest);
1261
        $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...
1262
        $aFont = $this->formatNegrito;
1263
        $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...
1264
    }
1265
1266
    /**
1267
     * expedidor
1268
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1269
     *
1270
     * @param  number $x Posição horizontal canto esquerdo
1271
     * @param  number $y Posição vertical canto superior
1272
     * @return number Posição vertical final
1273
     */
1274
    protected function expedidor($x = 0, $y = 0)
1275
    {
1276
        $oldX = $x;
1277
        $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...
1278
        if ($this->orientacao == 'P') {
1279
            $maxW = $this->wPrint;
1280
        } else {
1281
            $maxW = $this->wPrint - $this->wCanhoto;
1282
        }
1283
        $w = $maxW * 0.5 + 0.5;
1284
        $h = 19;
1285
        $x1 = $x + 16;
1286
        $texto = 'EXPEDIDOR';
1287
        $aFont = $this->formatPadrao;
1288
        $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...
1289
        $aFont = $this->formatNegrito;
1290
        $texto = $this->getTagValue($this->exped, "xNome");
1291
        $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...
1292
        $y += 3;
1293
        $texto = 'ENDEREÇO';
1294
        $aFont = $this->formatPadrao;
1295
        $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...
1296
        $aFont = $this->formatNegrito;
1297
        if (isset($this->enderExped)) {
1298
            $texto = $this->getTagValue($this->enderExped, "xLgr") . ', ';
1299
            $texto .= $this->getTagValue($this->enderExped, "nro");
1300
            $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ?
1301
                ' - ' . $this->getTagValue($this->enderExped, "xCpl") :
1302
                '';
1303
        } else {
1304
            $texto = '';
1305
        }
1306
        $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...
1307
        $y += 3;
1308
        $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...
1309
        $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...
1310
        $y += 3;
1311
        $texto = 'MUNICÍPIO';
1312
        $aFont = $this->formatPadrao;
1313
        $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...
1314
        if (isset($this->enderExped)) {
1315
            $texto = $this->getTagValue($this->enderExped, "xMun") . ' - ';
1316
            $texto .= $this->getTagValue($this->enderExped, "UF");
1317
        } else {
1318
            $texto = '';
1319
        }
1320
        $aFont = $this->formatNegrito;
1321
        $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...
1322
        $x = $w - 18;
1323
        $texto = 'CEP';
1324
        $aFont = $this->formatPadrao;
1325
        $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...
1326
        $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...
1327
        $aFont = $this->formatNegrito;
1328
        $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...
1329
        $x = $oldX;
1330
        $y += 3;
1331
        $texto = 'CNPJ/CPF';
1332
        $aFont = $this->formatPadrao;
1333
        $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...
1334
        $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...
1335
        $aFont = $this->formatNegrito;
1336
        $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...
1337
        $x = $w - 45;
1338
        $texto = 'INSCRIÇÃO ESTADUAL';
1339
        $aFont = $this->formatPadrao;
1340
        $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...
1341
        $texto = $this->getTagValue($this->exped, "IE");
1342
        $aFont = $this->formatNegrito;
1343
        $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...
1344
        $x = $oldX;
1345
        $y += 3;
1346
        $texto = 'PAÍS';
1347
        $aFont = $this->formatPadrao;
1348
        $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...
1349
        $texto = $this->getTagValue($this->exped, "xPais");
1350
        $aFont = $this->formatNegrito;
1351
        $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...
1352
        $x = $w - 25;
1353
        $texto = 'FONE';
1354
        $aFont = $this->formatPadrao;
1355
        $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...
1356
        if (isset($this->exped)) {
1357
            $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...
1358
            $aFont = $this->formatNegrito;
1359
            $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...
1360
        }
1361
    }
1362
1363
    /**
1364
     * recebedor
1365
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1366
     *
1367
     * @param  number $x Posição horizontal canto esquerdo
1368
     * @param  number $y Posição vertical canto superior
1369
     * @return number Posição vertical final
1370
     */
1371
    protected function recebedor($x = 0, $y = 0)
1372
    {
1373
        $oldX = $x;
1374
        $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...
1375
        if ($this->orientacao == 'P') {
1376
            $maxW = $this->wPrint;
1377
        } else {
1378
            $maxW = $this->wPrint - $this->wCanhoto;
1379
        }
1380
        $w = ($maxW * 0.5) - 0.7;
1381
        $h = 19;
1382
        $x1 = $x + 19;
1383
        $texto = 'RECEBEDOR';
1384
        $aFont = $this->formatPadrao;
1385
        $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...
1386
        $aFont = $this->formatNegrito;
1387
        $texto = $this->getTagValue($this->receb, "xNome");
1388
        $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...
1389
        $y += 3;
1390
        $texto = 'ENDEREÇO';
1391
        $aFont = $this->formatPadrao;
1392
        $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...
1393
        $aFont = $this->formatNegrito;
1394
        if (isset($this->enderReceb)) {
1395
            $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', ';
1396
            $texto .= $this->getTagValue($this->enderReceb, "nro");
1397
            $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ?
1398
                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") :
1399
                '';
1400
        } else {
1401
            $texto = '';
1402
        }
1403
        $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...
1404
        $y += 3;
1405
        $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...
1406
        $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...
1407
        $y += 3;
1408
        $texto = 'MUNICÍPIO';
1409
        $aFont = $this->formatPadrao;
1410
        $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...
1411
        if (isset($this->enderReceb)) {
1412
            $texto = $this->getTagValue($this->enderReceb, "xMun") . ' - ';
1413
            $texto .= $this->getTagValue($this->enderReceb, "UF");
1414
        } else {
1415
            $texto = '';
1416
        }
1417
        $aFont = $this->formatNegrito;
1418
        $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...
1419
        $x = $w - 19 + $oldX;
1420
        $texto = 'CEP';
1421
        $aFont = $this->formatPadrao;
1422
        $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...
1423
        $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...
1424
        $aFont = $this->formatNegrito;
1425
        $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...
1426
        $x = $oldX;
1427
        $y += 3;
1428
        $texto = 'CNPJ/CPF';
1429
        $aFont = $this->formatPadrao;
1430
        $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...
1431
        $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...
1432
        $aFont = $this->formatNegrito;
1433
        $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...
1434
        $x = $w - 47 + $oldX;
1435
        $texto = 'INSCRIÇÃO ESTADUAL';
1436
        $aFont = $this->formatPadrao;
1437
        $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...
1438
        $texto = $this->getTagValue($this->receb, "IE");
1439
        $aFont = $this->formatNegrito;
1440
        $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...
1441
        $x = $oldX;
1442
        $y += 3;
1443
        $texto = 'PAÍS';
1444
        $aFont = $this->formatPadrao;
1445
        $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...
1446
        $texto = $this->getTagValue($this->receb, "xPais");
1447
        $aFont = $this->formatNegrito;
1448
        $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...
1449
        $x = $w - 27 + $oldX;
1450
        $texto = 'FONE';
1451
        $aFont = $this->formatPadrao;
1452
        $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...
1453
        if (isset($this->receb)) {
1454
            $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...
1455
            $aFont = $this->formatNegrito;
1456
            $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...
1457
        }
1458
    }
1459
1460
    /**
1461
     * tomador
1462
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1463
     *
1464
     * @param  number $x Posição horizontal canto esquerdo
1465
     * @param  number $y Posição vertical canto superior
1466
     * @return number Posição vertical final
1467
     */
1468
    protected function tomador($x = 0, $y = 0)
1469
    {
1470
        $oldX = $x;
1471
        $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...
1472
        if ($this->orientacao == 'P') {
1473
            $maxW = $this->wPrint;
1474
        } else {
1475
            $maxW = $this->wPrint - $this->wCanhoto;
1476
        }
1477
        $w = $maxW;
1478
        $h = 10;
1479
        $texto = 'TOMADOR DO SERVIÇO';
1480
        $aFont = $this->formatPadrao;
1481
        $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...
1482
        $aFont = $this->formatNegrito;
1483
        $texto = $this->getTagValue($this->toma, "xNome");
1484
        $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...
1485
        $x = $maxW * 0.60;
1486
        $texto = 'MUNICÍPIO';
1487
        $aFont = $this->formatPadrao;
1488
        $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...
1489
        $texto = $this->getTagValue($this->toma, "xMun");
1490
        $aFont = $this->formatNegrito;
1491
        $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...
1492
        $x = $maxW * 0.85;
1493
        $texto = 'UF';
1494
        $aFont = $this->formatPadrao;
1495
        $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...
1496
        $texto = $this->getTagValue($this->toma, "UF");
1497
        $aFont = $this->formatNegrito;
1498
        $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...
1499
        $x = $w - 18;
1500
        $texto = 'CEP';
1501
        $aFont = $this->formatPadrao;
1502
        $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...
1503
        $texto = $this->formatField($this->getTagValue($this->toma, "CEP"), "#####-###");
1504
        $aFont = $this->formatNegrito;
1505
        $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...
1506
        $y += 3;
1507
        $x = $oldX;
1508
        $texto = 'ENDEREÇO';
1509
        $aFont = $this->formatPadrao;
1510
        $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...
1511
        $aFont = $this->formatNegrito;
1512
        $texto = $this->getTagValue($this->toma, "xLgr") . ',';
1513
        $texto .= $this->getTagValue($this->toma, "nro");
1514
        $texto .= ($this->getTagValue($this->toma, "xCpl") != "") ?
1515
            ' - ' . $this->getTagValue($this->toma, "xCpl") : '';
1516
        $texto .= ' - ' . $this->getTagValue($this->toma, "xBairro");
1517
        $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...
1518
        $y += 3;
1519
        $texto = 'CNPJ/CPF';
1520
        $aFont = $this->formatPadrao;
1521
        $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...
1522
        $texto = $this->formatCNPJCPF($this->toma);
1523
        $aFont = $this->formatNegrito;
1524
        $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...
1525
        $x = $x + 65;
1526
        $texto = 'INSCRIÇÃO ESTADUAL';
1527
        $aFont = $this->formatPadrao;
1528
        $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...
1529
        $texto = $this->getTagValue($this->toma, "IE");
1530
        $aFont = $this->formatNegrito;
1531
        $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...
1532
        $x = $w * 0.75;
1533
        $texto = 'PAÍS';
1534
        $aFont = $this->formatPadrao;
1535
        $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...
1536
        $texto = $this->getTagValue($this->toma, "xPais") != "" ?
1537
            $this->getTagValue($this->toma, "xPais") : 'BRASIL';
1538
        $aFont = $this->formatNegrito;
1539
        $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...
1540
        $x = $w - 27;
1541
        $texto = 'FONE';
1542
        $aFont = $this->formatPadrao;
1543
        $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...
1544
        $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->formatFone($this->toma) : '';
1545
        $aFont = $this->formatNegrito;
1546
        $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...
1547
    }
1548
1549
    /**
1550
     * descricaoCarga
1551
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1552
     *
1553
     * @param  number $x Posição horizontal canto esquerdo
1554
     * @param  number $y Posição vertical canto superior
1555
     * @return number Posição vertical final
1556
     */
1557
    protected function descricaoCarga($x = 0, $y = 0)
1558
    {
1559
        $oldX = $x;
1560
        $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...
1561
        if ($this->orientacao == 'P') {
1562
            $maxW = $this->wPrint;
1563
        } else {
1564
            $maxW = $this->wPrint - $this->wCanhoto;
1565
        }
1566
        $w = $maxW;
1567
        $h = 17;
1568
        $texto = 'PRODUTO PREDOMINANTE';
1569
        $aFont = array(
1570
            'font' => $this->fontePadrao,
1571
            'size' => 6,
1572
            'style' => '');
1573
        $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...
1574
        $texto = $this->getTagValue($this->infCarga, "proPred");
1575
        $aFont = $this->formatNegrito;
1576
        $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...
1577
        $x = $w * 0.56;
1578
        $this->pdf->line($x, $y, $x, $y + 8);
1579
        $aFont = $this->formatPadrao;
1580
        $texto = 'OUTRAS CARACTERÍSTICAS DA CARGA';
1581
        $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...
1582
        $texto = $this->getTagValue($this->infCarga, "xOutCat");
1583
        $aFont = $this->formatNegrito;
1584
        $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...
1585
        $x = $w * 0.8;
1586
        $this->pdf->line($x, $y, $x, $y + 8);
1587
        $aFont = $this->formatPadrao;
1588
        $texto = 'VALOR TOTAL DA CARGA';
1589
        $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...
1590
        $texto = $this->getTagValue($this->infCarga, "vCarga") == "" ?
1591
            $this->getTagValue($this->infCarga, "vMerc") : $this->getTagValue($this->infCarga, "vCarga");
1592
        $texto = number_format($texto, 2, ",", ".");
1593
        $aFont = $this->formatNegrito;
1594
        $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...
1595
        $y += 8;
1596
        $x = $oldX;
1597
        $this->pdf->line($x, $y, $w + 1, $y);
1598
        //Identifica código da unidade
1599
        //01 = KG (QUILOS)
1600
        $qCarga = 0;
1601
        foreach ($this->infQ as $infQ) {
1602
            if (in_array($this->getTagValue($infQ, "cUnid"), array('01', '02'))) {
1603
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1604
            }
1605
        }
1606
        $texto = 'PESO BRUTO (KG)';
1607
        $aFont = array(
1608
            'font' => $this->fontePadrao,
1609
            'size' => 5,
1610
            'style' => '');
1611
        $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...
1612
        $texto = number_format($qCarga, 3, ",", ".");
1613
        $aFont = array(
1614
            'font' => $this->fontePadrao,
1615
            'size' => 7,
1616
            'style' => 'B');
1617
        $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...
1618
        $x = $w * 0.12;
1619
        $this->pdf->line($x + 13.5, $y, $x + 13.5, $y + 9);
1620
        $texto = 'PESO BASE CÁLCULO (KG)';
1621
        $aFont = array(
1622
            'font' => $this->fontePadrao,
1623
            'size' => 5,
1624
            'style' => '');
1625
        $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...
1626
        $texto = number_format($qCarga, 3, ",", ".");
1627
        $aFont = array(
1628
            'font' => $this->fontePadrao,
1629
            'size' => 7,
1630
            'style' => 'B');
1631
        $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...
1632
        $x = $w * 0.24;
1633
        $this->pdf->line($x + 25, $y, $x + 25, $y + 9);
1634
        $texto = 'PESO AFERIDO (KG)';
1635
        $aFont = array(
1636
            'font' => $this->fontePadrao,
1637
            'size' => 5,
1638
            'style' => '');
1639
        $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...
1640
        $texto = number_format($qCarga, 3, ",", ".");
1641
        $aFont = array(
1642
            'font' => $this->fontePadrao,
1643
            'size' => 7,
1644
            'style' => 'B');
1645
        $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...
1646
        $x = $w * 0.36;
1647
        $this->pdf->line($x + 41.3, $y, $x + 41.3, $y + 9);
1648
        $texto = 'CUBAGEM(M3)';
1649
        $aFont = $this->formatPadrao;
1650
        $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...
1651
        $qCarga = 0;
1652
        foreach ($this->infQ as $infQ) {
1653
            if ($this->getTagValue($infQ, "cUnid") == '00') {
1654
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1655
            }
1656
        }
1657
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1658
        $aFont = array(
1659
            'font' => $this->fontePadrao,
1660
            'size' => 7,
1661
            'style' => 'B');
1662
        $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...
1663
        $x = $w * 0.45;
1664
        //$this->pdf->line($x+37, $y, $x+37, $y + 9);
1665
        $texto = 'QTDE(VOL)';
1666
        $aFont = $this->formatPadrao;
1667
        $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...
1668
        $qCarga = 0;
1669
        foreach ($this->infQ as $infQ) {
1670
            if ($this->getTagValue($infQ, "cUnid") == '03') {
1671
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1672
            }
1673
        }
1674
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1675
        $aFont = array(
1676
            'font' => $this->fontePadrao,
1677
            'size' => 7,
1678
            'style' => 'B');
1679
        $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...
1680
        $x = $w * 0.53;
1681
        $this->pdf->line($x + 56, $y, $x + 56, $y + 9);
1682
        /*$texto = 'NOME DA SEGURADORA';
1683
        $aFont = $this->formatPadrao;
1684
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1685
        $texto = $this->getTagValue($this->seg, "xSeg");
1686
        $aFont = array(
1687
            'font' => $this->fontePadrao,
1688
            'size' => 7,
1689
            'style' => 'B');
1690
        $this->pdf->textBox($x + 31, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1691
        $y += 3;
1692
        $this->pdf->line($x, $y, $w + 1, $y);
1693
        $texto = 'RESPONSÁVEL';
1694
        $aFont = $this->formatPadrao;
1695
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1696
        $texto = $this->respSeg;
1697
        $aFont = array(
1698
            'font' => $this->fontePadrao,
1699
            'size' => 7,
1700
            'style' => 'B');
1701
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1702
        $x = $w * 0.68;
1703
        $this->pdf->line($x, $y, $x, $y + 6);
1704
        $texto = 'NÚMERO DA APOLICE';
1705
        $aFont = $this->formatPadrao;
1706
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1707
        $texto = $this->getTagValue($this->seg, "nApol");
1708
        $aFont = array(
1709
            'font' => $this->fontePadrao,
1710
            'size' => 7,
1711
            'style' => 'B');
1712
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1713
        $x = $w * 0.85;
1714
        $this->pdf->line($x, $y, $x, $y + 6);
1715
        $texto = 'NÚMERO DA AVERBAÇÃO';
1716
        $aFont = $this->formatPadrao;
1717
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1718
        $texto = $this->getTagValue($this->seg, "nAver");
1719
        $aFont = array(
1720
            'font' => $this->fontePadrao,
1721
            'size' => 7,
1722
            'style' => 'B');
1723
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1724
    }
1725
1726
    /**
1727
     * compValorServ
1728
     * Monta o campo com os componentes da prestação de serviços.
1729
     *
1730
     * @param  number $x Posição horizontal canto esquerdo
1731
     * @param  number $y Posição vertical canto superior
1732
     * @return number Posição vertical final
1733
     */
1734
    protected function compValorServ($x = 0, $y = 0)
1735
    {
1736
        $oldX = $x;
1737
        $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...
1738
        if ($this->orientacao == 'P') {
1739
            $maxW = $this->wPrint;
1740
        } else {
1741
            $maxW = $this->wPrint - $this->wCanhoto;
1742
        }
1743
        $w = $maxW;
1744
        $h = 25;
1745
        $texto = 'COMPONENTES DO VALOR DA PRESTAÇÃO DO SERVIÇO';
1746
        $aFont = $this->formatPadrao;
1747
        $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...
1748
        $y += 3.4;
1749
        $this->pdf->line($x, $y, $w + 1, $y);
1750
        $texto = 'NOME';
1751
        $aFont = $this->formatPadrao;
1752
        $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...
1753
        $yIniDados = $y;
1754
        $x = $w * 0.14;
1755
        $texto = 'VALOR';
1756
        $aFont = $this->formatPadrao;
1757
        $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...
1758
        $x = $w * 0.28;
1759
        $this->pdf->line($x, $y, $x, $y + 21.5);
1760
        $texto = 'NOME';
1761
        $aFont = $this->formatPadrao;
1762
        $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...
1763
        $x = $w * 0.42;
1764
        $texto = 'VALOR';
1765
        $aFont = $this->formatPadrao;
1766
        $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...
1767
        $x = $w * 0.56;
1768
        $this->pdf->line($x, $y, $x, $y + 21.5);
1769
        $texto = 'NOME';
1770
        $aFont = $this->formatPadrao;
1771
        $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...
1772
        $x = $w * 0.70;
1773
        $texto = 'VALOR';
1774
        $aFont = $this->formatPadrao;
1775
        $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...
1776
        $x = $w * 0.86;
1777
        $this->pdf->line($x, $y, $x, $y + 21.5);
1778
        $y += 1;
1779
        $texto = 'VALOR TOTAL DO SERVIÇO';
1780
        $aFont = $this->formatPadrao;
1781
        $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...
1782
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
1783
        $aFont = array(
1784
            'font' => $this->fontePadrao,
1785
            'size' => 9,
1786
            'style' => 'B');
1787
        $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...
1788
        $y += 10;
1789
        $this->pdf->line($x, $y, $w + 1, $y);
1790
        $y += 1;
1791
        $texto = 'VALOR A RECEBER';
1792
        $aFont = $this->formatPadrao;
1793
        $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...
1794
        $texto = number_format($this->getTagValue($this->vPrest, "vRec"), 2, ",", ".");
1795
        $aFont = array(
1796
            'font' => $this->fontePadrao,
1797
            'size' => 9,
1798
            'style' => 'B');
1799
        $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...
1800
        $auxX = $oldX;
1801
        $yIniDados += 4;
1802
        foreach ($this->Comp as $k => $d) {
1803
            $nome = $this->Comp->item($k)->getElementsByTagName('xNome')->item(0)->nodeValue;
1804
            $valor = number_format(
1805
                $this->Comp->item($k)->getElementsByTagName('vComp')->item(0)->nodeValue,
1806
                2,
1807
                ",",
1808
                "."
1809
            );
1810
            if ($auxX > $w * 0.60) {
1811
                $yIniDados = $yIniDados + 4;
1812
                $auxX = $oldX;
1813
            }
1814
            $texto = $nome;
1815
            $aFont = $this->formatPadrao;
1816
            $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...
1817
            $auxX += $w * 0.14;
1818
            $texto = $valor;
1819
            $aFont = $this->formatPadrao;
1820
            $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...
1821
            $auxX += $w * 0.14;
1822
        }
1823
    }
1824
1825
    /**
1826
     * impostos
1827
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1828
     *
1829
     * @param  number $x Posição horizontal canto esquerdo
1830
     * @param  number $y Posição vertical canto superior
1831
     * @return number Posição vertical final
1832
     */
1833
    protected function impostos($x = 0, $y = 0)
1834
    {
1835
        $oldX = $x;
1836
        $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...
1837
        if ($this->orientacao == 'P') {
1838
            $maxW = $this->wPrint;
1839
        } else {
1840
            $maxW = $this->wPrint - $this->wCanhoto;
1841
        }
1842
        $w = $maxW;
1843
        $h = 13;
1844
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
1845
        $aFont = $this->formatPadrao;
1846
        $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...
1847
        $y += 3.4;
1848
        $this->pdf->line($x, $y, $w + 1, $y);
1849
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
1850
        $aFont = $this->formatPadrao;
1851
        $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...
1852
        $x += $w * 0.26;
1853
        $this->pdf->line($x, $y, $x, $y + 9.5);
1854
        $texto = 'BASE DE CALCULO';
1855
        $aFont = $this->formatPadrao;
1856
        $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...
1857
        $wCol02 = 0.15;
1858
        $x += $w * $wCol02;
1859
        $this->pdf->line($x, $y, $x, $y + 9.5);
1860
        $texto = 'ALÍQ ICMS';
1861
        $aFont = $this->formatPadrao;
1862
        $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...
1863
        $x += $w * $wCol02;
1864
        $this->pdf->line($x, $y, $x, $y + 9.5);
1865
        $texto = 'VALOR ICMS';
1866
        $aFont = $this->formatPadrao;
1867
        $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...
1868
        $x += $w * $wCol02;
1869
        $this->pdf->line($x, $y, $x, $y + 9.5);
1870
        $texto = '% RED. BC ICMS';
1871
        $aFont = $this->formatPadrao;
1872
        $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...
1873
        $x += $w * $wCol02;
1874
        $this->pdf->line($x, $y, $x, $y + 9.5);
1875
        $texto = 'VALOR ICMS ST';
1876
        $aFont = $this->formatPadrao;
1877
        $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...
1878
        /*$x += $w * 0.14;
1879
        $this->pdf->line($x, $y, $x, $y + 9.5);
1880
        $texto = 'ICMS ST';
1881
        $aFont = $this->formatPadrao;
1882
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
1883
         * */
1884
        $x = $oldX;
1885
        $y = $y + 4;
1886
        $texto = $this->getTagValue($this->ICMS, "CST");
1887
        switch ($texto) {
1888
            case '00':
1889
                $texto = "00 - Tributação normal ICMS";
1890
                break;
1891
            case '20':
1892
                $texto = "20 - Tributação com BC reduzida do ICMS";
1893
                break;
1894
            case '40':
1895
                $texto = "40 - ICMS isenção";
1896
                break;
1897
            case '41':
1898
                $texto = "41 - ICMS não tributada";
1899
                break;
1900
            case '51':
1901
                $texto = "51 - ICMS diferido";
1902
                break;
1903
            case '60':
1904
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
1905
                break;
1906
            case '90':
1907
                if ($this->ICMSOutraUF) {
1908
                    $texto = "90 - ICMS Outra UF";
1909
                } else {
1910
                    $texto = "90 - ICMS Outros";
1911
                }
1912
                break;
1913
        }
1914
        if ($this->getTagValue($this->ICMS, "CST") == '60') {
1915
            $aFont = $this->formatNegrito;
1916
            $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...
1917
            $x += $w * 0.26;
1918
            $texto = !empty($this->ICMS->getElementsByTagName("vBCSTRet")->item(0)->nodeValue) ?
1919
                number_format($this->getTagValue($this->ICMS, "vBCSTRet"), 2, ",", ".") : (
1920
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1921
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1922
                );
1923
            $aFont = $this->formatNegrito;
1924
            $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...
1925
            $x += $w * $wCol02;
1926
            $texto = !empty($this->ICMS->getElementsByTagName("pICMSSTRet")->item(0)->nodeValue) ?
1927
                number_format($this->getTagValue($this->ICMS, "pICMSSTRet"), 2, ",", ".") : (
1928
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1929
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
1930
                );
1931
            $aFont = $this->formatNegrito;
1932
            $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...
1933
            $x += $w * $wCol02;
1934
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1935
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
1936
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
1937
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
1938
                );
1939
            $aFont = $this->formatNegrito;
1940
            $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...
1941
            $x += $w * $wCol02;
1942
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1943
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
1944
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
1945
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
1946
                );
1947
            $aFont = $this->formatNegrito;
1948
            $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...
1949
            $x += $w * $wCol02;
1950
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
1951
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
1952
            $aFont = $this->formatNegrito;
1953
            $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...
1954
        } else {
1955
            $texto = $this->getTagValue($this->ICMSSN, "indSN") == 1 ? 'Simples Nacional' : $texto;
1956
            $aFont = $this->formatNegrito;
1957
            $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...
1958
            $x += $w * 0.26;
1959
            $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
1960
                number_format($this->getTagValue($this->ICMS, "vBC"), 2, ",", ".") : (
1961
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1962
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1963
                );
1964
            $aFont = $this->formatNegrito;
1965
            $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...
1966
            $x += $w * $wCol02;
1967
            $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
1968
                number_format($this->getTagValue($this->ICMS, "pICMS"), 2, ",", ".") : (
1969
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1970
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
1971
                );
1972
            $aFont = $this->formatNegrito;
1973
            $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...
1974
            $x += $w * $wCol02;
1975
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1976
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
1977
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
1978
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
1979
                );
1980
            $aFont = $this->formatNegrito;
1981
            $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...
1982
            $x += $w * $wCol02;
1983
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1984
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
1985
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
1986
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
1987
                );
1988
            $aFont = $this->formatNegrito;
1989
            $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...
1990
            $x += $w * $wCol02;
1991
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
1992
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
1993
            $aFont = $this->formatNegrito;
1994
            $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...
1995
        }
1996
        /*$x += $w * 0.14;
1997
        $texto = '';
1998
        $aFont = $this->formatNegrito;
1999
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
2000
    }
2001
2002
    /**
2003
     * geraChaveAdicCont
2004
     *
2005
     * @return string chave
2006
     */
2007
    protected function geraChaveAdicCont()
2008
    {
2009
        //cUF tpEmis CNPJ vNF ICMSp ICMSs DD  DV
2010
        // Quantidade de caracteres  02   01      14  14    01    01  02 01
2011
        $forma = "%02d%d%s%014d%01d%01d%02d";
2012
        $cUF = $this->ide->getElementsByTagName('cUF')->item(0)->nodeValue;
2013
        $CNPJ = "00000000000000" . $this->emit->getElementsByTagName('CNPJ')->item(0)->nodeValue;
2014
        $CNPJ = substr($CNPJ, -14);
2015
        $vCT = number_format($this->getTagValue($this->vPrest, "vRec"), 2, "", "") * 100;
2016
        $ICMS_CST = $this->getTagValue($this->ICMS, "CST");
2017
        switch ($ICMS_CST) {
2018
            case '00':
2019
            case '20':
2020
                $ICMSp = '1';
2021
                $ICMSs = '2';
2022
                break;
2023
            case '40':
2024
            case '41':
2025
            case '51':
2026
            case '90':
2027
                $ICMSp = '2';
2028
                $ICMSs = '2';
2029
                break;
2030
            case '60':
2031
                $ICMSp = '2';
2032
                $ICMSs = '1';
2033
                break;
2034
        }
2035
        $dd = $this->ide->getElementsByTagName('dhEmi')->item(0)->nodeValue;
2036
        $rpos = strrpos($dd, '-');
2037
        $dd = substr($dd, $rpos + 1);
2038
        $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...
2039
        $chave = $chave . $this->modulo11($chave);
2040
        return $chave;
2041
    }
2042
2043
    /**
2044
     * docOrig
2045
     * Monta o campo com os documentos originarios.
2046
     *
2047
     * @param  number $x Posição horizontal canto esquerdo
2048
     * @param  number $y Posição vertical canto superior
2049
     * @return number Posição vertical final
2050
     */
2051
    protected function docOrig($x = 0, $y = 0)
2052
    {
2053
        $oldX = $x;
2054
        $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...
2055
        if ($this->orientacao == 'P') {
2056
            $maxW = $this->wPrint;
2057
        } else {
2058
            $maxW = $this->wPrint - $this->wCanhoto;
2059
        }
2060
        $w = $maxW;
2061
        // SE FOR RODOVIARIO ( BTR-SEMPRE SERÁ )
2062
        if ($this->modal == '1') {
2063
            // 0 - Não; 1 - Sim Será lotação quando houver um único conhecimento de transporte por veículo,
2064
            // ou combinação veicular, e por viagem
2065
            $h = $this->lota == 1 ? 35 : 53;
2066
        } elseif ($this->modal == '2') {
2067
            $h = 53;
2068
        } elseif ($this->modal == '3') {
2069
            $h = 37.6;
2070
        } else {
2071
            $h = 35;
2072
        }
2073
        $texto = 'DOCUMENTOS ORIGINÁRIOS';
2074
        $aFont = $this->formatPadrao;
2075
        $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...
2076
        $descr1 = 'TIPO DOC';
2077
        $descr2 = 'CNPJ/CHAVE/OBS';
2078
        $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2079
        $y += 3.4;
2080
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
2081
        $texto = $descr1;
2082
        $aFont = $this->formatPadrao;
2083
        $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...
2084
        $yIniDados = $y;
2085
        $x += $w * 0.07;
2086
        $texto = $descr2;
2087
        $aFont = $this->formatPadrao;
2088
        $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...
2089
        $x += $w * 0.28;
2090
        $texto = $descr3;
2091
        $aFont = $this->formatPadrao;
2092
        $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...
2093
        $x += $w * 0.14;
2094
        if ($this->modal == '1') {
2095
            if ($this->lota == 1) {
2096
                $this->pdf->line($x, $y, $x, $y + 31.5); // TESTE
2097
            } else {
2098
                $this->pdf->line($x, $y, $x, $y + 49.5); // TESTE
2099
            }
2100
        } elseif ($this->modal == '2') {
2101
            $this->pdf->line($x, $y, $x, $y + 49.5);
2102
        } elseif ($this->modal == '3') {
2103
            $this->pdf->line($x, $y, $x, $y + 34.1);
2104
        } else {
2105
            $this->pdf->line($x, $y, $x, $y + 21.5);
2106
        }
2107
        $texto = $descr1;
2108
        $aFont = $this->formatPadrao;
2109
        $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...
2110
        $x += $w * 0.08;
2111
        $texto = $descr2;
2112
        $aFont = $this->formatPadrao;
2113
        $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...
2114
        $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2115
        $texto = $descr3;
2116
        $aFont = $this->formatPadrao;
2117
        $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...
2118
        $auxX = $oldX;
2119
        $yIniDados += 3;
2120
        foreach ($this->infNF as $k => $d) {
2121
            $mod = $this->infNF->item($k)->getElementsByTagName('mod');
2122
            $tp = ($mod && $mod->length > 0) ? $mod->item(0)->nodeValue : '';
2123
            $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...
2124
            $doc = $this->infNF->item($k)->getElementsByTagName('serie')->item(0)->nodeValue;
2125
            $doc .= '/' . $this->infNF->item($k)->getElementsByTagName('nDoc')->item(0)->nodeValue;
2126
            if ($auxX > $w * 0.90) {
2127
                $yIniDados = $yIniDados + 3;
2128
                $auxX = $oldX;
2129
            }
2130
            $texto = $tp;
2131
            $aFont = array(
2132
                'font' => $this->fontePadrao,
2133
                'size' => 8,
2134
                'style' => '');
2135
            //$this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
2136
            $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...
2137
            //$auxX += $w * 0.09;
2138
            $auxX += $w * 0.07;
2139
            $texto = $cnpj;
2140
            $aFont = array(
2141
                'font' => $this->fontePadrao,
2142
                'size' => 8,
2143
                'style' => '');
2144
            $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...
2145
            $auxX += $w * 0.28;
2146
            $texto = $doc;
2147
            $aFont = array(
2148
                'font' => $this->fontePadrao,
2149
                'size' => 8,
2150
                'style' => '');
2151
            $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...
2152
            $auxX += $w * 0.15;
2153
        }
2154
        foreach ($this->infNFe as $k => $d) {
2155
            $chaveNFe = $this->infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue;
2156
            $this->arrayNFe[] = $chaveNFe;
2157
        }
2158
        $qtdeNFe = 1;
2159
        if (count($this->arrayNFe) > 15) {
2160
            $this->flagDocOrigContinuacao = 1;
2161
            $qtdeNFe = count($this->arrayNFe);
2162
        }
2163
//        $totPag = count($this->arrayNFe) > 15 ? '2' : '1';
2164
        switch ($qtdeNFe) {
2165
            default:
2166
                $this->totPag = 1;
2167
            case ($qtdeNFe >= 1044):
2168
                $this->totPag = 11;
2169
                break;
2170
            case ($qtdeNFe > 928):
2171
                $this->totPag = 10;
2172
                break;
2173
            case ($qtdeNFe > 812):
2174
                $this->totPag = 9;
2175
                break;
2176
            case ($qtdeNFe > 696):
2177
                $this->totPag = 8;
2178
                break;
2179
            case ($qtdeNFe > 580):
2180
                $this->totPag = 7;
2181
                break;
2182
            case ($qtdeNFe > 464):
2183
                $this->totPag = 6;
2184
                break;
2185
            case ($qtdeNFe > 348):
2186
                $this->totPag = 5;
2187
                break;
2188
            case ($qtdeNFe > 232):
2189
                $this->totPag = 4;
2190
                break;
2191
            case ($qtdeNFe > 116):
2192
                $this->totPag = 3;
2193
                break;
2194
            case ($qtdeNFe > 16):
2195
                $this->totPag = 2;
2196
                break;
2197
            case ($qtdeNFe <= 16):
2198
                $this->totPag = 1;
2199
                break;
2200
        }
2201
        //$r = $this->cabecalho(1, 1, '1', $this->totPag);
2202
        $contador = 0;
2203
        while ($contador < count($this->arrayNFe)) {
2204
            if ($contador == 16) {
2205
                break;
2206
            }
2207
            $tp = 'NF-e';
2208
            $chaveNFe = $this->arrayNFe[$contador];
2209
            $numNFe = substr($chaveNFe, 25, 9);
2210
            $serieNFe = substr($chaveNFe, 22, 3);
2211
            $doc = $serieNFe . '/' . $numNFe;
2212
            if ($auxX > $w * 0.90) {
2213
                $yIniDados = $yIniDados + 3.5;
2214
                $auxX = $oldX;
2215
            }
2216
            $texto = $tp;
2217
            $aFont = array(
2218
                'font' => $this->fontePadrao,
2219
                'size' => 7,
2220
                'style' => '');
2221
            $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...
2222
            $auxX += $w * 0.07;
2223
            $texto = $chaveNFe;
2224
            $aFont = array(
2225
                'font' => $this->fontePadrao,
2226
                'size' => 7,
2227
                'style' => '');
2228
            $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...
2229
            $auxX += $w * 0.28;
2230
            $texto = $doc;
2231
            $aFont = array(
2232
                'font' => $this->fontePadrao,
2233
                'size' => 7,
2234
                'style' => '');
2235
            $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...
2236
            $auxX += $w * 0.15;
2237
            $contador++;
2238
        }
2239
        foreach ($this->infOutros as $k => $d) {
2240
            $temp = $this->infOutros->item($k);
2241
            $tpDoc = $this->getTagValue($temp, "tpDoc");
2242
            $descOutros = $this->getTagValue($temp, "descOutros");
2243
            $nDoc = $this->getTagValue($temp, "nDoc");
2244
            $dEmi = "Emissão: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dEmi")));
2245
            $vDocFisc = $this->getTagValue($temp, "vDocFisc", "Valor: ");
2246
            $dPrev = "Entrega: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dPrev")));
2247
            switch ($tpDoc) {
2248
                case "00":
2249
                    $tpDoc = "00 - Declaração";
2250
                    break;
2251
                case "10":
2252
                    $tpDoc = "10 - Dutoviário";
2253
                    break;
2254
                case "99":
2255
                    $tpDoc = "99 - Outros: [" . $descOutros . "]";
2256
                    break;
2257
                default:
2258
                    break;
2259
            }
2260
            $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...
2261
            $cnpjChave = $dEmi . " " . $vDocFisc . " " . $dPrev;
2262
            if ($auxX > $w * 0.90) {
2263
                $yIniDados = $yIniDados + 4;
2264
                $auxX = $oldX;
2265
            }
2266
            $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...
2267
            $auxX += $w * 0.09;
2268
            $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...
2269
            $auxX += $w * 0.28;
2270
            $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...
2271
            $auxX += $w * 0.14;
2272
        }
2273
        foreach ($this->idDocAntEle as $k => $d) {
2274
            $tp = 'CT-e';
2275
            $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...
2276
            $numCTe = substr($chaveCTe, 25, 9);
2277
            $serieCTe = substr($chaveCTe, 22, 3);
2278
            $doc = $serieCTe . '/' . $numCTe;
2279
            if ($auxX > $w * 0.90) {
2280
                $yIniDados = $yIniDados + 4;
2281
                $auxX = $oldX;
2282
            }
2283
            $texto = $tp;
2284
            $aFont = array(
2285
                'font' => $this->fontePadrao,
2286
                'size' => 8,
2287
                'style' => '');
2288
            $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...
2289
            $auxX += $w * 0.09;
2290
            $texto = $chaveCTe;
2291
            $aFont = array(
2292
                'font' => $this->fontePadrao,
2293
                'size' => 8,
2294
                'style' => '');
2295
            $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...
2296
            $auxX += $w * 0.28;
2297
            $texto = $doc;
2298
            $aFont = array(
2299
                'font' => $this->fontePadrao,
2300
                'size' => 8,
2301
                'style' => '');
2302
            $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...
2303
            $auxX += $w * 0.14;
2304
        }
2305
        foreach ($this->infCTeMultimodal as $k => $d) {
2306
            $tp = 'CT-e';
2307
            $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...
2308
            $numCTe = substr($chaveCTe, 25, 9);
2309
            $serieCTe = substr($chaveCTe, 22, 3);
2310
            $doc = $serieCTe . '/' . $numCTe;
2311
            if ($auxX > $w * 0.90) {
2312
                $yIniDados = $yIniDados + 4;
2313
                $auxX = $oldX;
2314
            }
2315
            $texto = $tp;
2316
            $aFont = array(
2317
                'font' => $this->fontePadrao,
2318
                'size' => 8,
2319
                'style' => '');
2320
            $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...
2321
            $auxX += $w * 0.09;
2322
            $texto = $chaveCTe;
2323
            $aFont = array(
2324
                'font' => $this->fontePadrao,
2325
                'size' => 8,
2326
                'style' => '');
2327
            $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...
2328
            $auxX += $w * 0.28;
2329
            $texto = $doc;
2330
            $aFont = array(
2331
                'font' => $this->fontePadrao,
2332
                'size' => 8,
2333
                'style' => '');
2334
            $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...
2335
            $auxX += $w * 0.14;
2336
        }
2337
    }
2338
2339
    /**
2340
     * docOrigContinuacao
2341
     * Monta o campo com os documentos originarios.
2342
     *
2343
     * @param  number $x Posição horizontal canto esquerdo
2344
     * @param  number $y Posição vertical canto superior
2345
     * @return number Posição vertical final
2346
     */
2347
    protected function docOrigContinuacao($x = 0, $y = 0)
2348
    {
2349
        $x2 = $x;
2350
        $y2 = $y;
2351
        $contador = 16;
2352
        for ($i = 2; $i <= $this->totPag; $i++) {
2353
            $x = $x2;
2354
            $y = $y2;
2355
            $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...
2356
            $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...
2357
            $oldX = $x;
2358
            $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...
2359
            if ($this->orientacao == 'P') {
2360
                $maxW = $this->wPrint;
2361
            } else {
2362
                $maxW = $this->wPrint - $this->wCanhoto;
2363
            }
2364
            $w = $maxW;
2365
            //$h = 6; // de sub-titulo
2366
            //$h = 6 + 3; // de altura do texto (primeira linha
2367
            //$h = 9 + 3.5 ;// segunda linha
2368
            //$h = 9 + 3.5+ 3.5 ;// segunda linha
2369
            $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9;
2370
            if (count($this->arrayNFe) % 2 != 0) {
2371
                $h = $h + 3.5;
2372
            } // Caso tenha apenas 1 registro na ultima linha
2373
            $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO';
2374
            $aFont = $this->formatPadrao;
2375
            $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...
2376
            $descr1 = 'TIPO DOC';
2377
            $descr2 = 'CNPJ/CHAVE/OBS';
2378
            $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2379
            $y += 3.4;
2380
            $this->pdf->line($x, $y, $w + 1, $y);
2381
            $texto = $descr1;
2382
            $aFont = $this->formatPadrao;
2383
            $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...
2384
            $yIniDados = $y;
2385
            $x += $w * 0.07; // COLUNA CNPJ/CHAVE/OBS
2386
            $texto = $descr2;
2387
            $aFont = $this->formatPadrao;
2388
            $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...
2389
            $x += $w * 0.28;
2390
            $texto = $descr3;
2391
            $aFont = $this->formatPadrao;
2392
            $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...
2393
            $x += $w * 0.14;
2394
            if ($this->modal == '1') {
2395
                if ($this->lota == 1) {
2396
                    $this->pdf->line($x, $y, $x, $y + 31.5);
2397
                } else {
2398
                    $this->pdf->line($x, $y, $x, $y + 49.5);
2399
                }
2400
            } elseif ($this->modal == '2') {
2401
                $this->pdf->line($x, $y, $x, $y + 49.5);
2402
            } elseif ($this->modal == '3') {
2403
                $this->pdf->line($x, $y, $x, $y + 34.1);
2404
            } else {
2405
                $this->pdf->line($x, $y, $x, $y + 21.5);
2406
            }
2407
            $texto = $descr1;
2408
            $aFont = $this->formatPadrao;
2409
            $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...
2410
            $x += $w * 0.08;
2411
            $texto = $descr2;
2412
            $aFont = $this->formatPadrao;
2413
            $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...
2414
            $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2415
            $texto = $descr3;
2416
            $aFont = $this->formatPadrao;
2417
            $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...
2418
            $auxX = $oldX;
2419
            $yIniDados += 3;
2420
            while ($contador < (count($this->arrayNFe))) {
2421
                if ($contador % (116 * ($i - 1)) == 0) {
2422
//                    $contador++;
2423
                    break;
2424
                }
2425
                $tp = 'NF-e';
2426
                $chaveNFe = $this->arrayNFe[$contador];
2427
                $numNFe = substr($chaveNFe, 25, 9);
2428
                $serieNFe = substr($chaveNFe, 22, 3);
2429
                $doc = $serieNFe . '/' . $numNFe;
2430
                if ($auxX > $w * 0.90) {
2431
                    $yIniDados = $yIniDados + 3.5;
2432
                    $auxX = $oldX;
2433
                }
2434
                $texto = $tp;
2435
                $aFont = array(
2436
                    'font' => $this->fontePadrao,
2437
                    'size' => 7,
2438
                    'style' => '');
2439
                $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...
2440
                $auxX += $w * 0.07;
2441
                $texto = $chaveNFe;
2442
                $aFont = array(
2443
                    'font' => $this->fontePadrao,
2444
                    'size' => 7,
2445
                    'style' => '');
2446
                $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...
2447
                $auxX += $w * 0.28;
2448
                $texto = $doc;
2449
                $aFont = array(
2450
                    'font' => $this->fontePadrao,
2451
                    'size' => 7,
2452
                    'style' => '');
2453
                $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...
2454
                $auxX += $w * 0.15;
2455
                $contador++;
2456
            }
2457
        }
2458
    }
2459
2460
    /**
2461
     * docCompl
2462
     * Monta o campo com os dados do remetente na DACTE.
2463
     *
2464
     * @param number $x Posição horizontal canto esquerdo
2465
     * @param number $y Posição vertical canto superior
2466
     * @return number Posição vertical final
2467
     */
2468
    protected function docCompl($x = 0, $y = 0)
2469
    {
2470
        $oldX = $x;
2471
        $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...
2472
        if ($this->orientacao == 'P') {
2473
            $maxW = $this->wPrint;
2474
        } else {
2475
            $maxW = $this->wPrint - $this->wCanhoto;
2476
        }
2477
        $w = $maxW;
2478
        $h = 80;
2479
        if ($this->tpCTe == 1) {
2480
            $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
2481
            $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
2482
            $descr2 = 'VALOR COMPLEMENTADO';
2483
        } else {
2484
            $texto = 'DETALHAMENTO DO CT-E ANULADO';
2485
            $descr1 = 'CHAVE DO CT-E ANULADO';
2486
            $descr2 = 'VALOR ANULADO';
2487
        }
2488
        $aFont = $this->formatPadrao;
2489
        $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...
2490
        $y += 3.4;
2491
        $this->pdf->line($x, $y, $w + 1, $y);
2492
        $texto = $descr1;
2493
        $aFont = $this->formatPadrao;
2494
        $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...
2495
        $yIniDados = $y;
2496
        $x += $w * 0.37;
2497
        $texto = $descr2;
2498
        $aFont = $this->formatPadrao;
2499
        $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...
2500
        $x += $w * 0.13;
2501
        $this->pdf->line($x, $y, $x, $y + 76.5);
2502
        $texto = $descr1;
2503
        $aFont = $this->formatPadrao;
2504
        $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...
2505
        $x += $w * 0.3;
2506
        $texto = $descr2;
2507
        $aFont = $this->formatPadrao;
2508
        $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...
2509
        $auxX = $oldX;
2510
        $yIniDados += 4;
2511
        if ($auxX > $w * 0.90) {
2512
            $yIniDados = $yIniDados + 4;
2513
            $auxX = $oldX;
2514
        }
2515
        $texto = $this->chaveCTeRef;
2516
        $aFont = array(
2517
            'font' => $this->fontePadrao,
2518
            'size' => 8,
2519
            'style' => '');
2520
        $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...
2521
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
2522
        $aFont = array(
2523
            'font' => $this->fontePadrao,
2524
            'size' => 8,
2525
            'style' => '');
2526
        $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...
2527
    }
2528
2529
    /**
2530
     * observacao
2531
     * Monta o campo com os dados do remetente na DACTE.
2532
     *
2533
     * @param  number $x Posição horizontal canto esquerdo
2534
     * @param  number $y Posição vertical canto superior
2535
     * @return number Posição vertical final
2536
     */
2537
    protected function observacao($x = 0, $y = 0)
2538
    {
2539
        $oldX = $x;
2540
        $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...
2541
        if ($this->orientacao == 'P') {
2542
            $maxW = $this->wPrint;
2543
        } else {
2544
            $maxW = $this->wPrint - $this->wCanhoto;
2545
        }
2546
        $w = $maxW;
2547
        //$h = 18;
2548
        $h = 18.8;
2549
        $texto = 'OBSERVAÇÕES';
2550
        $aFont = $this->formatPadrao;
2551
        $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...
2552
        $y += 3.4;
2553
        $this->pdf->line($x, $y, $w + 1, $y);
2554
        $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...
2555
        $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...
2556
        $texto = '';
2557
        foreach ($this->compl as $k => $d) {
2558
            $xObs = $this->getTagValue($this->compl->item($k), "xObs");
2559
            $texto .= $xObs;
2560
        }
2561
        $textoObs = explode("Motorista:", $texto);
2562
        $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : '';
2563
        $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n");
2564
        $aFont = array(
2565
            'font' => $this->fontePadrao,
2566
            'size' => 7.5,
2567
            'style' => '');
2568
        $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...
2569
        $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...
2570
    }
2571
2572
    /**
2573
     * modalRod
2574
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2575
     *
2576
     * @param  number $x Posição horizontal canto esquerdo
2577
     * @param  number $y Posição vertical canto superior
2578
     * @return number Posição vertical final
2579
     */
2580
    protected function modalRod($x = 0, $y = 0)
2581
    {
2582
        $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...
2583
        $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...
2584
        $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...
2585
        if ($this->orientacao == 'P') {
2586
            $maxW = $this->wPrint;
2587
        } else {
2588
            $maxW = $this->wPrint - $this->wCanhoto;
2589
        }
2590
        $w = $maxW;
2591
        $h = 3;
2592
        $texto = 'DADOS ESPECÍFICOS DO MODAL RODOVIÁRIO';
2593
        $aFont = $this->formatPadrao;
2594
        $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...
2595
        if ($this->lota == 1) {
2596
            $this->pdf->line($x, $y + 12, $w + 1, $y + 12); // LINHA DE BAIXO
2597
        }
2598
        $y += 3.4;
2599
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2600
        $texto = 'RNTRC DA EMPRESA';
2601
        $aFont = $this->formatPadrao;
2602
        $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...
2603
        $texto = $this->getTagValue($this->rodo, "RNTRC");
2604
        $aFont = $this->formatNegrito;
2605
        $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...
2606
        $x += $w * 0.23;
2607
        $this->pdf->line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA
2608
        $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR';
2609
        $aFont = $this->formatPadrao;
2610
        $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...
2611
    }
2612
2613
    /**
2614
     * modalAereo
2615
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2616
     *
2617
     * @param  number $x Posição horizontal canto esquerdo
2618
     * @param  number $y Posição vertical canto superior
2619
     * @return number Posição vertical final
2620
     */
2621
    protected function modalAereo($x = 0, $y = 0)
2622
    {
2623
        $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...
2624
        $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...
2625
        $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...
2626
        if ($this->orientacao == 'P') {
2627
            $maxW = $this->wPrint;
2628
        } else {
2629
            $maxW = $this->wPrint - $this->wCanhoto;
2630
        }
2631
        $w = $maxW;
2632
        $h = 3;
2633
        $texto = 'DADOS ESPECÍFICOS DO MODAL AÉREO';
2634
        $aFont = $this->formatPadrao;
2635
        $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...
2636
        $y += 3.4;
2637
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2638
        $texto = 'NÚMERO OPERACIONAL DO CONHECIMENTO AÉREO';
2639
        $aFont = $this->formatPadrao;
2640
        $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...
2641
        $texto = 'CLASSE DA TARIFA';
2642
        $aFont = $this->formatPadrao;
2643
        $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...
2644
        $texto = 'CÓDIGO DA TARIFA';
2645
        $aFont = $this->formatPadrao;
2646
        $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...
2647
        $texto = 'VALOR DA TARIFA';
2648
        $aFont = $this->formatPadrao;
2649
        $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...
2650
        $texto = $this->getTagValue($this->aereo, "nOCA");
2651
        $aFont = $this->formatNegrito;
2652
        $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...
2653
        $x += $w * 0.23;
2654
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS NÚMERO OP. DO CT-E AEREO
2655
        $texto = $this->getTagValue($this->aereo, "CL");
2656
        $aFont = $this->formatNegrito;
2657
        $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...
2658
        $x += 30;
2659
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS CLASSE DA TARIFA
2660
        $texto = $this->getTagValue($this->aereo, "cTar");
2661
        $aFont = $this->formatNegrito;
2662
        $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...
2663
        $x += 30;
2664
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS COD DA TARIFA
2665
        $texto = $this->getTagValue($this->aereo, "vTar");
2666
        $aFont = $this->formatNegrito;
2667
        $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...
2668
    }
2669
2670
    /**
2671
     * modalAquaviario
2672
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2673
     *
2674
     * @param  number $x Posição horizontal canto esquerdo
2675
     * @param  number $y Posição vertical canto superior
2676
     * @return number Posição vertical final
2677
     */
2678
    protected function modalAquaviario($x = 0, $y = 0)
2679
    {
2680
        $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...
2681
        $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...
2682
        if ($this->orientacao == 'P') {
2683
            $maxW = $this->wPrint;
2684
        } else {
2685
            $maxW = $this->wPrint - $this->wCanhoto;
2686
        }
2687
        $w = $maxW;
2688
        $h = 8.5;
2689
        $texto = 'DADOS ESPECÍFICOS DO MODAL AQUAVIÁRIO';
2690
        $aFont = $this->formatPadrao;
2691
        $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...
2692
        $y += 3.4;
2693
        $this->pdf->line($x, $y, $w + 1, $y);
2694
        $texto = 'PORTO DE EMBARQUE';
2695
        $aFont = $this->formatPadrao;
2696
        $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...
2697
        $texto = $this->getTagValue($this->aquav, "prtEmb");
2698
        $aFont = $this->formatNegrito;
2699
        $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...
2700
        $x += $w * 0.50;
2701
        $this->pdf->line($x, $y, $x, $y + 7.7);
2702
        $texto = 'PORTO DE DESTINO';
2703
        $aFont = $this->formatPadrao;
2704
        $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...
2705
        $texto = $this->getTagValue($this->aquav, "prtDest");
2706
        $aFont = $this->formatNegrito;
2707
        $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...
2708
        $y += 8;
2709
        $this->pdf->line(208, $y, 1, $y);
2710
        $x = 1;
2711
        $texto = 'IDENTIFICAÇÃO DO NAVIO / REBOCADOR';
2712
        $aFont = $this->formatPadrao;
2713
        $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...
2714
        $texto = $this->getTagValue($this->aquav, "xNavio");
2715
        $aFont = $this->formatNegrito;
2716
        $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...
2717
        $x += $w * 0.50;
2718
        $this->pdf->line($x, $y, $x, $y + 7.7);
2719
        $texto = 'VR DA B. DE CALC. AFRMM';
2720
        $aFont = $this->formatPadrao;
2721
        $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...
2722
        $texto = $this->getTagValue($this->aquav, "vPrest");
2723
        $aFont = $this->formatNegrito;
2724
        $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...
2725
        $x += $w * 0.17;
2726
        $this->pdf->line($x, $y, $x, $y + 7.7);
2727
        $texto = 'VALOR DO AFRMM';
2728
        $aFont = $this->formatPadrao;
2729
        $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...
2730
        $texto = $this->getTagValue($this->aquav, "vAFRMM");
2731
        $aFont = $this->formatNegrito;
2732
        $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...
2733
        $x += $w * 0.12;
2734
        $this->pdf->line($x, $y, $x, $y + 7.7);
2735
        $texto = 'TIPO DE NAVEGAÇÃO';
2736
        $aFont = $this->formatPadrao;
2737
        $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...
2738
        $texto = $this->getTagValue($this->aquav, "tpNav");
2739
        switch ($texto) {
2740
            case '0':
2741
                $texto = 'INTERIOR';
2742
                break;
2743
            case '1':
2744
                $texto = 'CABOTAGEM';
2745
                break;
2746
        }
2747
        $aFont = $this->formatNegrito;
2748
        $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...
2749
        $x += $w * 0.14;
2750
        $this->pdf->line($x, $y, $x, $y + 7.7);
2751
        $texto = 'DIREÇÃO';
2752
        $aFont = $this->formatPadrao;
2753
        $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...
2754
        $texto = $this->getTagValue($this->aquav, "direc");
2755
        switch ($texto) {
2756
            case 'N':
2757
                $texto = 'NORTE';
2758
                break;
2759
            case 'L':
2760
                $texto = 'LESTE';
2761
                break;
2762
            case 'S':
2763
                $texto = 'SUL';
2764
                break;
2765
            case 'O':
2766
                $texto = 'OESTE';
2767
                break;
2768
        }
2769
        $aFont = $this->formatNegrito;
2770
        $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...
2771
        $y += 8;
2772
        $this->pdf->line(208, $y, 1, $y);
2773
        $x = 1;
2774
        $texto = 'IDENTIFICAÇÃO DOS CONTEINERS';
2775
        $aFont = $this->formatPadrao;
2776
        $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...
2777
        if (($this->infNF->item(0) !== null)
2778
            && ($this->infNF->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2779
            $texto = $this->infNF
2780
                ->item(0)
2781
                ->getElementsByTagName('infUnidCarga')
2782
                ->item(0)
2783
                ->getElementsByTagName('idUnidCarga')
2784
                ->item(0)->nodeValue;
2785
        } elseif (($this->infNFe->item(0) !== null)
2786
            && ($this->infNFe->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2787
            $texto = $this->infNFe
2788
                ->item(0)
2789
                ->getElementsByTagName('infUnidCarga')
2790
                ->item(0)
2791
                ->getElementsByTagName('idUnidCarga')
2792
                ->item(0)
2793
                ->nodeValue;
2794
        } elseif (($this->infOutros->item(0) !== null)
2795
            && ($this->infOutros->item(0)->getElementsByTagName('infUnidCarga')->item(0)->nodeValue !== null)) {
2796
            $texto = $this->infOutros
2797
                ->item(0)
2798
                ->getElementsByTagName('infUnidCarga')
2799
                ->item(0)
2800
                ->getElementsByTagName('idUnidCarga')
2801
                ->item(0)
2802
                ->nodeValue;
2803
        } else {
2804
            $texto = '';
2805
        }
2806
        $aFont = $this->formatNegrito;
2807
        $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...
2808
        $x += $w * 0.50;
2809
        $this->pdf->line($x, $y, $x, $y + 7.7);
2810
        $texto = 'IDENTIFICAÇÃO DAS BALSAS';
2811
        $aFont = $this->formatPadrao;
2812
        $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...
2813
        $texto = '';
2814
        if ($this->getTagValue($this->aquav, "balsa") !== '') {
2815
            foreach ($this->aquav->getElementsByTagName('balsa') as $k => $d) {
2816
                if ($k == 0) {
2817
                    $texto = $this->aquav
2818
                        ->getElementsByTagName('balsa')
2819
                        ->item($k)
2820
                        ->getElementsByTagName('xBalsa')
2821
                        ->item(0)
2822
                        ->nodeValue;
2823
                } else {
2824
                    $texto = $texto
2825
                        . ' / '
2826
                        . $this->aquav
2827
                            ->getElementsByTagName('balsa')
2828
                            ->item($k)
2829
                            ->getElementsByTagName('xBalsa')
2830
                            ->item(0)
2831
                            ->nodeValue;
2832
                }
2833
            }
2834
        }
2835
        $aFont = $this->formatNegrito;
2836
        $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...
2837
    }
2838
2839
    /**
2840
     * modalFerr
2841
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2842
     *
2843
     * @param  number $x Posição horizontal canto esquerdo
2844
     * @param  number $y Posição vertical canto superior
2845
     * @return number Posição vertical final
2846
     */
2847
    protected function modalFerr($x = 0, $y = 0)
2848
    {
2849
        $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...
2850
        $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...
2851
        if ($this->orientacao == 'P') {
2852
            $maxW = $this->wPrint;
2853
        } else {
2854
            $maxW = $this->wPrint - $this->wCanhoto;
2855
        }
2856
        $w = $maxW;
2857
        $h = 19.6;
2858
        $texto = 'DADOS ESPECÍFICOS DO MODAL FERROVIÁRIO';
2859
        $aFont = $this->formatPadrao;
2860
        $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...
2861
        $y += 3.4;
2862
        $this->pdf->line($x, $y, $w + 1, $y);
2863
        $texto = 'DCL';
2864
        $aFont = array(
2865
            'font' => $this->fontePadrao,
2866
            'size' => 7,
2867
            'style' => 'B');
2868
        $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...
2869
        $this->pdf->line($x + 49.6, $y, $x + 49.6, $y + 3.5);
2870
        $texto = 'VAGÕES';
2871
        $aFont = array(
2872
            'font' => $this->fontePadrao,
2873
            'size' => 7,
2874
            'style' => 'B');
2875
        $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...
2876
        $y += 3.4;
2877
        $this->pdf->line($x, $y, $w + 1, $y);
2878
        // DCL
2879
        $texto = 'ID TREM';
2880
        $aFont = array(
2881
            'font' => $this->fontePadrao,
2882
            'size' => 6,
2883
            'style' => '');
2884
        $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...
2885
        $texto = $this->getTagValue($this->ferrov, "idTrem");
2886
        $aFont = array(
2887
            'font' => $this->fontePadrao,
2888
            'size' => 6,
2889
            'style' => 'B');
2890
        $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...
2891
        $x += $w * 0.06;
2892
        $y1 = $y + 12.5;
2893
        $this->pdf->line($x, $y, $x, $y1);
2894
        $texto = 'NUM';
2895
        $aFont = array(
2896
            'font' => $this->fontePadrao,
2897
            'size' => 6,
2898
            'style' => '');
2899
        $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...
2900
        $texto = $this->getTagValue($this->rem, "nDoc");
2901
        $aFont = array(
2902
            'font' => $this->fontePadrao,
2903
            'size' => 6,
2904
            'style' => 'B');
2905
        $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...
2906
        $x += $w * 0.06;
2907
        $this->pdf->line($x, $y, $x, $y1);
2908
        $texto = 'SÉRIE';
2909
        $aFont = array(
2910
            'font' => $this->fontePadrao,
2911
            'size' => 6,
2912
            'style' => '');
2913
        $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...
2914
        $texto = $this->getTagValue($this->rem, "serie");
2915
        $aFont = array(
2916
            'font' => $this->fontePadrao,
2917
            'size' => 6,
2918
            'style' => 'B');
2919
        $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...
2920
        $x += $w * 0.06;
2921
        $this->pdf->line($x, $y, $x, $y1);
2922
        $texto = 'EMISSÃO';
2923
        $aFont = array(
2924
            'font' => $this->fontePadrao,
2925
            'size' => 6,
2926
            'style' => '');
2927
        $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...
2928
        $texto = $this->ymdTodmy($this->getTagValue($this->rem, "dEmi"));
2929
        $aFont = array(
2930
            'font' => $this->fontePadrao,
2931
            'size' => 6,
2932
            'style' => 'B');
2933
        $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...
2934
        // VAGOES
2935
        $x += $w * 0.06;
2936
        $this->pdf->line($x, $y, $x, $y1);
2937
        $texto = 'NUM';
2938
        $aFont = array(
2939
            'font' => $this->fontePadrao,
2940
            'size' => 6,
2941
            'style' => '');
2942
        $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...
2943
        $texto = $this->getTagValue($this->ferrov, "nVag");
2944
        $aFont = array(
2945
            'font' => $this->fontePadrao,
2946
            'size' => 6,
2947
            'style' => 'B');
2948
        $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...
2949
        $x += $w * 0.06;
2950
        $this->pdf->line($x, $y, $x, $y1);
2951
        $texto = 'TIPO';
2952
        $aFont = array(
2953
            'font' => $this->fontePadrao,
2954
            'size' => 6,
2955
            'style' => '');
2956
        $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...
2957
        $texto = $this->getTagValue($this->ferrov, "tpVag");
2958
        $aFont = array(
2959
            'font' => $this->fontePadrao,
2960
            'size' => 6,
2961
            'style' => 'B');
2962
        $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...
2963
        $x += $w * 0.06;
2964
        $this->pdf->line($x, $y, $x, $y1);
2965
        $texto = 'CAPACIDADE';
2966
        $aFont = array(
2967
            'font' => $this->fontePadrao,
2968
            'size' => 6,
2969
            'style' => '');
2970
        $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...
2971
        $texto = $this->getTagValue($this->ferrov, "cap");
2972
        $aFont = array(
2973
            'font' => $this->fontePadrao,
2974
            'size' => 6,
2975
            'style' => 'B');
2976
        $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...
2977
        $x += $w * 0.08;
2978
        $this->pdf->line($x, $y, $x, $y1);
2979
        $texto = 'PESO REAL/TON';
2980
        $aFont = array(
2981
            'font' => $this->fontePadrao,
2982
            'size' => 6,
2983
            'style' => '');
2984
        $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...
2985
        $texto = $this->getTagValue($this->ferrov, "pesoR");
2986
        $aFont = array(
2987
            'font' => $this->fontePadrao,
2988
            'size' => 6,
2989
            'style' => 'B');
2990
        $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...
2991
        $x += $w * 0.09;
2992
        $this->pdf->line($x, $y, $x, $y1);
2993
        $texto = 'PESO BRUTO/TON';
2994
        $aFont = array(
2995
            'font' => $this->fontePadrao,
2996
            'size' => 6,
2997
            'style' => '');
2998
        $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...
2999
        $texto = $this->getTagValue($this->ferrov, "pesoBC");
3000
        $aFont = array(
3001
            'font' => $this->fontePadrao,
3002
            'size' => 6,
3003
            'style' => 'B');
3004
        $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...
3005
        $x += $w * 0.1;
3006
        $this->pdf->line($x, $y, $x, $y1);
3007
        $texto = 'IDENTIFICAÇÃO DOS CONTÊINERES';
3008
        $aFont = array(
3009
            'font' => $this->fontePadrao,
3010
            'size' => 6,
3011
            'style' => '');
3012
        $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...
3013
        $texto = $this->getTagValue($this->ferrov, "nCont");
3014
        $aFont = array(
3015
            'font' => $this->fontePadrao,
3016
            'size' => 6,
3017
            'style' => 'B');
3018
        $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...
3019
        // FLUXO
3020
        $x = 1;
3021
        $y += 12.9;
3022
        $h1 = $h * 0.5 + 0.27;
3023
        $wa = round($w * 0.103) + 0.5;
3024
        $texto = 'FLUXO FERROVIARIO';
3025
        $aFont = $this->formatPadrao;
3026
        $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...
3027
        $texto = $this->getTagValue($this->ferrov, "fluxo");
3028
        $aFont = array(
3029
            'font' => $this->fontePadrao,
3030
            'size' => 7,
3031
            'style' => 'B');
3032
        $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...
3033
        $y += 10;
3034
        $texto = 'TIPO DE TRÁFEGO';
3035
        $aFont = $this->formatPadrao;
3036
        $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...
3037
        $texto = $this->convertUnidTrafego($this->getTagValue($this->ferrov, "tpTraf"));
3038
        $aFont = array(
3039
            'font' => $this->fontePadrao,
3040
            'size' => 7,
3041
            'style' => 'B');
3042
        $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...
3043
        // Novo Box Relativo a Modal Ferroviário
3044
        $x = 22.5;
3045
        $y += -10.2;
3046
        $texto = 'INFORMAÇÕES DAS FERROVIAS ENVOLVIDAS';
3047
        $aFont = $this->formatPadrao;
3048
        $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...
3049
        $y += 3.4;
3050
        $this->pdf->line($x, $y, $w + 1, $y);
3051
        $w = $w * 0.2;
3052
        $h = $h * 1.04;
3053
        $texto = 'CÓDIGO INTERNO';
3054
        $aFont = array(
3055
            'font' => $this->fontePadrao,
3056
            'size' => 6,
3057
            'style' => '');
3058
        $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...
3059
        $texto = $this->getTagValue($this->ferrov, "cInt");
3060
        $aFont = array(
3061
            'font' => $this->fontePadrao,
3062
            'size' => 6,
3063
            'style' => 'B');
3064
        $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...
3065
        $texto = 'CNPJ';
3066
        $aFont = array(
3067
            'font' => $this->fontePadrao,
3068
            'size' => 6,
3069
            'style' => '');
3070
        $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...
3071
        $texto = $this->getTagValue($this->ferrov, "CNPJ");
3072
        $aFont = array(
3073
            'font' => $this->fontePadrao,
3074
            'size' => 6,
3075
            'style' => 'B');
3076
        $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...
3077
        $x += 50;
3078
        $texto = 'NOME';
3079
        $aFont = array(
3080
            'font' => $this->fontePadrao,
3081
            'size' => 6,
3082
            'style' => '');
3083
        $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...
3084
        $texto = $this->getTagValue($this->ferrov, "xNome");
3085
        $aFont = array(
3086
            'font' => $this->fontePadrao,
3087
            'size' => 6,
3088
            'style' => 'B');
3089
        $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...
3090
        $texto = 'INSCRICAO ESTADUAL';
3091
        $aFont = array(
3092
            'font' => $this->fontePadrao,
3093
            'size' => 6,
3094
            'style' => '');
3095
        $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...
3096
        $texto = $this->getTagValue($this->ferrov, "IE");
3097
        $aFont = array(
3098
            'font' => $this->fontePadrao,
3099
            'size' => 6,
3100
            'style' => 'B');
3101
        $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...
3102
        $x += 50;
3103
        $texto = 'PARTICIPAÇÃO OUTRA FERROVIA';
3104
        $aFont = array(
3105
            'font' => $this->fontePadrao,
3106
            'size' => 6,
3107
            'style' => '');
3108
        $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...
3109
        $texto = '';
3110
        $aFont = array(
3111
            'font' => $this->fontePadrao,
3112
            'size' => 6,
3113
            'style' => 'B');
3114
        $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...
3115
    }
3116
3117
    /**
3118
     * canhoto
3119
     * Monta o campo com os dados do remetente na DACTE.
3120
     *
3121
     * @param  number $x Posição horizontal canto esquerdo
3122
     * @param  number $y Posição vertical canto superior
3123
     * @return number Posição vertical final
3124
     */
3125
    protected function canhoto($x = 0, $y = 0)
3126
    {
3127
        $oldX = $x;
3128
        $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...
3129
        if ($this->orientacao == 'P') {
3130
            $maxW = $this->wPrint;
3131
        } else {
3132
            $maxW = $this->wPrint - $this->wCanhoto;
3133
        }
3134
        $w = $maxW - 1;
3135
        $h = 20;
3136
        $y = $y + 1;
3137
        $texto = 'DECLARO QUE RECEBI OS VOLUMES DESTE CONHECIMENTO EM PERFEITO ESTADO ';
3138
        $texto .= 'PELO QUE DOU POR CUMPRIDO O PRESENTE CONTRATO DE TRANSPORTE';
3139
        $aFont = $this->formatPadrao;
3140
        $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...
3141
        $y += 3.4;
3142
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAICO DO TEXTO DECLARO QUE RECEBI...
3143
        $texto = 'NOME';
3144
        $aFont = array(
3145
            'font' => $this->fontePadrao,
3146
            'size' => 6,
3147
            'style' => '');
3148
        $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...
3149
        $x += $w * 0.25;
3150
        $this->pdf->line($x, $y, $x, $y + 16.5);
3151
        $texto = 'ASSINATURA / CARIMBO';
3152
        $aFont = array(
3153
            'font' => $this->fontePadrao,
3154
            'size' => 6,
3155
            'style' => '');
3156
        $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...
3157
        $x += $w * 0.25;
3158
        $this->pdf->line($x, $y, $x, $y + 16.5);
3159
        $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n";
3160
        $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA';
3161
        $aFont = array(
3162
            'font' => $this->fontePadrao,
3163
            'size' => 6,
3164
            'style' => '');
3165
        $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...
3166
        $x = $oldX;
3167
        $y = $y + 5;
3168
        $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME
3169
        $texto = 'RG';
3170
        $aFont = array(
3171
            'font' => $this->fontePadrao,
3172
            'size' => 6,
3173
            'style' => '');
3174
        $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...
3175
        $x += $w * 0.85;
3176
        $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E
3177
        $texto = "CT-E";
3178
        $aFont = $this->formatNegrito;
3179
        $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...
3180
        $texto = "\r\n Nº. DOCUMENTO  " . $this->getTagValue($this->ide, "nCT") . " \n";
3181
        $texto .= "\r\n SÉRIE  " . $this->getTagValue($this->ide, "serie");
3182
        $aFont = array(
3183
            'font' => $this->fontePadrao,
3184
            'size' => 6,
3185
            'style' => '');
3186
        $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...
3187
        $x = $oldX;
3188
        $this->pdf->dashedHLine($x, $y + 12.7, $this->wPrint, 0.1, 80);
3189
    }
3190
3191
    /**
3192
     * dadosAdic
3193
     * Coloca o grupo de dados adicionais da DACTE.
3194
     *
3195
     * @param  number $x Posição horizontal canto esquerdo
3196
     * @param  number $y Posição vertical canto superior
3197
     * @param  number $h altura do campo
3198
     * @return number Posição vertical final
3199
     */
3200
    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...
3201
    {
3202
        $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...
3203
        //###########################################################################
3204
        //DADOS ADICIONAIS DACTE
3205
        if ($this->orientacao == 'P') {
3206
            $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...
3207
        } else {
3208
            $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...
3209
        }
3210
        //INFORMAÇÕES COMPLEMENTARES
3211
        $texto = "USO EXCLUSIVO DO EMISSOR DO CT-E";
3212
        $y += 3;
3213
        $w = $this->wAdic;
3214
        $h = 8; //mudar
3215
        $aFont = array(
3216
            'font' => $this->fontePadrao,
3217
            'size' => 6,
3218
            'style' => '');
3219
        $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...
3220
        //$this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3221
        $this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3222
        //o texto com os dados adicionais foi obtido na função xxxxxx
3223
        //e carregado em uma propriedade privada da classe
3224
        //$this->wAdic com a largura do campo
3225
        //$this->textoAdic com o texto completo do campo
3226
        $y += 1;
3227
        $aFont = $this->formatPadrao;
3228
        $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...
3229
        //RESERVADO AO FISCO
3230
        $texto = "RESERVADO AO FISCO";
3231
        $x += $w;
3232
        $y -= 1;
3233
        if ($this->orientacao == 'P') {
3234
            $w = $this->wPrint - $w;
3235
        } else {
3236
            $w = $this->wPrint - $w - $this->wCanhoto;
3237
        }
3238
        $aFont = array(
3239
            'font' => $this->fontePadrao,
3240
            'size' => 6,
3241
            'style' => '');
3242
        $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...
3243
        //inserir texto informando caso de contingência
3244
        //1 – Normal – emissão normal;
3245
        //2 – Contingência FS – emissão em contingência com impressão do DACTE em Formulário de Segurança;
3246
        //3 – Contingência SCAN – emissão em contingência  – SCAN;
3247
        //4 – Contingência DPEC - emissão em contingência com envio da Declaração Prévia de
3248
        //Emissão em Contingência – DPEC;
3249
        //5 – Contingência FS-DA - emissão em contingência com impressão do DACTE em Formulário de
3250
        //Segurança para Impressão de Documento Auxiliar de Documento Fiscal Eletrônico (FS-DA).
3251
        $xJust = $this->getTagValue($this->ide, 'xJust', 'Justificativa: ');
3252
        $dhCont = $this->getTagValue($this->ide, 'dhCont', ' Entrada em contingência : ');
3253
        $texto = '';
3254
        switch ($this->tpEmis) {
3255
            case 2:
3256
                $texto = 'CONTINGÊNCIA FS' . $dhCont . $xJust;
3257
                break;
3258
            case 3:
3259
                $texto = 'CONTINGÊNCIA SCAN' . $dhCont . $xJust;
3260
                break;
3261
            case 4:
3262
                $texto = 'CONTINGÊNCIA DPEC' . $dhCont . $xJust;
3263
                break;
3264
            case 5:
3265
                $texto = 'CONTINGÊNCIA FSDA' . $dhCont . $xJust;
3266
                break;
3267
        }
3268
        $y += 2;
3269
        $aFont = $this->formatPadrao;
3270
        $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...
3271
        return $y + $h;
3272
    }
3273
3274
    /**
3275
     * formatCNPJCPF
3276
     * Formata campo CnpjCpf contida na CTe
3277
     *
3278
     * @param  string $field campo cnpjCpf da CT-e
3279
     * @return string
3280
     */
3281
    protected function formatCNPJCPF($field)
3282
    {
3283
        if (!isset($field)) {
3284
            return '';
3285
        }
3286
        $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...
3287
            $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...
3288
        if ($cnpj != "" && $cnpj != "00000000000000") {
3289
            $cnpj = $this->formatField($cnpj, '###.###.###/####-##');
3290
        } else {
3291
            $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...
3292
                $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...
3293
        }
3294
        return $cnpj;
3295
    }
3296
3297
    /**
3298
     * formatFone
3299
     * Formata campo fone contida na CTe
3300
     *
3301
     * @param  string $field campo fone da CT-e
3302
     * @return string
3303
     */
3304
    protected function formatFone($field)
3305
    {
3306
        try {
3307
            $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...
3308
                $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...
3309
            $foneLen = strlen($fone);
3310
            if ($foneLen > 0) {
3311
                $fone2 = substr($fone, 0, $foneLen - 4);
3312
                $fone1 = substr($fone, 0, $foneLen - 8);
3313
                $fone = '(' . $fone1 . ') ' . substr($fone2, -4) . '-' . substr($fone, -4);
3314
            } else {
3315
                $fone = '';
3316
            }
3317
            return $fone;
3318
        } catch (Exception $exc) {
3319
            return '';
3320
        }
3321
    }
3322
3323
    /**
3324
     * unidade
3325
     * Converte a imformação de peso contida na CTe
3326
     *
3327
     * @param  string $c unidade de trafego extraida da CTe
3328
     * @return string
3329
     */
3330
    protected function unidade($c = '')
3331
    {
3332
        switch ($c) {
3333
            case '00':
3334
                $r = 'M3';
3335
                break;
3336
            case '01':
3337
                $r = 'KG';
3338
                break;
3339
            case '02':
3340
                $r = 'TON';
3341
                break;
3342
            case '03':
3343
                $r = 'UN';
3344
                break;
3345
            case '04':
3346
                $r = 'LT';
3347
                break;
3348
            case '05':
3349
                $r = 'MMBTU';
3350
                break;
3351
            default:
3352
                $r = '';
3353
        }
3354
        return $r;
3355
    }
3356
3357
    /**
3358
     * convertUnidTrafego
3359
     * Converte a imformação de peso contida na CTe
3360
     *
3361
     * @param  string $U Informação de trafego extraida da CTe
3362
     * @return string
3363
     */
3364
    protected function convertUnidTrafego($U = '')
3365
    {
3366
        if ($U) {
3367
            switch ($U) {
3368
                case '0':
3369
                    $stringU = 'Próprio';
3370
                    break;
3371
                case '1':
3372
                    $stringU = 'Mútuo';
3373
                    break;
3374
                case '2':
3375
                    $stringU = 'Rodoferroviário';
3376
                    break;
3377
                case '3':
3378
                    $stringU = 'Rodoviário';
3379
                    break;
3380
            }
3381
            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...
3382
        }
3383
    }
3384
3385
    /**
3386
     * multiUniPeso
3387
     * Fornece a imformação multiplicação de peso contida na CTe
3388
     *
3389
     * @param  interger $U Informação de peso extraida da CTe
3390
     * @return interger
3391
     */
3392
    protected function multiUniPeso($U = '')
3393
    {
3394
        if ($U === "01") {
3395
            // tonelada
3396
            //return 1000;
3397
            return 1;
3398
        }
3399
        return 1; // M3, KG, Unidade, litros, mmbtu
3400
    }
3401
3402
    protected function qrCodeDacte($y = 0)
3403
    {
3404
        $margemInterna = $this->margemInterna;
3405
        $barcode = new Barcode();
3406
        $bobj = $barcode->getBarcodeObj(
3407
            'QRCODE,M',
3408
            $this->qrCodCTe,
3409
            -4,
3410
            -4,
3411
            'black',
3412
            array(-2, -2, -2, -2)
3413
        )->setBackgroundColor('white');
3414
        $qrcode = $bobj->getPngData();
3415
        $wQr = 36;
3416
        $hQr = 36;
3417
        $yQr = ($y + $margemInterna);
3418
        if ($this->orientacao == 'P') {
3419
            $xQr = 170;
3420
        } else {
3421
            $xQr = 250;
3422
        }
3423
        // prepare a base64 encoded "data url"
3424
        $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
3425
        $this->pdf->image($pic, $xQr - 3, $yQr, $wQr, $hQr, 'PNG');
3426
    }
3427
}
3428