Passed
Push — master ( 206f2b...eebc5d )
by Roberto
01:12 queued 12s
created

Dacte::detCont()   F

Complexity

Conditions 24
Paths 4800

Size

Total Lines 203

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 600

Importance

Changes 0
Metric Value
cc 24
nc 4800
nop 2
dl 0
loc 203
ccs 0
cts 199
cp 0
crap 600
rs 0
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace NFePHP\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 $detCont = array();
74
    protected $arrayCont = array();
75
    protected $idDocAntEle = [];
76
    protected $qrCodCTe;
77
    protected $infCTeMultimodal = [];
78
79
    protected $wAdic = 150;
80
    protected $formatNegrito;
81
    protected $preVisualizar;
82
    protected $flagDocOrigContinuacao;
83
    protected $flagDetContContinuacao;
84
    protected $arrayNFe = array();
85
    protected $totPag;
86
    protected $margemInterna = 0;
87
    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
88
89
    /**
90
     * __construct
91
     *
92
     * @param string $xml Arquivo XML da CTe
93
     */
94
    public function __construct(
95
        $xml = ''
96
    )
97
    {
98
        $this->loadDoc($xml);
99
    }
100
101
    private function loadDoc($xml)
102
    {
103
        $this->xml = $xml;
104
        if (!empty($xml)) {
105
            $this->dom = new Dom();
106
            $this->dom->loadXML($this->xml);
107
            $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...
108
            if (empty($this->dom->getElementsByTagName("infCte")->item(0))) {
109
                throw new \Exception('Isso não é um CT-e.');
110
            }
111
            $this->infCte = $this->dom->getElementsByTagName("infCte")->item(0);
112
            $this->ide = $this->dom->getElementsByTagName("ide")->item(0);
113
            if ($this->getTagValue($this->ide, "mod") != '57') {
114
                throw new \Exception("O xml deve ser CT-e modelo 57.");
115
            }
116
            $this->tpCTe = $this->getTagValue($this->ide, "tpCTe");
117
            $this->emit = $this->dom->getElementsByTagName("emit")->item(0);
118
            $this->enderEmit = $this->dom->getElementsByTagName("enderEmit")->item(0);
119
            $this->rem = $this->dom->getElementsByTagName("rem")->item(0);
120
            $this->enderReme = $this->dom->getElementsByTagName("enderReme")->item(0);
121
            $this->dest = $this->dom->getElementsByTagName("dest")->item(0);
122
            $this->enderDest = $this->dom->getElementsByTagName("enderDest")->item(0);
123
            $this->exped = $this->dom->getElementsByTagName("exped")->item(0);
124
            $this->enderExped = $this->dom->getElementsByTagName("enderExped")->item(0);
125
            $this->receb = $this->dom->getElementsByTagName("receb")->item(0);
126
            $this->enderReceb = $this->dom->getElementsByTagName("enderReceb")->item(0);
127
            $this->infCarga = $this->dom->getElementsByTagName("infCarga")->item(0);
128
            $this->infQ = $this->dom->getElementsByTagName("infQ");
129
            $this->seg = $this->dom->getElementsByTagName("seg")->item(0);
130
            $this->rodo = $this->dom->getElementsByTagName("rodo")->item(0);
131
            $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...
132
            $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...
133
            $this->moto = $this->dom->getElementsByTagName("moto")->item(0);
134
            $this->veic = $this->dom->getElementsByTagName("veic");
135
            $this->ferrov = $this->dom->getElementsByTagName("ferrov")->item(0);
136
            // adicionar outros modais
137
            $this->infCteComp = $this->dom->getElementsByTagName("infCteComp")->item(0);
138
            $this->infCteAnu = $this->dom->getElementsByTagName("infCteAnu")->item(0);
139
            if ($this->tpCTe == 1) {
140
                $this->chaveCTeRef = $this->getTagValue($this->infCteComp, "chCTe");
141
            } else {
142
                $this->chaveCTeRef = $this->getTagValue($this->infCteAnu, "chCte");
143
            }
144
            $this->vPrest = $this->dom->getElementsByTagName("vPrest")->item(0);
145
            $this->Comp = $this->dom->getElementsByTagName("Comp");
146
            $this->infNF = $this->dom->getElementsByTagName("infNF");
147
            $this->infNFe = $this->dom->getElementsByTagName("infNFe");
148
            $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...
149
            $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...
150
            $this->compl = $this->dom->getElementsByTagName("compl");
151
            $this->ICMS = $this->dom->getElementsByTagName("ICMS")->item(0);
152
            $this->ICMSSN = $this->dom->getElementsByTagName("ICMSSN")->item(0);
153
            $this->ICMSOutraUF = $this->dom->getElementsByTagName("ICMSOutraUF")->item(0);
154
            $this->imp = $this->dom->getElementsByTagName("imp")->item(0);
155
            if (!empty($this->getTagValue($this->imp, "vTotTrib"))) {
156
                $textoAdic = number_format($this->getTagValue($this->imp, "vTotTrib"), 2, ",", ".");
157
                $this->textoAdic = "o valor aproximado de tributos incidentes sobre o preço deste serviço é de R$"
158
                    . $textoAdic;
159
            }
160
            $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0);
161
            $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0);
162
            //Tag tomador é identificado por toma03 na versão 2.00
163
            if ($this->infCte->getAttribute("versao") == "2.00") {
164
                $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0);
165
            }
166
            //modal aquaviário
167
            $this->aquav = $this->dom->getElementsByTagName("aquav")->item(0);
168
            if (!empty($this->aquav)) {
169
                $this->detCont = $this->aquav->getElementsByTagName("detCont");
170
            }
171
            $tomador = $this->getTagValue($this->toma03, "toma");
172
            //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4-Outros
173
            switch ($tomador) {
174
                case '0':
175
                    $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...
176
                    $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...
177
                    break;
178
                case '1':
179
                    $this->toma = $this->exped;
180
                    $this->enderToma = $this->enderExped;
181
                    break;
182
                case '2':
183
                    $this->toma = $this->receb;
184
                    $this->enderToma = $this->enderReceb;
185
                    break;
186
                case '3':
187
                    $this->toma = $this->dest;
188
                    $this->enderToma = $this->enderDest;
189
                    break;
190
                default:
191
                    $this->toma = $this->toma4;
192
                    $this->enderToma = $this->getTagValue($this->toma4, "enderToma");
193
                    break;
194
            }
195
            $this->tpEmis = $this->getTagValue($this->ide, "tpEmis");
196
            $this->tpImp = $this->getTagValue($this->ide, "tpImp");
197
            $this->tpAmb = $this->getTagValue($this->ide, "tpAmb");
198
            $this->tpCTe = $this->getTagValue($this->ide, "tpCTe");
199
            $this->qrCodCTe = $this->dom->getElementsByTagName('qrCodCTe')->item(0) ?
200
                $this->dom->getElementsByTagName('qrCodCTe')->item(0)->nodeValue : 'SEM INFORMAÇÃO DE QRCODE';
201
            $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...
202
            //01-Rodoviário; //02-Aéreo; //03-Aquaviário; //04-Ferroviário;//05-Dutoviário
203
            $this->modal = $this->getTagValue($this->ide, "modal");
204
        }
205
    }
206
207
    /**
208
     * montaDACTE
209
     * Esta função monta a DACTE conforme as informações fornecidas para a classe
210
     * durante sua construção.
211
     * A definição de margens e posições iniciais para a impressão são estabelecidas no
212
     * pelo conteúdo da funçao e podem ser modificados.
213
     *
214
     * @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...
215
     *                impressão (ex. P-retrato), se nada for fornecido será
216
     *                usado o padrão da NFe
217
     * @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...
218
     * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
219
     */
220
    protected function monta(
221
        $logo = ''
222
    )
223
    {
224
        if (!empty($logo)) {
225
            $this->logomarca = $this->adjustImage($logo);
226
        }
227
        $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...
228
        //pega o orientação do documento
229
        if (empty($this->orientacao)) {
230
            $this->orientacao = 'P';
231
            if ($this->tpImp == 2) {
232
                $this->orientacao = 'L';
233
            }
234
        }
235
        //instancia a classe pdf
236
        $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...
237
        // verifica se foi passa a fonte a ser usada
238
        $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...
239
            'font' => $this->fontePadrao,
240
            'size' => 6,
241
            'style' => '');
242
        $this->formatNegrito = array(
243
            'font' => $this->fontePadrao,
244
            'size' => 7,
245
            'style' => 'B');
246
        if ($this->orientacao == 'P') {
247
            // margens do PDF
248
            $margSup = 2;
249
            $margEsq = 2;
250
            $margDir = 2;
251
            // posição inicial do relatorio
252
            $xInic = 1;
253
            $yInic = 1;
254
            if ($this->papel == 'A4') {
255
                //A4 210x297mm
256
                $maxW = 210;
257
                $maxH = 297;
258
            }
259
        } else {
260
            // margens do PDF
261
            $margSup = 3;
262
            $margEsq = 3;
263
            $margDir = 3;
264
            // posição inicial do relatorio
265
            $xInic = 5;
266
            $yInic = 5;
267
            if ($this->papel == 'A4') {
268
                //A4 210x297mm
269
                $maxH = 210;
270
                $maxW = 297;
271
                $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...
272
            }
273
        }
274
        //total inicial de paginas
275
        $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...
276
        //largura imprimivel em mm
277
        $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...
278
        //comprimento imprimivel em mm
279
        $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...
280
        // estabelece contagem de paginas
281
        $this->pdf->aliasNbPages();
282
        // fixa as margens
283
        $this->pdf->setMargins($margEsq, $margSup, $margDir);
284
        $this->pdf->setDrawColor(0, 0, 0);
285
        $this->pdf->setFillColor(255, 255, 255);
286
        // inicia o documento
287
        $this->pdf->Open();
288
        // adiciona a primeira página
289
        $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...
290
        $this->pdf->setLineWidth(0.1);
291
        $this->pdf->setTextColor(0, 0, 0);
292
        //calculo do numero de páginas ???
293
        $totPag = 1;
294
        //montagem da primeira página
295
        $pag = 1;
296
        $x = $xInic;
297
        $y = $yInic;
298
        //coloca o cabeçalho
299
        $y = $this->canhoto($x, $y);
300
        $y += 24;
301
        $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...
302
        $y += 70;
303
        $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...
304
        $x = $this->wPrint * 0.5 + 2;
305
        $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...
306
        $y += 19;
307
        $x = $xInic;
308
        $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...
309
        $x = $this->wPrint * 0.5 + 2;
310
        $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...
311
        $y += 19;
312
        $x = $xInic;
313
        $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...
314
        if ($this->tpCTe == '0') {
315
            //Normal
316
            $y += 10;
317
            $x = $xInic;
318
            $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...
319
            $y += 17;
320
            $x = $xInic;
321
            $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...
322
            $y += 25;
323
            $x = $xInic;
324
            $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...
325
            $y += 13;
326
            $x = $xInic;
327
            if (empty($this->detCont)) {
328
                $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...
329
            } else {
330
                $r = $this->detCont($x, $y);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $r is correct as $this->detCont($x, $y) (which targets NFePHP\DA\CTe\Dacte::detCont()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

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...
331
                $y += 33;
332
            }
333
            if ($this->modal == '1') {
334
                if ($this->lota == 1) {
335
                    //$y += 24.95;
336
                    $y += 35;
337
                } else {
338
                    $y += 53;
339
                }
340
            } elseif ($this->modal == '2') {
341
                $y += 53;
342
            } elseif ($this->modal == '3') {
343
                if (empty($this->detCont)) {
344
                    $y += 33;
345
                }
346
            } else {
347
                $y += 24.95;
348
            }
349
            if ($this->modal != 3) {
350
                $x = $xInic;
351
                $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...
352
                $y = $y - 6;
353
            }
354
            switch ($this->modal) {
355
                case '1':
356
                    $y += 25.9;
357
                    $x = $xInic;
358
                    $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...
359
                    break;
360
                case '2':
361
                    $y += 25.9;
362
                    $x = $xInic;
363
                    $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...
364
                    break;
365
                case '3':
366
                    if(empty($this->detCont)) {
367
                        $y += 17.9;
368
                    }
369
                    $x = $xInic;
370
                    $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...
371
                    $y += 37.5;
372
                    break;
373
                case '4':
374
                    $y += 17.9;
375
                    $x = $xInic;
376
                    $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...
377
                    break;
378
                case '5':
379
                    $y += 17.9;
380
                    $x = $xInic;
381
                    // TODO fmertins 31/10/14: este método não existe...
382
                    $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...
383
                    break;
384
            }
385
            if ($this->modal == '1') {
386
                if ($this->lota == 1) {
387
                    $y += 37;
388
                } else {
389
                    $y += 8.9;
390
                }
391
            } elseif ($this->modal == '2') {
392
                $y += 8.9;
393
            } elseif ($this->modal == '3') {
394
                $y += 42.05;
395
            } else {
396
                $y += 37;
397
            }
398
        } else {
399
            //$r = $this->cabecalho(1, 1, $pag, $totPag);
400
            //Complementado
401
            $y += 10;
402
            $x = $xInic;
403
            $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...
404
            $y += 80;
405
            $x = $xInic;
406
            $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...
407
            $y += 25;
408
            $x = $xInic;
409
            $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...
410
            $y += 13;
411
            $x = $xInic;
412
            $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...
413
            $y += 15;
414
        }
415
        $x = $xInic;
416
        if ($this->modal == 3) {
417
            $y -= 30;
418
        }
419
        $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...
420
        //$y += 19;
421
        //$y += 11;
422
        //$y = $this->canhoto($x, $y);
423
        //coloca o rodapé da página
424
        if ($this->orientacao == 'P') {
425
            $this->rodape(2, $this->hPrint - 2);
426
        } else {
427
            $this->rodape($xInic, $this->hPrint + 2.3);
428
        }
429
        if ($this->modal == 3) {
430
            if ($this->flagDetContContinuacao == 1) {
431
                $this->detContContinuacao(1, 71);
432
            }
433
        } else {
434
            if ($this->flagDocOrigContinuacao == 1) {
435
                $this->docOrigContinuacao(1, 71);
436
            }
437
        }
438
    }
439
440
    /**
441
     * cabecalho
442
     * Monta o cabelhalho da DACTE ( retrato e paisagem )
443
     *
444
     * @param number $x Posição horizontal inicial, canto esquerdo
445
     * @param number $y Posição vertical inicial, canto superior
446
     * @param number $pag Número da Página
447
     * @param number $totPag Total de páginas
448
     * @return number Posição vertical final
449
     */
450
    protected function cabecalho($x = 0, $y = 0, $pag = '1', $totPag = '1')
451
    {
452
        $oldX = $x;
453
        $oldY = $y;
454
        if ($this->orientacao == 'P') {
455
            $maxW = $this->wPrint;
456
        } else {
457
            if ($pag == 1) {
458
                // primeira página
459
                $maxW = $this->wPrint - $this->wCanhoto;
460
            } else {
461
                // páginas seguintes
462
                $maxW = $this->wPrint;
463
            }
464
        }
465
        //##################################################################
466
        //coluna esquerda identificação do emitente
467
        //$w = round($maxW * 0.42);
468
        $w = round($maxW * 0.32);
469
        if ($this->orientacao == 'P') {
470
            $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...
471
                'font' => $this->fontePadrao,
472
                'size' => 6,
473
                'style' => '');
474
        } else {
475
            $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...
476
        }
477
        $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...
478
        $h = 35;
479
        $oldY += $h;
480
        //desenha a caixa
481
        $this->pdf->textBox($x, $y, $w + 2, $h + 1);
482
        // coloca o logo
483
        if (!empty($this->logomarca)) {
484
            $logoInfo = getimagesize($this->logomarca);
485
            //largura da imagem em mm
486
            $logoWmm = ($logoInfo[0] / 72) * 25.4;
487
            //altura da imagem em mm
488
            $logoHmm = ($logoInfo[1] / 72) * 25.4;
489
            if ($this->logoAlign == 'L') {
490
                $nImgW = round($w / 3, 0);
491
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
492
                $xImg = $x + 1;
493
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
494
                //estabelecer posições do texto
495
                $x1 = round($xImg + $nImgW + 1, 0);
496
                $y1 = round($h / 3 + $y, 0);
497
                $tw = round(2 * $w / 3, 0);
498
            } elseif ($this->logoAlign == 'C') {
499
                $nImgH = round($h / 3, 0);
500
                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
501
                $xImg = round(($w - $nImgW) / 2 + $x, 0);
502
                $yImg = $y + 3;
503
                $x1 = $x;
504
                $y1 = round($yImg + $nImgH + 1, 0);
505
                $tw = $w;
506
            } elseif ($this->logoAlign == 'R') {
507
                $nImgW = round($w / 3, 0);
508
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
509
                $xImg = round($x + ($w - (1 + $nImgW)), 0);
510
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
511
                $x1 = $x;
512
                $y1 = round($h / 3 + $y, 0);
513
                $tw = round(2 * $w / 3, 0);
514
            }
515
            $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...
516
        } else {
517
            $x1 = $x;
518
            $y1 = round($h / 3 + $y, 0);
519
            $tw = $w;
520
        }
521
        //Nome emitente
522
        $aFont = array(
523
            'font' => $this->fontePadrao,
524
            'size' => 9,
525
            'style' => 'B');
526
        $texto = $this->getTagValue($this->emit, "xNome");
527
        $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...
528
        //endereço
529
        $y1 = $y1 + 3;
530
        $aFont = array(
531
            'font' => $this->fontePadrao,
532
            'size' => 7,
533
            'style' => '');
534
        $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...
535
        $lgr = $this->getTagValue($this->enderEmit, "xLgr");
536
        $nro = $this->getTagValue($this->enderEmit, "nro");
537
        $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...
538
        $bairro = $this->getTagValue($this->enderEmit, "xBairro");
539
        $CEP = $this->getTagValue($this->enderEmit, "CEP");
540
        $CEP = $this->formatField($CEP, "#####-###");
541
        $mun = $this->getTagValue($this->enderEmit, "xMun");
542
        $UF = $this->getTagValue($this->enderEmit, "UF");
543
        $xPais = $this->getTagValue($this->enderEmit, "xPais");
544
        $texto = $lgr . "," . $nro . "\n" . $bairro . " - "
545
            . $CEP . " - " . $mun . " - " . $UF . " " . $xPais
546
            . "\n  Fone/Fax: " . $fone;
547
        $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...
548
        //CNPJ/CPF IE
549
        $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...
550
        $ie = $this->getTagValue($this->emit, "IE");
551
        $texto = 'CNPJ/CPF:  ' . $cpfCnpj . '     Insc.Estadual: ' . $ie;
552
        $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...
553
        //outra caixa
554
        $h1 = 17.5;
555
        $y1 = $y + $h + 1;
556
        $this->pdf->textBox($x, $y1, $w + 2, $h1);
557
        //TIPO DO CT-E
558
        $texto = 'TIPO DO CTE';
559
        //$wa = 37;
560
        $wa = 34;
561
        $aFont = array(
562
            'font' => $this->fontePadrao,
563
            'size' => 8,
564
            'style' => '');
565
        $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...
566
        $tpCTe = $this->getTagValue($this->ide, "tpCTe");
567
        //0 - CT-e Normal,1 - CT-e de Complemento de Valores,
568
        //2 - CT-e de Anulação de Valores,3 - CT-e Substituto
569
        switch ($tpCTe) {
570
            case '0':
571
                $texto = 'Normal';
572
                break;
573
            case '1':
574
                $texto = 'Complemento de Valores';
575
                break;
576
            case '2':
577
                $texto = 'Anulação de Valores';
578
                break;
579
            case '3':
580
                $texto = 'Substituto';
581
                break;
582
            default:
583
                $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...
584
        }
585
        $aFont = $this->formatNegrito;
586
        $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...
587
        //TIPO DO SERVIÇO
588
        $texto = 'TIPO DO SERVIÇO';
589
        $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...
590
        $aFont = array(
591
            'font' => $this->fontePadrao,
592
            'size' => 8,
593
            'style' => '');
594
        $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...
595
        $tpServ = $this->getTagValue($this->ide, "tpServ");
596
        //0 - Normal;1 - Subcontratação;2 - Redespacho;3 - Redespacho Intermediário
597
        switch ($tpServ) {
598
            case '0':
599
                $texto = 'Normal';
600
                break;
601
            case '1':
602
                $texto = 'Subcontratação';
603
                break;
604
            case '2':
605
                $texto = 'Redespacho';
606
                break;
607
            case '3':
608
                $texto = 'Redespacho Intermediário';
609
                break;
610
            case '4':
611
                $texto = 'Serviço Vinculado a Multimodal';
612
                break;
613
            default:
614
                $texto = 'ERRO' . $tpServ;
615
        }
616
        $aFont = $this->formatNegrito;
617
        $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...
618
        $this->pdf->line($w * 0.5, $y1, $w * 0.5, $y1 + $h1);
619
        //TOMADOR DO SERVIÇO
620
        $texto = 'IND.DO CT-E GLOBALIZADO';
621
        $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...
622
        $y2 = $y1 + 8;
623
        $aFont = array(
624
            'font' => $this->fontePadrao,
625
            'size' => 6,
626
            'style' => '');
627
        $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...
628
        $this->pdf->line($x, $y1 + 8, $w + 3, $y1 + 8);
629
        $toma = $this->getTagValue($this->ide, "indGlobalizado");
630
        //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros
631
        if ($toma == 1) {
632
            $aFont = array(
633
                'font' => $this->fontePadrao,
634
                'size' => 11,
635
                'style' => '');
636
            $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...
637
        } else {
638
            $aFont = array(
639
                'font' => $this->fontePadrao,
640
                'size' => 11,
641
                'style' => '');
642
            $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...
643
        }
644
        $aFont = $this->formatNegrito;
645
        $this->pdf->line($x + 3, $y2 + 4, $x + 3, $y2 + 8);
646
        $this->pdf->line($x + 8, $y2 + 4, $x + 8, $y2 + 8);
647
        $this->pdf->line($x + 3, $y2 + 4, $x + 8, $y2 + 4);
648
        $this->pdf->line($x + 3, $y2 + 8, $x + 8, $y2 + 8);
649
        $this->pdf->textBox($x - 6, $y2 + 4.4, $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...
650
        $this->pdf->line($x + 18, $y2 + 4, $x + 18, $y2 + 8);
651
        $this->pdf->line($x + 23, $y2 + 4, $x + 23, $y2 + 8);
652
        $this->pdf->line($x + 18, $y2 + 4, $x + 23, $y2 + 4);
653
        $this->pdf->line($x + 18, $y2 + 8, $x + 23, $y2 + 8);
654
        $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...
655
        //FORMA DE PAGAMENTO
656
        $texto = 'INF.DO CT-E GLOBALIZADO';
657
        $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...
658
        $aFont = array(
659
            'font' => $this->fontePadrao,
660
            'size' => 8,
661
            'style' => '');
662
        $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...
663
        $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...
664
        //##################################################################
665
        //coluna direita
666
        $x += $w + 2;
667
        $w = round($maxW * 0.212);
668
        $w1 = $w;
669
        $h = 11;
670
        $this->pdf->textBox($x, $y, $w + 48.5, $h + 1);
671
        $texto = "DACTE";
672
        $aFont = array(
673
            'font' => $this->fontePadrao,
674
            'size' => 10,
675
            'style' => 'B');
676
        $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...
677
        $aFont = array(
678
            'font' => $this->fontePadrao,
679
            'size' => 9,
680
            'style' => '');
681
        $texto = "Documento Auxiliar do Conhecimento de Transporte Eletrônico";
682
        $h = 10;
683
        $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...
684
        $x1 = $x + $w + 2;
685
        $w = round($maxW * 0.22, 0);
686
        $w2 = $w;
687
        $h = 11;
688
        $this->pdf->textBox($x1 + 46.5, $y, $w - 0.5, $h + 1);
689
        $texto = "MODAL";
690
        $aFont = array(
691
            'font' => $this->fontePadrao,
692
            'size' => 8,
693
            'style' => '');
694
        $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...
695
        switch ($this->modal) {
696
            case '1':
697
                $texto = 'Rodoviário';
698
                break;
699
            case '2':
700
                $texto = 'Aéreo';
701
                break;
702
            case '3':
703
                $texto = 'Aquaviário';
704
                break;
705
            case '4':
706
                $texto = 'Ferroviário';
707
                break;
708
            case '5':
709
                $texto = 'Dutoviário';
710
                break;
711
        }
712
        $aFont = array(
713
            'font' => $this->fontePadrao,
714
            'size' => 10,
715
            'style' => 'B');
716
        $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...
717
        //outra caixa
718
        $y += 12;
719
        $h = 9;
720
        $w = $w1 + $w2 + 2;
721
        $this->pdf->textBox($x, $y, $w + 0.5, $h + 1);
722
        //modelo
723
        $wa = 12;
724
        $xa = $x;
725
        $texto = 'MODELO';
726
        $aFont = array(
727
            'font' => $this->fontePadrao,
728
            'size' => 8,
729
            'style' => '');
730
        $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...
731
        $texto = $this->getTagValue($this->ide, "mod");
732
        $aFont = $this->formatNegrito;
733
        $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...
734
        $this->pdf->line($x + $wa, $y, $x + $wa, $y + $h + 1);
735
        //serie
736
        $wa = 11;
737
        $xa += $wa;
738
        $texto = 'SÉRIE';
739
        $aFont = array(
740
            'font' => $this->fontePadrao,
741
            'size' => 8,
742
            'style' => '');
743
        $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...
744
        $texto = $this->getTagValue($this->ide, "serie");
745
        $aFont = $this->formatNegrito;
746
        $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...
747
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
748
        //numero
749
        $xa += $wa;
750
        $wa = 14;
751
        $texto = 'NÚMERO';
752
        $aFont = array(
753
            'font' => $this->fontePadrao,
754
            'size' => 8,
755
            'style' => '');
756
        $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...
757
        $texto = $this->getTagValue($this->ide, "nCT");
758
        $aFont = $this->formatNegrito;
759
        $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...
760
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
761
        //folha
762
        $xa += $wa;
763
        $wa = 6;
764
        $texto = 'FL';
765
        $aFont = array(
766
            'font' => $this->fontePadrao,
767
            'size' => 8,
768
            'style' => '');
769
        $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...
770
        //$texto = '1/1';
771
        $texto = $pag . "/" . $totPag;
772
        $aFont = $this->formatNegrito;
773
        $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...
774
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
775
        //data  hora de emissão
776
        $xa += $wa;
777
        $wa = 28;
778
        $texto = 'DATA E HORA DE EMISSÃO';
779
        $aFont = array(
780
            'font' => $this->fontePadrao,
781
            'size' => 8,
782
            'style' => '');
783
        $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...
784
        $texto = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
785
            date('d/m/Y H:i:s', $this->toTimestamp($this->getTagValue($this->ide, "dhEmi"))) : '';
786
        $aFont = $this->formatNegrito;
787
        $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...
788
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
789
        //ISUF
790
        $xa += $wa;
791
        $wa = 30;
792
        $texto = 'INSC.SUF.DO DEST';
793
        $aFont = $this->formatPadrao;
794
        $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...
795
        $texto = $this->getTagValue($this->dest, "ISUF");
796
        $aFont = array(
797
            'font' => $this->fontePadrao,
798
            'size' => 7,
799
            'style' => 'B');
800
        $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...
801
        //outra caixa
802
        $y += $h + 1;
803
        $h = 23;
804
        $h1 = 14;
805
        $this->pdf->textBox($x, $y, $w + 0.5, $h1);
806
        //CODIGO DE BARRAS
807
        $chave_acesso = str_replace('CTe', '', $this->infCte->getAttribute("Id"));
808
        $bW = 85;
809
        $bH = 10;
810
        //codigo de barras
811
        $this->pdf->setFillColor(0, 0, 0);
812
        $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
813
        $this->pdf->textBox($x, $y + $h1, $w + 0.5, $h1 - 6);
814
        $texto = 'CHAVE DE ACESSO';
815
        $aFont = $this->formatPadrao;
816
        $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...
817
        $aFont = $this->formatNegrito;
818
        $texto = $this->formatField($chave_acesso, $this->formatoChave);
819
        $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...
820
        $this->pdf->textBox($x, $y + $h1 + 8, $w + 0.5, $h1 - 4.5);
821
        $texto = "Consulta em http://www.cte.fazenda.gov.br/portal";
822
        if ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
823
            $texto = "";
824
            $this->pdf->setFillColor(0, 0, 0);
825
            if ($this->tpEmis == 5) {
826
                $chaveContingencia = $this->geraChaveAdicCont();
827
                $this->pdf->code128($x + 20, $y1 + 10, $chaveContingencia, $bW * .9, $bH / 2);
828
            } else {
829
                $chaveContingencia = $this->getTagValue($this->protCTe, "nProt");
830
                $this->pdf->Code128($x + 40, $y1 + 10, $chaveContingencia, $bW * .4, $bH / 2);
831
            }
832
            //codigo de barras
833
        }
834
        $aFont = array(
835
            'font' => $this->fontePadrao,
836
            'size' => 8,
837
            'style' => '');
838
        $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...
839
        //outra caixa
840
        $y += $h + 1;
841
        $h = 8.5;
842
        $wa = $w;
843
        $this->pdf->textBox($x, $y + 7.5, $w + 0.5, $h);
844
        if (!empty($this->numdepec)) {
845
            $texto = 'NÚMERO DE REGISTRO DPEC';
846
        } elseif ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
847
            $texto = "DADOS DO CT-E";
848
        } else {
849
            $texto = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
850
        }
851
        $aFont = $this->formatPadrao;
852
        $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...
853
        if (!empty($this->numdepec)) {
854
            $texto = $this->numdepec;
855
        } elseif ($this->tpEmis == 5) {
856
            $chaveContingencia = $this->geraChaveAdicCont();
857
            $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...
858
                'font' => $this->fontePadrao,
859
                'size' => 8,
860
                'style' => 'B');
861
            $texto = $this->formatField($chaveContingencia, "#### #### #### #### #### #### #### #### ####");
862
            $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...
863
        } else {
864
            $texto = $this->getTagValue($this->protCTe, "nProt") . " - ";
865
            if (!empty($this->protCTe)
866
                && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue)
867
            ) {
868
                $texto .= date(
869
                    'd/m/Y   H:i:s',
870
                    $this->toTimestamp($this->getTagValue($this->protCTe, "dhRecbto"))
871
                );
872
            }
873
            $texto = $this->getTagValue($this->protCTe, "nProt") == '' ? '' : $texto;
874
        }
875
        $aFont = $this->formatNegrito;
876
        $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...
877
        if ($this->qrCodCTe !== null) {
878
            $this->qrCodeDacte($y - 27);
879
            $w = 45;
880
            $x += 92.5;
881
            $this->pdf->textBox($x, $y - 34, $w + 0.5, $h + 41.5);
882
        }
883
        //CFOP
884
        $x = $oldX;
885
        $h = 8.5;
886
        $w = round($maxW * 0.32);
887
        $y1 = $y + 7.5;
888
        $this->pdf->textBox($x, $y1, $w + 2, $h);
889
        $texto = 'CFOP - NATUREZA DA PRESTAÇÃO';
890
        $aFont = array(
891
            'font' => $this->fontePadrao,
892
            'size' => 8,
893
            'style' => '');
894
        $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...
895
        $texto = $this->getTagValue($this->ide, "CFOP") . ' - ' . $this->getTagValue($this->ide, "natOp");
896
        $aFont = $this->formatNegrito;
897
        $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...
898
        //ORIGEM DA PRESTAÇÃO
899
        $y += $h + 7.5;
900
        $x = $oldX;
901
        $h = 8;
902
        $w = ($maxW * 0.5);
903
        $this->pdf->textBox($x, $y, $w + 0.5, $h);
904
        $texto = 'INÍCIO DA PRESTAÇÃO';
905
        $aFont = array(
906
            'font' => $this->fontePadrao,
907
            'size' => 8,
908
            'style' => '');
909
        $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...
910
        $texto = $this->getTagValue($this->ide, "xMunIni") . ' - ' . $this->getTagValue($this->ide, "UFIni");
911
        $aFont = $this->formatNegrito;
912
        $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...
913
        //DESTINO DA PRESTAÇÃO
914
        $x = $oldX + $w + 1;
915
        $h = 8;
916
        $w = $w - 1.3;
917
        $this->pdf->textBox($x - 0.5, $y, $w + 0.5, $h);
918
        $texto = 'TÉRMINO DA PRESTAÇÃO';
919
        $aFont = array(
920
            'font' => $this->fontePadrao,
921
            'size' => 8,
922
            'style' => '');
923
        $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...
924
        $texto = $this->getTagValue($this->ide, "xMunFim") . ' - ' . $this->getTagValue($this->ide, "UFFim");
925
        $aFont = $this->formatNegrito;
926
        $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...
927
        //#########################################################################
928
        //Indicação de CTe Homologação, cancelamento e falta de protocolo
929
        $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue;
930
        //indicar cancelamento
931
        $cStat = $this->getTagValue($this->cteProc, "cStat");
932
        if ($cStat == '101' || $cStat == '135') {
933
            //101 Cancelamento
934
            $x = 10;
935
            $y = $this->hPrint - 130;
936
            $h = 25;
937
            $w = $maxW - (2 * $x);
938
            $this->pdf->setTextColor(90, 90, 90);
939
            $texto = "CTe CANCELADO";
940
            $aFont = array(
941
                'font' => $this->fontePadrao,
942
                'size' => 48,
943
                'style' => 'B');
944
            $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...
945
            $this->pdf->setTextColor(0, 0, 0);
946
        }
947
        $cStat = $this->getTagValue($this->cteProc, "cStat");
948
        if ($cStat == '110' ||
949
            $cStat == '301' ||
950
            $cStat == '302'
951
        ) {
952
            //110 Denegada
953
            $x = 10;
954
            $y = $this->hPrint - 130;
955
            $h = 25;
956
            $w = $maxW - (2 * $x);
957
            $this->pdf->setTextColor(90, 90, 90);
958
            $texto = "CTe USO DENEGADO";
959
            $aFont = array(
960
                'font' => $this->fontePadrao,
961
                'size' => 48,
962
                'style' => 'B');
963
            $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...
964
            $y += $h;
965
            $h = 5;
966
            $w = $maxW - (2 * $x);
967
            $texto = "SEM VALOR FISCAL";
968
            $aFont = array(
969
                'font' => $this->fontePadrao,
970
                'size' => 48,
971
                'style' => 'B');
972
            $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...
973
            $this->pdf->setTextColor(0, 0, 0);
974
        }
975
        //indicar sem valor
976
        if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção
977
            $x = 10;
978
            if ($this->orientacao == 'P') {
979
                $y = round($this->hPrint * 2 / 3, 0);
980
            } else {
981
                $y = round($this->hPrint / 2, 0);
982
            }
983
            $h = 5;
984
            $w = $maxW - (2 * $x);
985
            $this->pdf->setTextColor(90, 90, 90);
986
            $texto = "SEM VALOR FISCAL";
987
            $aFont = array(
988
                'font' => $this->fontePadrao,
989
                'size' => 48,
990
                'style' => 'B');
991
            $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...
992
            $aFont = array(
993
                'font' => $this->fontePadrao,
994
                'size' => 30,
995
                'style' => 'B');
996
            $texto = "AMBIENTE DE HOMOLOGAÇÃO";
997
            $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...
998
            $this->pdf->setTextColor(0, 0, 0);
999
        } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização
1000
            $h = 5;
1001
            $w = $maxW - (2 * 10);
1002
            $x = 55;
1003
            $y = 240;
1004
            $this->pdf->setTextColor(255, 100, 100);
1005
            $aFont = array(
1006
                'font' => $this->fontePadrao,
1007
                'size' => 40,
1008
                'style' => 'B');
1009
            $texto = "Pré-visualização";
1010
            $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...
1011
            $this->pdf->setTextColor(255, 100, 100);
1012
            $aFont = array(
1013
                'font' => $this->fontePadrao,
1014
                'size' => 41,
1015
                'style' => 'B');
1016
            $texto = "Sem Validade Jurídica";
1017
            $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...
1018
            $this->pdf->setTextColor(90, 90, 90);
1019
            $texto = "SEM VALOR FISCAL";
1020
            $aFont = array(
1021
                'font' => $this->fontePadrao,
1022
                'size' => 48,
1023
                'style' => 'B');
1024
            $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...
1025
            $this->pdf->setTextColor(0, 0, 0); // voltar a cor default
1026
        } else {
1027
            $x = 10;
1028
            if ($this->orientacao == 'P') {
1029
                $y = round($this->hPrint * 2 / 3, 0);
1030
            } else {
1031
                $y = round($this->hPrint / 2, 0);
1032
            } //fim orientacao
1033
            $h = 5;
1034
            $w = $maxW - (2 * $x);
1035
            $this->pdf->setTextColor(90, 90, 90);
1036
            //indicar FALTA DO PROTOCOLO se NFe não for em contingência
1037
            if (($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) && !empty($this->numdepec)) {
1038
                //Contingência
1039
                $texto = "DACTE Emitido em Contingência";
1040
                $aFont = array(
1041
                    'font' => $this->fontePadrao,
1042
                    'size' => 48,
1043
                    'style' => 'B');
1044
                $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...
1045
                $aFont = array(
1046
                    'font' => $this->fontePadrao,
1047
                    'size' => 30,
1048
                    'style' => 'B');
1049
                $texto = "devido à problemas técnicos";
1050
                $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...
1051
            } else {
1052
                if (!isset($this->protCTe)) {
1053
                    if (!empty($this->numdepec)) {
1054
                        $texto = "SEM VALOR FISCAL";
1055
                        $aFont = array(
1056
                            'font' => $this->fontePadrao,
1057
                            'size' => 48,
1058
                            'style' => 'B');
1059
                        $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...
1060
                    }
1061
                    $aFont = array(
1062
                        'font' => $this->fontePadrao,
1063
                        'size' => 30,
1064
                        'style' => 'B');
1065
                    $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ";
1066
                    if (!empty($this->numdepec)) {
1067
                        $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...
1068
                    } else {
1069
                        $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...
1070
                    }
1071
                } //fim cteProc
1072
                if ($this->tpEmis == 4) {
1073
                    //DPEC
1074
                    $x = 10;
1075
                    $y = $this->hPrint - 130;
1076
                    $h = 25;
1077
                    $w = $maxW - (2 * $x);
1078
                    $this->pdf->setTextColor(200, 200, 200); // 90,90,90 é muito escuro
1079
                    $texto = "DACTE impresso em contingência -\n"
1080
                        . "DPEC regularmente recebido pela Receita\n"
1081
                        . "Federal do Brasil";
1082
                    $aFont = array(
1083
                        'font' => $this->fontePadrao,
1084
                        'size' => 48,
1085
                        'style' => 'B');
1086
                    $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...
1087
                    $this->pdf->setTextColor(0, 0, 0);
1088
                }
1089
            } //fim tpEmis
1090
            $this->pdf->setTextColor(0, 0, 0);
1091
        }
1092
        return $oldY;
1093
    }
1094
1095
    /**
1096
     * rodapeDACTE
1097
     * Monta o rodape no final da DACTE ( retrato e paisagem )
1098
     *
1099
     * @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...
1100
     * @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...
1101
     */
1102
    protected function rodape($x, $y)
1103
    {
1104
        $texto = "Impresso em  " . date('d/m/Y H:i:s') . ' ' . $this->creditos;
1105
        $w = $this->wPrint - 4;
1106
        $aFont = array(
1107
            'font' => $this->fontePadrao,
1108
            'size' => 6,
1109
            'style' => '');
1110
        $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...
1111
        $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...
1112
        $texto = $this->powered ? "Powered by NFePHP®" : '';
1113
        $aFont = array(
1114
            'font' => $this->fontePadrao,
1115
            'size' => 6,
1116
            'style' => '');
1117
        $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'R', false, '');
1118
    }
1119
1120
    /**
1121
     * remetente
1122
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1123
     *
1124
     * @param number $x Posição horizontal canto esquerdo
1125
     * @param number $y Posição vertical canto superior
1126
     * @return number Posição vertical final
1127
     */
1128
    protected function remetente($x = 0, $y = 0)
1129
    {
1130
        $oldX = $x;
1131
        $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...
1132
        if ($this->orientacao == 'P') {
1133
            $maxW = $this->wPrint;
1134
        } else {
1135
            $maxW = $this->wPrint - $this->wCanhoto;
1136
        }
1137
        $w = $maxW * 0.5 + 0.5;
1138
        $h = 19;
1139
        $x1 = $x + 16;
1140
        $texto = 'REMETENTE';
1141
        $aFont = $this->formatPadrao;
1142
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1143
        $aFont = $this->formatNegrito;
1144
        $texto = $this->getTagValue($this->rem, "xNome");
1145
        $this->pdf->textBox($x1, $y, $w - 18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1146
        $y += 3;
1147
        $texto = 'ENDEREÇO';
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
        $aFont = $this->formatNegrito;
1151
        $texto = $this->getTagValue($this->enderReme, "xLgr") . ',';
1152
        $texto .= $this->getTagValue($this->enderReme, "nro");
1153
        $texto .= ($this->getTagValue($this->enderReme, "xCpl") != "") ?
1154
            ' - ' . $this->getTagValue($this->enderReme, "xCpl") : '';
1155
        $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...
1156
        $y += 3;
1157
        $texto = $this->getTagValue($this->enderReme, "xBairro");
1158
        $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...
1159
        $y += 3;
1160
        $texto = 'MUNICÍPIO';
1161
        $aFont = $this->formatPadrao;
1162
        $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...
1163
        $texto = $this->getTagValue($this->enderReme, "xMun") . ' - ';
1164
        $texto .= $this->getTagValue($this->enderReme, "UF");
1165
        $aFont = $this->formatNegrito;
1166
        $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...
1167
        $x = $w - 18;
1168
        $texto = 'CEP';
1169
        $aFont = $this->formatPadrao;
1170
        $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...
1171
        $texto = $this->formatField($this->getTagValue($this->enderReme, "CEP"), "#####-###");
1172
        $aFont = $this->formatNegrito;
1173
        $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...
1174
        $x = $oldX;
1175
        $y += 3;
1176
        $texto = 'CNPJ/CPF';
1177
        $aFont = $this->formatPadrao;
1178
        $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...
1179
        $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...
1180
        $aFont = $this->formatNegrito;
1181
        $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...
1182
        $x = $w - 45;
1183
        $texto = 'INSCRIÇÃO ESTADUAL';
1184
        $aFont = $this->formatPadrao;
1185
        $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...
1186
        $texto = $this->getTagValue($this->rem, "IE");
1187
        $aFont = $this->formatNegrito;
1188
        $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...
1189
        $x = $oldX;
1190
        $y += 3;
1191
        $texto = 'PAÍS';
1192
        $aFont = $this->formatPadrao;
1193
        $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...
1194
        $texto = $this->getTagValue($this->rem, "xPais") != "" ?
1195
            $this->getTagValue($this->rem, "xPais") : 'BRASIL';
1196
        $aFont = $this->formatNegrito;
1197
        $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...
1198
        $x = $w - 25;
1199
        $texto = 'FONE';
1200
        $aFont = $this->formatPadrao;
1201
        $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...
1202
        //$texto = $this->formatFone($this->rem);
1203
        $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...
1204
        $aFont = $this->formatNegrito;
1205
        $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...
1206
    }
1207
1208
    /**
1209
     * destinatario
1210
     * Monta o campo com os dados do destinatário na DACTE.
1211
     *
1212
     * @param number $x Posição horizontal canto esquerdo
1213
     * @param number $y Posição vertical canto superior
1214
     * @return number Posição vertical final
1215
     */
1216
    protected function destinatario($x = 0, $y = 0)
1217
    {
1218
        $oldX = $x;
1219
        $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...
1220
        if ($this->orientacao == 'P') {
1221
            $maxW = $this->wPrint;
1222
        } else {
1223
            $maxW = $this->wPrint - $this->wCanhoto;
1224
        }
1225
        $w = ($maxW * 0.5) - 0.7;
1226
        $h = 19;
1227
        $x1 = $x + 19;
1228
        $texto = 'DESTINATÁRIO';
1229
        $aFont = $this->formatPadrao;
1230
        $this->pdf->textBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', true, '');
1231
        $aFont = $this->formatNegrito;
1232
        $texto = $this->getTagValue($this->dest, "xNome");
1233
        $this->pdf->textBox($x1, $y, $w - 18, $h, $texto, $aFont, 'T', 'L', false, '', true);
1234
        $y += 3;
1235
        $texto = 'ENDEREÇO';
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
        $aFont = $this->formatNegrito;
1239
        $texto = $this->getTagValue($this->enderDest, "xLgr") . ',';
1240
        $texto .= $this->getTagValue($this->enderDest, "nro");
1241
        $texto .= $this->getTagValue($this->enderDest, "xCpl") != "" ?
1242
            ' - ' . $this->getTagValue($this->enderDest, "xCpl") : '';
1243
        $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...
1244
        $y += 3;
1245
        $texto = $this->getTagValue($this->enderDest, "xBairro");
1246
        $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...
1247
        $y += 3;
1248
        $texto = 'MUNICÍPIO';
1249
        $aFont = $this->formatPadrao;
1250
        $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...
1251
        $texto = $this->getTagValue($this->enderDest, "xMun") . ' - ';
1252
        $texto .= $this->getTagValue($this->enderDest, "UF");
1253
        $aFont = $this->formatNegrito;
1254
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

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

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1259
        $texto = $this->formatField($this->getTagValue($this->enderDest, "CEP"), "#####-###");
1260
        $aFont = $this->formatNegrito;
1261
        $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...
1262
        $x = $oldX;
1263
        $y += 3;
1264
        $texto = 'CNPJ/CPF';
1265
        $aFont = $this->formatPadrao;
1266
        $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...
1267
        $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...
1268
        $aFont = $this->formatNegrito;
1269
        $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...
1270
        $x = $w - 47.5 + $oldX;
1271
        $texto = 'INSCRIÇÃO ESTADUAL';
1272
        $aFont = $this->formatPadrao;
1273
        $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...
1274
        $texto = $this->getTagValue($this->dest, "IE");
1275
        $aFont = $this->formatNegrito;
1276
        $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...
1277
        $x = $oldX;
1278
        $y += 3;
1279
        $texto = 'PAÍS';
1280
        $aFont = $this->formatPadrao;
1281
        $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...
1282
        $texto = $this->getTagValue($this->dest, "xPais");
1283
        $aFont = $this->formatNegrito;
1284
        $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...
1285
        $x = $w - 27 + $oldX;
1286
        $texto = 'FONE';
1287
        $aFont = $this->formatPadrao;
1288
        $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...
1289
        //$texto = $this->formatFone($this->dest);
1290
        $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...
1291
        $aFont = $this->formatNegrito;
1292
        $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...
1293
    }
1294
1295
    /**
1296
     * expedidor
1297
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1298
     *
1299
     * @param number $x Posição horizontal canto esquerdo
1300
     * @param number $y Posição vertical canto superior
1301
     * @return number Posição vertical final
1302
     */
1303
    protected function expedidor($x = 0, $y = 0)
1304
    {
1305
        $oldX = $x;
1306
        $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...
1307
        if ($this->orientacao == 'P') {
1308
            $maxW = $this->wPrint;
1309
        } else {
1310
            $maxW = $this->wPrint - $this->wCanhoto;
1311
        }
1312
        $w = $maxW * 0.5 + 0.5;
1313
        $h = 19;
1314
        $x1 = $x + 16;
1315
        $texto = 'EXPEDIDOR';
1316
        $aFont = $this->formatPadrao;
1317
        $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...
1318
        $aFont = $this->formatNegrito;
1319
        $texto = $this->getTagValue($this->exped, "xNome");
1320
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1321
        $y += 3;
1322
        $texto = 'ENDEREÇO';
1323
        $aFont = $this->formatPadrao;
1324
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1325
        $aFont = $this->formatNegrito;
1326
        if (isset($this->enderExped)) {
1327
            $texto = $this->getTagValue($this->enderExped, "xLgr") . ', ';
1328
            $texto .= $this->getTagValue($this->enderExped, "nro");
1329
            $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ?
1330
                ' - ' . $this->getTagValue($this->enderExped, "xCpl") :
1331
                '';
1332
        } else {
1333
            $texto = '';
1334
        }
1335
        $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...
1336
        $y += 3;
1337
        $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...
1338
        $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...
1339
        $y += 3;
1340
        $texto = 'MUNICÍPIO';
1341
        $aFont = $this->formatPadrao;
1342
        $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...
1343
        if (isset($this->enderExped)) {
1344
            $texto = $this->getTagValue($this->enderExped, "xMun") . ' - ';
1345
            $texto .= $this->getTagValue($this->enderExped, "UF");
1346
        } else {
1347
            $texto = '';
1348
        }
1349
        $aFont = $this->formatNegrito;
1350
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

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

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1355
        $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...
1356
        $aFont = $this->formatNegrito;
1357
        $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...
1358
        $x = $oldX;
1359
        $y += 3;
1360
        $texto = 'CNPJ/CPF';
1361
        $aFont = $this->formatPadrao;
1362
        $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...
1363
        $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...
1364
        $aFont = $this->formatNegrito;
1365
        $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...
1366
        $x = $w - 45;
1367
        $texto = 'INSCRIÇÃO ESTADUAL';
1368
        $aFont = $this->formatPadrao;
1369
        $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...
1370
        $texto = $this->getTagValue($this->exped, "IE");
1371
        $aFont = $this->formatNegrito;
1372
        $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...
1373
        $x = $oldX;
1374
        $y += 3;
1375
        $texto = 'PAÍS';
1376
        $aFont = $this->formatPadrao;
1377
        $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...
1378
        $texto = $this->getTagValue($this->exped, "xPais");
1379
        $aFont = $this->formatNegrito;
1380
        $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...
1381
        $x = $w - 25;
1382
        $texto = 'FONE';
1383
        $aFont = $this->formatPadrao;
1384
        $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...
1385
        if (isset($this->exped)) {
1386
            $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...
1387
            $aFont = $this->formatNegrito;
1388
            $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...
1389
        }
1390
    }
1391
1392
    /**
1393
     * recebedor
1394
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1395
     *
1396
     * @param number $x Posição horizontal canto esquerdo
1397
     * @param number $y Posição vertical canto superior
1398
     * @return number Posição vertical final
1399
     */
1400
    protected function recebedor($x = 0, $y = 0)
1401
    {
1402
        $oldX = $x;
1403
        $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...
1404
        if ($this->orientacao == 'P') {
1405
            $maxW = $this->wPrint;
1406
        } else {
1407
            $maxW = $this->wPrint - $this->wCanhoto;
1408
        }
1409
        $w = ($maxW * 0.5) - 0.7;
1410
        $h = 19;
1411
        $x1 = $x + 19;
1412
        $texto = 'RECEBEDOR';
1413
        $aFont = $this->formatPadrao;
1414
        $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...
1415
        $aFont = $this->formatNegrito;
1416
        $texto = $this->getTagValue($this->receb, "xNome");
1417
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1418
        $y += 3;
1419
        $texto = 'ENDEREÇO';
1420
        $aFont = $this->formatPadrao;
1421
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1422
        $aFont = $this->formatNegrito;
1423
        if (isset($this->enderReceb)) {
1424
            $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', ';
1425
            $texto .= $this->getTagValue($this->enderReceb, "nro");
1426
            $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ?
1427
                ' - ' . $this->getTagValue($this->enderReceb, "xCpl") :
1428
                '';
1429
        } else {
1430
            $texto = '';
1431
        }
1432
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1433
        $y += 3;
1434
        $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...
1435
        $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...
1436
        $y += 3;
1437
        $texto = 'MUNICÍPIO';
1438
        $aFont = $this->formatPadrao;
1439
        $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...
1440
        if (isset($this->enderReceb)) {
1441
            $texto = $this->getTagValue($this->enderReceb, "xMun") . ' - ';
1442
            $texto .= $this->getTagValue($this->enderReceb, "UF");
1443
        } else {
1444
            $texto = '';
1445
        }
1446
        $aFont = $this->formatNegrito;
1447
        $this->pdf->textBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

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

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1452
        $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...
1453
        $aFont = $this->formatNegrito;
1454
        $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...
1455
        $x = $oldX;
1456
        $y += 3;
1457
        $texto = 'CNPJ/CPF';
1458
        $aFont = $this->formatPadrao;
1459
        $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...
1460
        $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...
1461
        $aFont = $this->formatNegrito;
1462
        $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...
1463
        $x = $w - 47 + $oldX;
1464
        $texto = 'INSCRIÇÃO ESTADUAL';
1465
        $aFont = $this->formatPadrao;
1466
        $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...
1467
        $texto = $this->getTagValue($this->receb, "IE");
1468
        $aFont = $this->formatNegrito;
1469
        $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...
1470
        $x = $oldX;
1471
        $y += 3;
1472
        $texto = 'PAÍS';
1473
        $aFont = $this->formatPadrao;
1474
        $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...
1475
        $texto = $this->getTagValue($this->receb, "xPais");
1476
        $aFont = $this->formatNegrito;
1477
        $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...
1478
        $x = $w - 27 + $oldX;
1479
        $texto = 'FONE';
1480
        $aFont = $this->formatPadrao;
1481
        $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...
1482
        if (isset($this->receb)) {
1483
            $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...
1484
            $aFont = $this->formatNegrito;
1485
            $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...
1486
        }
1487
    }
1488
1489
    /**
1490
     * tomador
1491
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1492
     *
1493
     * @param number $x Posição horizontal canto esquerdo
1494
     * @param number $y Posição vertical canto superior
1495
     * @return number Posição vertical final
1496
     */
1497
    protected function tomador($x = 0, $y = 0)
1498
    {
1499
        $oldX = $x;
1500
        $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...
1501
        if ($this->orientacao == 'P') {
1502
            $maxW = $this->wPrint;
1503
        } else {
1504
            $maxW = $this->wPrint - $this->wCanhoto;
1505
        }
1506
        $w = $maxW;
1507
        $h = 10;
1508
        $texto = 'TOMADOR DO SERVIÇO';
1509
        $aFont = $this->formatPadrao;
1510
        $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...
1511
        $aFont = $this->formatNegrito;
1512
        $texto = $this->getTagValue($this->toma, "xNome");
1513
        $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...
1514
        $x = $maxW * 0.60;
1515
        $texto = 'MUNICÍPIO';
1516
        $aFont = $this->formatPadrao;
1517
        $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...
1518
        $texto = $this->getTagValue($this->toma, "xMun");
1519
        $aFont = $this->formatNegrito;
1520
        $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...
1521
        $x = $maxW * 0.85;
1522
        $texto = 'UF';
1523
        $aFont = $this->formatPadrao;
1524
        $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...
1525
        $texto = $this->getTagValue($this->toma, "UF");
1526
        $aFont = $this->formatNegrito;
1527
        $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...
1528
        $x = $w - 18;
1529
        $texto = 'CEP';
1530
        $aFont = $this->formatPadrao;
1531
        $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...
1532
        $texto = $this->formatField($this->getTagValue($this->toma, "CEP"), "#####-###");
1533
        $aFont = $this->formatNegrito;
1534
        $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...
1535
        $y += 3;
1536
        $x = $oldX;
1537
        $texto = 'ENDEREÇO';
1538
        $aFont = $this->formatPadrao;
1539
        $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...
1540
        $aFont = $this->formatNegrito;
1541
        $texto = $this->getTagValue($this->toma, "xLgr") . ',';
1542
        $texto .= $this->getTagValue($this->toma, "nro");
1543
        $texto .= ($this->getTagValue($this->toma, "xCpl") != "") ?
1544
            ' - ' . $this->getTagValue($this->toma, "xCpl") : '';
1545
        $texto .= ' - ' . $this->getTagValue($this->toma, "xBairro");
1546
        $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...
1547
        $y += 3;
1548
        $texto = 'CNPJ/CPF';
1549
        $aFont = $this->formatPadrao;
1550
        $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...
1551
        $texto = $this->formatCNPJCPF($this->toma);
1552
        $aFont = $this->formatNegrito;
1553
        $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...
1554
        $x = $x + 65;
1555
        $texto = 'INSCRIÇÃO ESTADUAL';
1556
        $aFont = $this->formatPadrao;
1557
        $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...
1558
        $texto = $this->getTagValue($this->toma, "IE");
1559
        $aFont = $this->formatNegrito;
1560
        $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...
1561
        $x = $w * 0.75;
1562
        $texto = 'PAÍS';
1563
        $aFont = $this->formatPadrao;
1564
        $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...
1565
        $texto = $this->getTagValue($this->toma, "xPais") != "" ?
1566
            $this->getTagValue($this->toma, "xPais") : 'BRASIL';
1567
        $aFont = $this->formatNegrito;
1568
        $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...
1569
        $x = $w - 27;
1570
        $texto = 'FONE';
1571
        $aFont = $this->formatPadrao;
1572
        $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...
1573
        $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->formatFone($this->toma) : '';
1574
        $aFont = $this->formatNegrito;
1575
        $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...
1576
    }
1577
1578
    /**
1579
     * descricaoCarga
1580
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1581
     *
1582
     * @param number $x Posição horizontal canto esquerdo
1583
     * @param number $y Posição vertical canto superior
1584
     * @return number Posição vertical final
1585
     */
1586
    protected function descricaoCarga($x = 0, $y = 0)
1587
    {
1588
        $oldX = $x;
1589
        $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...
1590
        if ($this->orientacao == 'P') {
1591
            $maxW = $this->wPrint;
1592
        } else {
1593
            $maxW = $this->wPrint - $this->wCanhoto;
1594
        }
1595
        $w = $maxW;
1596
        $h = 17;
1597
        $texto = 'PRODUTO PREDOMINANTE';
1598
        $aFont = array(
1599
            'font' => $this->fontePadrao,
1600
            'size' => 6,
1601
            'style' => '');
1602
        $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...
1603
        $texto = $this->getTagValue($this->infCarga, "proPred");
1604
        $aFont = $this->formatNegrito;
1605
        $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...
1606
        $x = $w * 0.56;
1607
        $this->pdf->line($x, $y, $x, $y + 8);
1608
        $aFont = $this->formatPadrao;
1609
        $texto = 'OUTRAS CARACTERÍSTICAS DA CARGA';
1610
        $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...
1611
        $texto = $this->getTagValue($this->infCarga, "xOutCat");
1612
        $aFont = $this->formatNegrito;
1613
        $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...
1614
        $x = $w * 0.8;
1615
        $this->pdf->line($x, $y, $x, $y + 8);
1616
        $aFont = $this->formatPadrao;
1617
        $texto = 'VALOR TOTAL DA CARGA';
1618
        $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...
1619
        $texto = $this->getTagValue($this->infCarga, "vCarga") == "" ?
1620
            $this->getTagValue($this->infCarga, "vMerc") : $this->getTagValue($this->infCarga, "vCarga");
1621
        $texto = number_format($texto, 2, ",", ".");
1622
        $aFont = $this->formatNegrito;
1623
        $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...
1624
        $y += 8;
1625
        $x = $oldX;
1626
        $this->pdf->line($x, $y, $w + 1, $y);
1627
        //Identifica código da unidade
1628
        //01 = KG (QUILOS)
1629
        $qCarga = 0;
1630
        foreach ($this->infQ as $infQ) {
1631
            if (in_array($this->getTagValue($infQ, "cUnid"), array('01', '02'))) {
1632
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1633
            }
1634
        }
1635
        $texto = 'PESO BRUTO (KG)';
1636
        $aFont = array(
1637
            'font' => $this->fontePadrao,
1638
            'size' => 5,
1639
            'style' => '');
1640
        $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...
1641
        $texto = number_format($qCarga, 3, ",", ".");
1642
        $aFont = array(
1643
            'font' => $this->fontePadrao,
1644
            'size' => 7,
1645
            'style' => 'B');
1646
        $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...
1647
        $x = $w * 0.12;
1648
        $this->pdf->line($x + 13.5, $y, $x + 13.5, $y + 9);
1649
        $texto = 'PESO BASE CÁLCULO (KG)';
1650
        $aFont = array(
1651
            'font' => $this->fontePadrao,
1652
            'size' => 5,
1653
            'style' => '');
1654
        $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...
1655
        $texto = number_format($qCarga, 3, ",", ".");
1656
        $aFont = array(
1657
            'font' => $this->fontePadrao,
1658
            'size' => 7,
1659
            'style' => 'B');
1660
        $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...
1661
        $x = $w * 0.24;
1662
        $this->pdf->line($x + 25, $y, $x + 25, $y + 9);
1663
        $texto = 'PESO AFERIDO (KG)';
1664
        $aFont = array(
1665
            'font' => $this->fontePadrao,
1666
            'size' => 5,
1667
            'style' => '');
1668
        $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...
1669
        $texto = number_format($qCarga, 3, ",", ".");
1670
        $aFont = array(
1671
            'font' => $this->fontePadrao,
1672
            'size' => 7,
1673
            'style' => 'B');
1674
        $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...
1675
        $x = $w * 0.36;
1676
        $this->pdf->line($x + 41.3, $y, $x + 41.3, $y + 9);
1677
        $texto = 'CUBAGEM(M3)';
1678
        $aFont = $this->formatPadrao;
1679
        $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...
1680
        $qCarga = 0;
1681
        foreach ($this->infQ as $infQ) {
1682
            if ($this->getTagValue($infQ, "cUnid") == '00') {
1683
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1684
            }
1685
        }
1686
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1687
        $aFont = array(
1688
            'font' => $this->fontePadrao,
1689
            'size' => 7,
1690
            'style' => 'B');
1691
        $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...
1692
        $x = $w * 0.45;
1693
        //$this->pdf->line($x+37, $y, $x+37, $y + 9);
1694
        $texto = 'QTDE(VOL)';
1695
        $aFont = $this->formatPadrao;
1696
        $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...
1697
        $qCarga = 0;
1698
        foreach ($this->infQ as $infQ) {
1699
            if ($this->getTagValue($infQ, "cUnid") == '03') {
1700
                $qCarga += (float)$this->getTagValue($infQ, "qCarga");
1701
            }
1702
        }
1703
        $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : '';
1704
        $aFont = array(
1705
            'font' => $this->fontePadrao,
1706
            'size' => 7,
1707
            'style' => 'B');
1708
        $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...
1709
        $x = $w * 0.53;
1710
        $this->pdf->line($x + 56, $y, $x + 56, $y + 9);
1711
        /*$texto = 'NOME DA SEGURADORA';
1712
        $aFont = $this->formatPadrao;
1713
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1714
        $texto = $this->getTagValue($this->seg, "xSeg");
1715
        $aFont = array(
1716
            'font' => $this->fontePadrao,
1717
            'size' => 7,
1718
            'style' => 'B');
1719
        $this->pdf->textBox($x + 31, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1720
        $y += 3;
1721
        $this->pdf->line($x, $y, $w + 1, $y);
1722
        $texto = 'RESPONSÁVEL';
1723
        $aFont = $this->formatPadrao;
1724
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1725
        $texto = $this->respSeg;
1726
        $aFont = array(
1727
            'font' => $this->fontePadrao,
1728
            'size' => 7,
1729
            'style' => 'B');
1730
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1731
        $x = $w * 0.68;
1732
        $this->pdf->line($x, $y, $x, $y + 6);
1733
        $texto = 'NÚMERO DA APOLICE';
1734
        $aFont = $this->formatPadrao;
1735
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1736
        $texto = $this->getTagValue($this->seg, "nApol");
1737
        $aFont = array(
1738
            'font' => $this->fontePadrao,
1739
            'size' => 7,
1740
            'style' => 'B');
1741
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1742
        $x = $w * 0.85;
1743
        $this->pdf->line($x, $y, $x, $y + 6);
1744
        $texto = 'NÚMERO DA AVERBAÇÃO';
1745
        $aFont = $this->formatPadrao;
1746
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1747
        $texto = $this->getTagValue($this->seg, "nAver");
1748
        $aFont = array(
1749
            'font' => $this->fontePadrao,
1750
            'size' => 7,
1751
            'style' => 'B');
1752
        $this->pdf->textBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1753
    }
1754
1755
    /**
1756
     * compValorServ
1757
     * Monta o campo com os componentes da prestação de serviços.
1758
     *
1759
     * @param number $x Posição horizontal canto esquerdo
1760
     * @param number $y Posição vertical canto superior
1761
     * @return number Posição vertical final
1762
     */
1763
    protected function compValorServ($x = 0, $y = 0)
1764
    {
1765
        $oldX = $x;
1766
        $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...
1767
        if ($this->orientacao == 'P') {
1768
            $maxW = $this->wPrint;
1769
        } else {
1770
            $maxW = $this->wPrint - $this->wCanhoto;
1771
        }
1772
        $w = $maxW;
1773
        $h = 25;
1774
        $texto = 'COMPONENTES DO VALOR DA PRESTAÇÃO DO SERVIÇO';
1775
        $aFont = $this->formatPadrao;
1776
        $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...
1777
        $y += 3.4;
1778
        $this->pdf->line($x, $y, $w + 1, $y);
1779
        $texto = 'NOME';
1780
        $aFont = $this->formatPadrao;
1781
        $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...
1782
        $yIniDados = $y;
1783
        $x = $w * 0.14;
1784
        $texto = 'VALOR';
1785
        $aFont = $this->formatPadrao;
1786
        $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...
1787
        $x = $w * 0.28;
1788
        $this->pdf->line($x, $y, $x, $y + 21.5);
1789
        $texto = 'NOME';
1790
        $aFont = $this->formatPadrao;
1791
        $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...
1792
        $x = $w * 0.42;
1793
        $texto = 'VALOR';
1794
        $aFont = $this->formatPadrao;
1795
        $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...
1796
        $x = $w * 0.56;
1797
        $this->pdf->line($x, $y, $x, $y + 21.5);
1798
        $texto = 'NOME';
1799
        $aFont = $this->formatPadrao;
1800
        $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...
1801
        $x = $w * 0.70;
1802
        $texto = 'VALOR';
1803
        $aFont = $this->formatPadrao;
1804
        $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...
1805
        $x = $w * 0.86;
1806
        $this->pdf->line($x, $y, $x, $y + 21.5);
1807
        $y += 1;
1808
        $texto = 'VALOR TOTAL DO SERVIÇO';
1809
        $aFont = $this->formatPadrao;
1810
        $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...
1811
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
1812
        $aFont = array(
1813
            'font' => $this->fontePadrao,
1814
            'size' => 9,
1815
            'style' => 'B');
1816
        $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...
1817
        $y += 10;
1818
        $this->pdf->line($x, $y, $w + 1, $y);
1819
        $y += 1;
1820
        $texto = 'VALOR A RECEBER';
1821
        $aFont = $this->formatPadrao;
1822
        $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...
1823
        $texto = number_format($this->getTagValue($this->vPrest, "vRec"), 2, ",", ".");
1824
        $aFont = array(
1825
            'font' => $this->fontePadrao,
1826
            'size' => 9,
1827
            'style' => 'B');
1828
        $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...
1829
        $auxX = $oldX;
1830
        $yIniDados += 4;
1831
        foreach ($this->Comp as $k => $d) {
1832
            $nome = $this->Comp->item($k)->getElementsByTagName('xNome')->item(0)->nodeValue;
1833
            $valor = number_format(
1834
                $this->Comp->item($k)->getElementsByTagName('vComp')->item(0)->nodeValue,
1835
                2,
1836
                ",",
1837
                "."
1838
            );
1839
            if ($auxX > $w * 0.60) {
1840
                $yIniDados = $yIniDados + 4;
1841
                $auxX = $oldX;
1842
            }
1843
            $texto = $nome;
1844
            $aFont = $this->formatPadrao;
1845
            $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...
1846
            $auxX += $w * 0.14;
1847
            $texto = $valor;
1848
            $aFont = $this->formatPadrao;
1849
            $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...
1850
            $auxX += $w * 0.14;
1851
        }
1852
    }
1853
1854
    /**
1855
     * impostos
1856
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1857
     *
1858
     * @param number $x Posição horizontal canto esquerdo
1859
     * @param number $y Posição vertical canto superior
1860
     * @return number Posição vertical final
1861
     */
1862
    protected function impostos($x = 0, $y = 0)
1863
    {
1864
        $oldX = $x;
1865
        $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...
1866
        if ($this->orientacao == 'P') {
1867
            $maxW = $this->wPrint;
1868
        } else {
1869
            $maxW = $this->wPrint - $this->wCanhoto;
1870
        }
1871
        $w = $maxW;
1872
        $h = 13;
1873
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
1874
        $aFont = $this->formatPadrao;
1875
        $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...
1876
        $y += 3.4;
1877
        $this->pdf->line($x, $y, $w + 1, $y);
1878
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
1879
        $aFont = $this->formatPadrao;
1880
        $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...
1881
        $x += $w * 0.26;
1882
        $this->pdf->line($x, $y, $x, $y + 9.5);
1883
        $texto = 'BASE DE CALCULO';
1884
        $aFont = $this->formatPadrao;
1885
        $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...
1886
        $wCol02 = 0.15;
1887
        $x += $w * $wCol02;
1888
        $this->pdf->line($x, $y, $x, $y + 9.5);
1889
        $texto = 'ALÍQ ICMS';
1890
        $aFont = $this->formatPadrao;
1891
        $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...
1892
        $x += $w * $wCol02;
1893
        $this->pdf->line($x, $y, $x, $y + 9.5);
1894
        $texto = 'VALOR ICMS';
1895
        $aFont = $this->formatPadrao;
1896
        $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...
1897
        $x += $w * $wCol02;
1898
        $this->pdf->line($x, $y, $x, $y + 9.5);
1899
        $texto = '% RED. BC ICMS';
1900
        $aFont = $this->formatPadrao;
1901
        $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...
1902
        $x += $w * $wCol02;
1903
        $this->pdf->line($x, $y, $x, $y + 9.5);
1904
        $texto = 'VALOR ICMS ST';
1905
        $aFont = $this->formatPadrao;
1906
        $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...
1907
        /*$x += $w * 0.14;
1908
        $this->pdf->line($x, $y, $x, $y + 9.5);
1909
        $texto = 'ICMS ST';
1910
        $aFont = $this->formatPadrao;
1911
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
1912
         * */
1913
        $x = $oldX;
1914
        $y = $y + 4;
1915
        $texto = $this->getTagValue($this->ICMS, "CST");
1916
        switch ($texto) {
1917
            case '00':
1918
                $texto = "00 - Tributação normal ICMS";
1919
                break;
1920
            case '20':
1921
                $texto = "20 - Tributação com BC reduzida do ICMS";
1922
                break;
1923
            case '40':
1924
                $texto = "40 - ICMS isenção";
1925
                break;
1926
            case '41':
1927
                $texto = "41 - ICMS não tributada";
1928
                break;
1929
            case '51':
1930
                $texto = "51 - ICMS diferido";
1931
                break;
1932
            case '60':
1933
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
1934
                break;
1935
            case '90':
1936
                if ($this->ICMSOutraUF) {
1937
                    $texto = "90 - ICMS Outra UF";
1938
                } else {
1939
                    $texto = "90 - ICMS Outros";
1940
                }
1941
                break;
1942
        }
1943
        if ($this->getTagValue($this->ICMS, "CST") == '60') {
1944
            $aFont = $this->formatNegrito;
1945
            $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...
1946
            $x += $w * 0.26;
1947
            $texto = !empty($this->ICMS->getElementsByTagName("vBCSTRet")->item(0)->nodeValue) ?
1948
                number_format($this->getTagValue($this->ICMS, "vBCSTRet"), 2, ",", ".") : (
1949
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1950
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1951
                );
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
            $x += $w * $wCol02;
1955
            $texto = !empty($this->ICMS->getElementsByTagName("pICMSSTRet")->item(0)->nodeValue) ?
1956
                number_format($this->getTagValue($this->ICMS, "pICMSSTRet"), 2, ",", ".") : (
1957
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1958
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
1959
                );
1960
            $aFont = $this->formatNegrito;
1961
            $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...
1962
            $x += $w * $wCol02;
1963
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1964
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
1965
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
1966
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
1967
                );
1968
            $aFont = $this->formatNegrito;
1969
            $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...
1970
            $x += $w * $wCol02;
1971
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1972
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
1973
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
1974
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
1975
                );
1976
            $aFont = $this->formatNegrito;
1977
            $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...
1978
            $x += $w * $wCol02;
1979
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
1980
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
1981
            $aFont = $this->formatNegrito;
1982
            $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...
1983
        } else {
1984
            $texto = $this->getTagValue($this->ICMSSN, "indSN") == 1 ? 'Simples Nacional' : $texto;
1985
            $aFont = $this->formatNegrito;
1986
            $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...
1987
            $x += $w * 0.26;
1988
            $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
1989
                number_format($this->getTagValue($this->ICMS, "vBC"), 2, ",", ".") : (
1990
                !empty($this->ICMS->getElementsByTagName("vBCOutraUF")->item(0)->nodeValue) ?
1991
                    number_format($this->getTagValue($this->ICMS, "vBCOutraUF"), 2, ",", ".") : ''
1992
                );
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
            $x += $w * $wCol02;
1996
            $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
1997
                number_format($this->getTagValue($this->ICMS, "pICMS"), 2, ",", ".") : (
1998
                !empty($this->ICMS->getElementsByTagName("pICMSOutraUF")->item(0)->nodeValue) ?
1999
                    number_format($this->getTagValue($this->ICMS, "pICMSOutraUF"), 2, ",", ".") : ''
2000
                );
2001
            $aFont = $this->formatNegrito;
2002
            $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...
2003
            $x += $w * $wCol02;
2004
            $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
2005
                number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : (
2006
                !empty($this->ICMS->getElementsByTagName("vICMSOutraUF")->item(0)->nodeValue) ?
2007
                    number_format($this->getTagValue($this->ICMS, "vICMSOutraUF"), 2, ",", ".") : ''
2008
                );
2009
            $aFont = $this->formatNegrito;
2010
            $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...
2011
            $x += $w * $wCol02;
2012
            $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
2013
                number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") : (
2014
                !empty($this->ICMS->getElementsByTagName("pRedBCOutraUF")->item(0)->nodeValue) ?
2015
                    number_format($this->getTagValue($this->ICMS, "pRedBCOutraUF"), 2, ",", ".") : ''
2016
                );
2017
            $aFont = $this->formatNegrito;
2018
            $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...
2019
            $x += $w * $wCol02;
2020
            $texto = !empty($this->ICMS->getElementsByTagName("vICMSSTRet")->item(0)->nodeValue) ?
2021
                number_format($this->getTagValue($this->ICMS, "vICMSSTRet"), 2, ",", ".") : '';
2022
            $aFont = $this->formatNegrito;
2023
            $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...
2024
        }
2025
        /*$x += $w * 0.14;
2026
        $texto = '';
2027
        $aFont = $this->formatNegrito;
2028
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
2029
    }
2030
2031
    /**
2032
     * geraChaveAdicCont
2033
     *
2034
     * @return string chave
2035
     */
2036
    protected function geraChaveAdicCont()
2037
    {
2038
        //cUF tpEmis CNPJ vNF ICMSp ICMSs DD  DV
2039
        // Quantidade de caracteres  02   01      14  14    01    01  02 01
2040
        $forma = "%02d%d%s%014d%01d%01d%02d";
2041
        $cUF = $this->ide->getElementsByTagName('cUF')->item(0)->nodeValue;
2042
        $CNPJ = "00000000000000" . $this->emit->getElementsByTagName('CNPJ')->item(0)->nodeValue;
2043
        $CNPJ = substr($CNPJ, -14);
2044
        $vCT = number_format($this->getTagValue($this->vPrest, "vRec"), 2, "", "") * 100;
2045
        $ICMS_CST = $this->getTagValue($this->ICMS, "CST");
2046
        switch ($ICMS_CST) {
2047
            case '00':
2048
            case '20':
2049
                $ICMSp = '1';
2050
                $ICMSs = '2';
2051
                break;
2052
            case '40':
2053
            case '41':
2054
            case '51':
2055
            case '90':
2056
                $ICMSp = '2';
2057
                $ICMSs = '2';
2058
                break;
2059
            case '60':
2060
                $ICMSp = '2';
2061
                $ICMSs = '1';
2062
                break;
2063
        }
2064
        $dd = $this->ide->getElementsByTagName('dhEmi')->item(0)->nodeValue;
2065
        $rpos = strrpos($dd, '-');
2066
        $dd = substr($dd, $rpos + 1);
2067
        $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...
2068
        $chave = $chave . $this->modulo11($chave);
2069
        return $chave;
2070
    }
2071
2072
    protected function detCont($x = 0, $y = 0)
2073
    {
2074
        $oldX = $x;
2075
        $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...
2076
        if ($this->orientacao == 'P') {
2077
            $maxW = $this->wPrint;
2078
        } else {
2079
            $maxW = $this->wPrint - $this->wCanhoto;
2080
        }
2081
        $w = $maxW;
2082
        $texto = 'INFORMAÇÕES ESPECÍFICAS DO MODAL AQUAVIÁRIO';
2083
        $h = 3.4;
2084
        $aFont = $this->formatPadrao;
2085
        $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...
2086
        $y += 3.4;
2087
        $h = 29.6;
2088
        $texto = 'DOCUMENTOS ORIGINÁRIOS';
2089
        $aFont = $this->formatPadrao;
2090
        $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...
2091
        $descr1 = 'TIPO DOC';
2092
        $descr2 = 'CNPJ/CPF EMITENTE';
2093
        $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2094
        $descr4 = 'NRO. LACRE';
2095
        $descr5 = 'NRO. CONTEINER';
2096
        $y += 3.4;
2097
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
2098
        $texto = $descr1;
2099
        $aFont = $this->formatPadrao;
2100
        $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...
2101
        $yIniDados = $y;
2102
        $x += $w * 0.07;
2103
        $this->pdf->line($x, $y, $x, $y + 26.1);
2104
        $texto = $descr2;
2105
        $aFont = $this->formatPadrao;
2106
        $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...
2107
        $x += $w * 0.28;
2108
        $this->pdf->line($x, $y, $x, $y + 26.1);
2109
        $texto = $descr3;
2110
        $aFont = $this->formatPadrao;
2111
        $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...
2112
        $x += $w * 0.14;
2113
        $this->pdf->line($x, $y, $x, $y + 26.1);
2114
        $texto = $descr4;
2115
        $aFont = $this->formatPadrao;
2116
        $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...
2117
        $x += $w * 0.20;
2118
        $this->pdf->line($x, $y, $x, $y + 26.1);
2119
        $texto = $descr5;
2120
        $aFont = $this->formatPadrao;
2121
        $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...
2122
        $texto = '';
2123
        $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...
2124
        $yIniDados += 3;
2125
        $totalNF = 0;
2126
        $yCont = $y;
2127
        $qtdCont = 0;
2128
        foreach ($this->detCont as $k => $d) {
2129
            $nLacre = '';
2130
            $aFont = array(
2131
                'font' => $this->fontePadrao,
2132
                'size' => 10,
2133
                'style' => '');
2134
            $qtdCont += 1;
2135
            $infNF = $this->detCont->item($k)->getElementsByTagName('infNF');
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->detCont (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...
2136
            $yCont += 3;
2137
            if ($qtdCont < 8) {
2138
                $nCont = $this->detCont->item($k)->getElementsByTagName('nCont')->item(0)->nodeValue;
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->detCont (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...
2139
                $this->pdf->textBox($x, $yCont, $w * 0.23, $h, $nCont, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2140
            } else {
2141
                $lacres = $this->detCont->item($k)->getElementsByTagName('lacre');
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->detCont (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...
2142
                foreach ($lacres as $lacre) {
2143
                    $nLacre .= $this->getTagValue($lacre, 'nLacre') . '/';
2144
                }
2145
                $texto = substr($nLacre, 0, -1);
2146
                $this->arrayCont[] = ["nCont" => $this->detCont->item($k)->getElementsByTagName('nCont')->item(0)->nodeValue, "nLacre" => $texto];
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->detCont (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...
2147
            }
2148
            if ($qtdCont < 8) {
2149
                $this->pdf->textBox($x - $w * 0.2, $yCont, $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...
2150
            }
2151
            foreach ($infNF as $i => $z) {
2152
                $totalNF += 1;
2153
                if ($totalNF > 7) {
2154
                    $this->arrayNF[] = ["serie" => $this->getTagValue($infNF->item($i), 'serie'), "nDoc" => $this->getTagValue($infNF->item($i), 'nDoc')];
0 ignored issues
show
Bug introduced by
The property arrayNF does not seem to exist. Did you mean arrayNFe?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
2155
                } else {
2156
                    $tp = 'NF';
2157
                    $cnpj = '-';
2158
                    $doc = $this->getTagValue($infNF->item($i), 'serie');
2159
                    $doc .= '/' . $this->getTagValue($infNF->item($i), 'nDoc');
2160
                    $auxX = $oldX;
2161
                    $texto = $tp;
2162
                    $aFont = array(
2163
                        'font' => $this->fontePadrao,
2164
                        'size' => 8,
2165
                        'style' => '');
2166
                    $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...
2167
                    //$auxX += $w * 0.09;
2168
                    $auxX += $w * 0.07;
2169
                    $texto = $cnpj;
2170
                    $aFont = array(
2171
                        'font' => $this->fontePadrao,
2172
                        'size' => 8,
2173
                        'style' => '');
2174
                    $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...
2175
                    $auxX += $w * 0.28;
2176
                    $texto = $doc;
2177
                    $aFont = array(
2178
                        'font' => $this->fontePadrao,
2179
                        'size' => 8,
2180
                        'style' => '');
2181
                    $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...
2182
                    $yIniDados = $yIniDados + 3;
2183
                }
2184
            }
2185
            $infNFe = $this->detCont->item($k)->getElementsByTagName('infNFe');
0 ignored issues
show
Bug introduced by
The method item cannot be called on $this->detCont (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...
2186
            foreach ($infNFe as $k => $d) {
2187
                $chaveNFe = $infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue;
2188
                $this->arrayNFe[] = $chaveNFe;
2189
            }
2190
        }
2191
        $qtdeNFe = 1;
0 ignored issues
show
Unused Code introduced by
$qtdeNFe 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...
2192
        $qtdDocs = count($this->arrayNFe) + $totalNF;
2193
        if ($qtdDocs > 7) {
2194
            $this->flagDetContContinuacao = 1;
2195
        }
2196
2197
        switch ($qtdDocs) {
2198
            default:
2199
                $this->totPag = 1;
2200
            case ($qtdDocs >= 1044):
2201
                $this->totPag = 11;
2202
                break;
2203
            case ($qtdDocs > 928):
2204
                $this->totPag = 10;
2205
                break;
2206
            case ($qtdDocs > 812):
2207
                $this->totPag = 9;
2208
                break;
2209
            case ($qtdDocs > 696):
2210
                $this->totPag = 8;
2211
                break;
2212
            case ($qtdDocs > 580):
2213
                $this->totPag = 7;
2214
                break;
2215
            case ($qtdDocs > 464):
2216
                $this->totPag = 6;
2217
                break;
2218
            case ($qtdDocs > 348):
2219
                $this->totPag = 5;
2220
                break;
2221
            case ($qtdDocs > 232):
2222
                $this->totPag = 4;
2223
                break;
2224
            case ($qtdDocs > 116):
2225
                $this->totPag = 3;
2226
                break;
2227
            case ($qtdDocs > 16):
2228
                $this->totPag = 2;
2229
                break;
2230
            case ($qtdDocs <= 7):
2231
                $this->totPag = 1;
2232
                break;
2233
        }
2234
        //$r = $this->cabecalho(1, 1, '1', $this->totPag);
2235
        $contador = 0;
2236
        if ($qtdDocs < 7) {
2237
            while ($contador < $qtdDocs - $totalNF) {
2238
                if ($contador == 8) {
2239
                    break;
2240
                }
2241
                $auxX = $oldX;
2242
                $tp = 'NF-e';
2243
                $chaveNFe = $this->arrayNFe[$contador];
2244
                $numNFe = substr($chaveNFe, 25, 9);
2245
                $serieNFe = substr($chaveNFe, 22, 3);
2246
                $doc = $serieNFe . '/' . $numNFe;
2247
                $texto = $tp;
2248
                $aFont = array(
2249
                    'font' => $this->fontePadrao,
2250
                    'size' => 7,
2251
                    'style' => '');
2252
                $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...
2253
                $auxX += $w * 0.07;
2254
                $texto = $chaveNFe;
2255
                $aFont = array(
2256
                    'font' => $this->fontePadrao,
2257
                    'size' => 7,
2258
                    'style' => '');
2259
                $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...
2260
                $auxX += $w * 0.28;
2261
                $texto = $doc;
2262
                $aFont = array(
2263
                    'font' => $this->fontePadrao,
2264
                    'size' => 7,
2265
                    'style' => '');
2266
                $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...
2267
                $auxX += $w * 0.15;
2268
                $contador++;
2269
                $yIniDados = $yIniDados + 3.5;
2270
            }
2271
        } else {
2272
2273
        }
2274
    }
2275
2276
    protected function detContContinuacao($x = 0, $y = 0)
2277
    {
2278
        $x2 = $x;
2279
        $y2 = $y;
2280
        for ($i = 2; $i <= $this->totPag; $i++) {
2281
            $x = $x2;
2282
            $y = $y2;
2283
            $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...
2284
            $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...
2285
            $oldX = $x;
2286
            $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...
2287
            if ($this->orientacao == 'P') {
2288
                $maxW = $this->wPrint;
2289
            } else {
2290
                $maxW = $this->wPrint - $this->wCanhoto;
2291
            }
2292
            $w = $maxW;
2293
            //$h = 6; // de sub-titulo
2294
            //$h = 6 + 3; // de altura do texto (primeira linha
2295
            //$h = 9 + 3.5 ;// segunda linha
2296
            //$h = 9 + 3.5+ 3.5 ;// segunda linha
2297
            $qtdDoc = count($this->arrayNFe) + count($this->arrayNF);
0 ignored issues
show
Bug introduced by
The property arrayNF does not seem to exist. Did you mean arrayNFe?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
2298
            $h = ($qtdDoc * 3.5) + 9;
2299
            if (count($this->arrayNFe) % 2 != 0) {
2300
                $h = $h + 3.5;
2301
            } // Caso tenha apenas 1 registro na ultima linha
2302
            $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO';
2303
            $aFont = $this->formatPadrao;
2304
            $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...
2305
            $yCont = $y;
0 ignored issues
show
Unused Code introduced by
$yCont 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...
2306
            $descr1 = 'TIPO DOC';
2307
            $descr2 = 'CNPJ/CPF EMITENTE';
2308
            $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2309
            $descr4 = 'NRO. LACRE';
2310
            $descr5 = 'NRO. CONTEINER';
2311
            $y += 3.4;
2312
            $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
2313
            $texto = $descr1;
2314
            $aFont = $this->formatPadrao;
2315
2316
            $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...
2317
            $yIniDados = $y;
2318
            $x += $w * 0.07;
2319
            $this->pdf->line($x, $y, $x, $y + $h - 3.4);
2320
            $texto = $descr2;
2321
            $aFont = $this->formatPadrao;
2322
            $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...
2323
            $x += $w * 0.28;
2324
            $this->pdf->line($x, $y, $x, $y + $h - 3.4);
2325
            $texto = $descr3;
2326
            $aFont = $this->formatPadrao;
2327
            $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...
2328
            $x += $w * 0.14;
2329
            $this->pdf->line($x, $y, $x, $y + $h - 3.4);
2330
            $texto = $descr4;
2331
            $aFont = $this->formatPadrao;
2332
            $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...
2333
            $x += $w * 0.20;
2334
            $this->pdf->line($x, $y, $x, $y + $h - 3.4);
2335
            $texto = $descr5;
2336
            $aFont = $this->formatPadrao;
2337
            $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...
2338
            $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...
2339
            $yIniDados += 3;
2340
            $totalNF = 0;
0 ignored issues
show
Unused Code introduced by
$totalNF 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...
2341
            $yCont = $y + 3;
2342
            $yIniDados = $y + 2;
2343
            foreach ($this->arrayCont as $conteiner) {
2344
                $aFont = $this->formatPadrao;
2345
                $nCont = $conteiner['nCont'];
2346
                $this->pdf->textBox($x, $yCont, $w * 0.23, $h, $nCont, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
2347
                $texto = $conteiner['nLacre'];
2348
                $this->pdf->textBox($x - $w * 0.2, $yCont, $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...
2349
                $yCont += 3;
2350
            }
2351
            foreach ($this->arrayNF as $infNF) {
0 ignored issues
show
Bug introduced by
The property arrayNF does not seem to exist. Did you mean arrayNFe?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
2352
                $tp = 'NF';
2353
                $cnpj = '-';
2354
                $doc = $infNF['serie'];
2355
                $doc .= '/' . $infNF['nDoc'];
2356
                $auxX = $oldX;
2357
                $texto = $tp;
2358
                $aFont = array(
2359
                    'font' => $this->fontePadrao,
2360
                    'size' => 7,
2361
                    'style' => '');
2362
                $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...
2363
                $auxX += $w * 0.07;
2364
                $texto = $cnpj;
2365
2366
                $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...
2367
                $auxX += $w * 0.28;
2368
                $texto = $doc;
2369
2370
                $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...
2371
                $yIniDados = $yIniDados + 3;
2372
            }
2373
            $contador = 0;
2374
            foreach ($this->arrayNFe as $nfe) {
2375
                $auxX = $oldX;
2376
                $tp = 'NF-e';
2377
                $chaveNFe = $nfe;
2378
                $numNFe = substr($chaveNFe, 25, 9);
2379
                $serieNFe = substr($chaveNFe, 22, 3);
2380
                $doc = $serieNFe . '/' . $numNFe;
2381
                $texto = $tp;
2382
                $aFont = array(
2383
                    'font' => $this->fontePadrao,
2384
                    'size' => 7,
2385
                    'style' => '');
2386
                $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...
2387
                $auxX += $w * 0.07;
2388
                $texto = $chaveNFe;
2389
                $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...
2390
                $auxX += $w * 0.28;
2391
                $texto = $doc;
2392
                $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...
2393
                $yIniDados = $yIniDados + 3;
2394
                $contador++;
2395
            }
2396
2397
        }
2398
    }
2399
2400
    /**
2401
     * docOrig
2402
     * Monta o campo com os documentos originarios.
2403
     *
2404
     * @param number $x Posição horizontal canto esquerdo
2405
     * @param number $y Posição vertical canto superior
2406
     * @return number Posição vertical final
2407
     */
2408
    protected function docOrig($x = 0, $y = 0)
2409
    {
2410
        $oldX = $x;
2411
        $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...
2412
        if ($this->orientacao == 'P') {
2413
            $maxW = $this->wPrint;
2414
        } else {
2415
            $maxW = $this->wPrint - $this->wCanhoto;
2416
        }
2417
        $w = $maxW;
2418
        // SE FOR RODOVIARIO ( BTR-SEMPRE SERÁ )
2419
        if ($this->modal == '1') {
2420
            // 0 - Não; 1 - Sim Será lotação quando houver um único conhecimento de transporte por veículo,
2421
            // ou combinação veicular, e por viagem
2422
            $h = $this->lota == 1 ? 35 : 53;
2423
        } elseif ($this->modal == '2') {
2424
            $h = 53;
2425
        } elseif ($this->modal == '3') {
2426
            $h = 27.6;
2427
        } else {
2428
            $h = 35;
2429
        }
2430
        $texto = 'DOCUMENTOS ORIGINÁRIOS';
2431
        $aFont = $this->formatPadrao;
2432
        $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...
2433
        $descr1 = 'TIPO DOC';
2434
        $descr2 = 'CNPJ/CHAVE/OBS';
2435
        $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2436
        $y += 3.4;
2437
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
2438
        $texto = $descr1;
2439
        $aFont = $this->formatPadrao;
2440
        $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...
2441
        $yIniDados = $y;
2442
        $x += $w * 0.07;
2443
        $texto = $descr2;
2444
        $aFont = $this->formatPadrao;
2445
        $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...
2446
        $x += $w * 0.28;
2447
        $texto = $descr3;
2448
        $aFont = $this->formatPadrao;
2449
        $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...
2450
        $x += $w * 0.14;
2451
        if ($this->modal == '1') {
2452
            if ($this->lota == 1) {
2453
                $this->pdf->line($x, $y, $x, $y + 31.5); // TESTE
2454
            } else {
2455
                $this->pdf->line($x, $y, $x, $y + 49.5); // TESTE
2456
            }
2457
        } elseif ($this->modal == '2') {
2458
            $this->pdf->line($x, $y, $x, $y + 49.5);
2459
        } elseif ($this->modal == '3') {
2460
            $this->pdf->line($x, $y, $x, $y + 34.1);
2461
        } else {
2462
            $this->pdf->line($x, $y, $x, $y + 21.5);
2463
        }
2464
        $texto = $descr1;
2465
        $aFont = $this->formatPadrao;
2466
        $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...
2467
        $x += $w * 0.08;
2468
        $texto = $descr2;
2469
        $aFont = $this->formatPadrao;
2470
        $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...
2471
        $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2472
        $texto = $descr3;
2473
        $aFont = $this->formatPadrao;
2474
        $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...
2475
        $auxX = $oldX;
2476
        $yIniDados += 3;
2477
        foreach ($this->infNF as $k => $d) {
2478
            $mod = $this->infNF->item($k)->getElementsByTagName('mod');
2479
            $tp = ($mod && $mod->length > 0) ? $mod->item(0)->nodeValue : '';
2480
            $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...
2481
            $doc = $this->infNF->item($k)->getElementsByTagName('serie')->item(0)->nodeValue;
2482
            $doc .= '/' . $this->infNF->item($k)->getElementsByTagName('nDoc')->item(0)->nodeValue;
2483
            if ($auxX > $w * 0.90) {
2484
                $yIniDados = $yIniDados + 3;
2485
                $auxX = $oldX;
2486
            }
2487
            $texto = $tp;
2488
            $aFont = array(
2489
                'font' => $this->fontePadrao,
2490
                'size' => 8,
2491
                'style' => '');
2492
            //$this->pdf->textBox($auxX, $yIniDados, $w * 0.10, $h, $texto, $aFont, 'T', 'L', 0, '');
2493
            $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...
2494
            //$auxX += $w * 0.09;
2495
            $auxX += $w * 0.07;
2496
            $texto = $cnpj;
2497
            $aFont = array(
2498
                'font' => $this->fontePadrao,
2499
                'size' => 8,
2500
                'style' => '');
2501
            $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...
2502
            $auxX += $w * 0.28;
2503
            $texto = $doc;
2504
            $aFont = array(
2505
                'font' => $this->fontePadrao,
2506
                'size' => 8,
2507
                'style' => '');
2508
            $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...
2509
            $auxX += $w * 0.15;
2510
        }
2511
        foreach ($this->infNFe as $k => $d) {
2512
            $chaveNFe = $this->infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue;
2513
            $this->arrayNFe[] = $chaveNFe;
2514
        }
2515
        $qtdeNFe = 1;
2516
        if (count($this->arrayNFe) > 15) {
2517
            $this->flagDocOrigContinuacao = 1;
2518
            $qtdeNFe = count($this->arrayNFe);
2519
        }
2520
//        $totPag = count($this->arrayNFe) > 15 ? '2' : '1';
2521
        switch ($qtdeNFe) {
2522
            default:
2523
                $this->totPag = 1;
2524
            case ($qtdeNFe >= 1044):
2525
                $this->totPag = 11;
2526
                break;
2527
            case ($qtdeNFe > 928):
2528
                $this->totPag = 10;
2529
                break;
2530
            case ($qtdeNFe > 812):
2531
                $this->totPag = 9;
2532
                break;
2533
            case ($qtdeNFe > 696):
2534
                $this->totPag = 8;
2535
                break;
2536
            case ($qtdeNFe > 580):
2537
                $this->totPag = 7;
2538
                break;
2539
            case ($qtdeNFe > 464):
2540
                $this->totPag = 6;
2541
                break;
2542
            case ($qtdeNFe > 348):
2543
                $this->totPag = 5;
2544
                break;
2545
            case ($qtdeNFe > 232):
2546
                $this->totPag = 4;
2547
                break;
2548
            case ($qtdeNFe > 116):
2549
                $this->totPag = 3;
2550
                break;
2551
            case ($qtdeNFe > 16):
2552
                $this->totPag = 2;
2553
                break;
2554
            case ($qtdeNFe <= 16):
2555
                $this->totPag = 1;
2556
                break;
2557
        }
2558
        //$r = $this->cabecalho(1, 1, '1', $this->totPag);
2559
        $contador = 0;
2560
        while ($contador < count($this->arrayNFe)) {
2561
            if ($contador == 16) {
2562
                break;
2563
            }
2564
            $tp = 'NF-e';
2565
            $chaveNFe = $this->arrayNFe[$contador];
2566
            $numNFe = substr($chaveNFe, 25, 9);
2567
            $serieNFe = substr($chaveNFe, 22, 3);
2568
            $doc = $serieNFe . '/' . $numNFe;
2569
            if ($auxX > $w * 0.90) {
2570
                $yIniDados = $yIniDados + 3.5;
2571
                $auxX = $oldX;
2572
            }
2573
            $texto = $tp;
2574
            $aFont = array(
2575
                'font' => $this->fontePadrao,
2576
                'size' => 7,
2577
                'style' => '');
2578
            $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...
2579
            $auxX += $w * 0.07;
2580
            $texto = $chaveNFe;
2581
            $aFont = array(
2582
                'font' => $this->fontePadrao,
2583
                'size' => 7,
2584
                'style' => '');
2585
            $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...
2586
            $auxX += $w * 0.28;
2587
            $texto = $doc;
2588
            $aFont = array(
2589
                'font' => $this->fontePadrao,
2590
                'size' => 7,
2591
                'style' => '');
2592
            $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...
2593
            $auxX += $w * 0.15;
2594
            $contador++;
2595
        }
2596
        foreach ($this->infOutros as $k => $d) {
2597
            $temp = $this->infOutros->item($k);
2598
            $tpDoc = $this->getTagValue($temp, "tpDoc");
2599
            $descOutros = $this->getTagValue($temp, "descOutros");
2600
            $nDoc = $this->getTagValue($temp, "nDoc");
2601
            $dEmi = "Emissão: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dEmi")));
2602
            $vDocFisc = $this->getTagValue($temp, "vDocFisc", "Valor: ");
2603
            $dPrev = "Entrega: " . date('d/m/Y', strtotime($this->getTagValue($temp, "dPrev")));
2604
            switch ($tpDoc) {
2605
                case "00":
2606
                    $tpDoc = "00 - Declaração";
2607
                    break;
2608
                case "10":
2609
                    $tpDoc = "10 - Dutoviário";
2610
                    break;
2611
                case "99":
2612
                    $tpDoc = "99 - Outros: [" . $descOutros . "]";
2613
                    break;
2614
                default:
2615
                    break;
2616
            }
2617
            $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...
2618
            $cnpjChave = $dEmi . " " . $vDocFisc . " " . $dPrev;
2619
            if ($auxX > $w * 0.90) {
2620
                $yIniDados = $yIniDados + 4;
2621
                $auxX = $oldX;
2622
            }
2623
            $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...
2624
            $auxX += $w * 0.09;
2625
            $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...
2626
            $auxX += $w * 0.28;
2627
            $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...
2628
            $auxX += $w * 0.14;
2629
        }
2630
        foreach ($this->idDocAntEle as $k => $d) {
2631
            $tp = 'CT-e';
2632
            $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...
2633
            $numCTe = substr($chaveCTe, 25, 9);
2634
            $serieCTe = substr($chaveCTe, 22, 3);
2635
            $doc = $serieCTe . '/' . $numCTe;
2636
            if ($auxX > $w * 0.90) {
2637
                $yIniDados = $yIniDados + 4;
2638
                $auxX = $oldX;
2639
            }
2640
            $texto = $tp;
2641
            $aFont = array(
2642
                'font' => $this->fontePadrao,
2643
                'size' => 8,
2644
                'style' => '');
2645
            $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...
2646
            $auxX += $w * 0.09;
2647
            $texto = $chaveCTe;
2648
            $aFont = array(
2649
                'font' => $this->fontePadrao,
2650
                'size' => 8,
2651
                'style' => '');
2652
            $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...
2653
            $auxX += $w * 0.28;
2654
            $texto = $doc;
2655
            $aFont = array(
2656
                'font' => $this->fontePadrao,
2657
                'size' => 8,
2658
                'style' => '');
2659
            $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...
2660
            $auxX += $w * 0.14;
2661
        }
2662
        foreach ($this->infCTeMultimodal as $k => $d) {
2663
            $tp = 'CT-e';
2664
            $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...
2665
            $numCTe = substr($chaveCTe, 25, 9);
2666
            $serieCTe = substr($chaveCTe, 22, 3);
2667
            $doc = $serieCTe . '/' . $numCTe;
2668
            if ($auxX > $w * 0.90) {
2669
                $yIniDados = $yIniDados + 4;
2670
                $auxX = $oldX;
2671
            }
2672
            $texto = $tp;
2673
            $aFont = array(
2674
                'font' => $this->fontePadrao,
2675
                'size' => 8,
2676
                'style' => '');
2677
            $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...
2678
            $auxX += $w * 0.09;
2679
            $texto = $chaveCTe;
2680
            $aFont = array(
2681
                'font' => $this->fontePadrao,
2682
                'size' => 8,
2683
                'style' => '');
2684
            $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...
2685
            $auxX += $w * 0.28;
2686
            $texto = $doc;
2687
            $aFont = array(
2688
                'font' => $this->fontePadrao,
2689
                'size' => 8,
2690
                'style' => '');
2691
            $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...
2692
            $auxX += $w * 0.14;
2693
        }
2694
    }
2695
2696
    /**
2697
     * docOrigContinuacao
2698
     * Monta o campo com os documentos originarios.
2699
     *
2700
     * @param number $x Posição horizontal canto esquerdo
2701
     * @param number $y Posição vertical canto superior
2702
     * @return number Posição vertical final
2703
     */
2704
    protected function docOrigContinuacao($x = 0, $y = 0)
2705
    {
2706
        $x2 = $x;
2707
        $y2 = $y;
2708
        $contador = 16;
2709
        for ($i = 2; $i <= $this->totPag; $i++) {
2710
            $x = $x2;
2711
            $y = $y2;
2712
            $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...
2713
            $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...
2714
            $oldX = $x;
2715
            $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...
2716
            if ($this->orientacao == 'P') {
2717
                $maxW = $this->wPrint;
2718
            } else {
2719
                $maxW = $this->wPrint - $this->wCanhoto;
2720
            }
2721
            $w = $maxW;
2722
            //$h = 6; // de sub-titulo
2723
            //$h = 6 + 3; // de altura do texto (primeira linha
2724
            //$h = 9 + 3.5 ;// segunda linha
2725
            //$h = 9 + 3.5+ 3.5 ;// segunda linha
2726
            $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9;
2727
            if (count($this->arrayNFe) % 2 != 0) {
2728
                $h = $h + 3.5;
2729
            } // Caso tenha apenas 1 registro na ultima linha
2730
            $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO';
2731
            $aFont = $this->formatPadrao;
2732
            $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...
2733
            $descr1 = 'TIPO DOC';
2734
            $descr2 = 'CNPJ/CHAVE/OBS';
2735
            $descr3 = 'SÉRIE/NRO. DOCUMENTO';
2736
            $y += 3.4;
2737
            $this->pdf->line($x, $y, $w + 1, $y);
2738
            $texto = $descr1;
2739
            $aFont = $this->formatPadrao;
2740
            $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...
2741
            $yIniDados = $y;
2742
            $x += $w * 0.07; // COLUNA CNPJ/CHAVE/OBS
2743
            $texto = $descr2;
2744
            $aFont = $this->formatPadrao;
2745
            $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...
2746
            $x += $w * 0.28;
2747
            $texto = $descr3;
2748
            $aFont = $this->formatPadrao;
2749
            $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...
2750
            $x += $w * 0.14;
2751
            if ($this->modal == '1') {
2752
                if ($this->lota == 1) {
2753
                    $this->pdf->line($x, $y, $x, $y + 31.5);
2754
                } else {
2755
                    $this->pdf->line($x, $y, $x, $y + 49.5);
2756
                }
2757
            } elseif ($this->modal == '2') {
2758
                $this->pdf->line($x, $y, $x, $y + 49.5);
2759
            } elseif ($this->modal == '3') {
2760
                $this->pdf->line($x, $y, $x, $y + 34.1);
2761
            } else {
2762
                $this->pdf->line($x, $y, $x, $y + 21.5);
2763
            }
2764
            $texto = $descr1;
2765
            $aFont = $this->formatPadrao;
2766
            $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...
2767
            $x += $w * 0.08;
2768
            $texto = $descr2;
2769
            $aFont = $this->formatPadrao;
2770
            $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...
2771
            $x += $w * 0.28; // COLUNA SÉRIE/NRO.DOCUMENTO DA DIREITA
2772
            $texto = $descr3;
2773
            $aFont = $this->formatPadrao;
2774
            $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...
2775
            $auxX = $oldX;
2776
            $yIniDados += 3;
2777
            while ($contador < (count($this->arrayNFe))) {
2778
                if ($contador % (116 * ($i - 1)) == 0) {
2779
//                    $contador++;
2780
                    break;
2781
                }
2782
                $tp = 'NF-e';
2783
                $chaveNFe = $this->arrayNFe[$contador];
2784
                $numNFe = substr($chaveNFe, 25, 9);
2785
                $serieNFe = substr($chaveNFe, 22, 3);
2786
                $doc = $serieNFe . '/' . $numNFe;
2787
                if ($auxX > $w * 0.90) {
2788
                    $yIniDados = $yIniDados + 3.5;
2789
                    $auxX = $oldX;
2790
                }
2791
                $texto = $tp;
2792
                $aFont = array(
2793
                    'font' => $this->fontePadrao,
2794
                    'size' => 7,
2795
                    'style' => '');
2796
                $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...
2797
                $auxX += $w * 0.07;
2798
                $texto = $chaveNFe;
2799
                $aFont = array(
2800
                    'font' => $this->fontePadrao,
2801
                    'size' => 7,
2802
                    'style' => '');
2803
                $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...
2804
                $auxX += $w * 0.28;
2805
                $texto = $doc;
2806
                $aFont = array(
2807
                    'font' => $this->fontePadrao,
2808
                    'size' => 7,
2809
                    'style' => '');
2810
                $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...
2811
                $auxX += $w * 0.15;
2812
                $contador++;
2813
            }
2814
        }
2815
    }
2816
2817
    /**
2818
     * docCompl
2819
     * Monta o campo com os dados do remetente na DACTE.
2820
     *
2821
     * @param number $x Posição horizontal canto esquerdo
2822
     * @param number $y Posição vertical canto superior
2823
     * @return number Posição vertical final
2824
     */
2825
    protected function docCompl($x = 0, $y = 0)
2826
    {
2827
        $oldX = $x;
2828
        $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...
2829
        if ($this->orientacao == 'P') {
2830
            $maxW = $this->wPrint;
2831
        } else {
2832
            $maxW = $this->wPrint - $this->wCanhoto;
2833
        }
2834
        $w = $maxW;
2835
        $h = 80;
2836
        if ($this->tpCTe == 1) {
2837
            $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
2838
            $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
2839
            $descr2 = 'VALOR COMPLEMENTADO';
2840
        } else {
2841
            $texto = 'DETALHAMENTO DO CT-E ANULADO';
2842
            $descr1 = 'CHAVE DO CT-E ANULADO';
2843
            $descr2 = 'VALOR ANULADO';
2844
        }
2845
        $aFont = $this->formatPadrao;
2846
        $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...
2847
        $y += 3.4;
2848
        $this->pdf->line($x, $y, $w + 1, $y);
2849
        $texto = $descr1;
2850
        $aFont = $this->formatPadrao;
2851
        $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...
2852
        $yIniDados = $y;
2853
        $x += $w * 0.37;
2854
        $texto = $descr2;
2855
        $aFont = $this->formatPadrao;
2856
        $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...
2857
        $x += $w * 0.13;
2858
        $this->pdf->line($x, $y, $x, $y + 76.5);
2859
        $texto = $descr1;
2860
        $aFont = $this->formatPadrao;
2861
        $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...
2862
        $x += $w * 0.3;
2863
        $texto = $descr2;
2864
        $aFont = $this->formatPadrao;
2865
        $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...
2866
        $auxX = $oldX;
2867
        $yIniDados += 4;
2868
        if ($auxX > $w * 0.90) {
2869
            $yIniDados = $yIniDados + 4;
2870
            $auxX = $oldX;
2871
        }
2872
        $texto = $this->chaveCTeRef;
2873
        $aFont = array(
2874
            'font' => $this->fontePadrao,
2875
            'size' => 8,
2876
            'style' => '');
2877
        $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...
2878
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
2879
        $aFont = array(
2880
            'font' => $this->fontePadrao,
2881
            'size' => 8,
2882
            'style' => '');
2883
        $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...
2884
    }
2885
2886
    /**
2887
     * observacao
2888
     * Monta o campo com os dados do remetente na DACTE.
2889
     *
2890
     * @param number $x Posição horizontal canto esquerdo
2891
     * @param number $y Posição vertical canto superior
2892
     * @return number Posição vertical final
2893
     */
2894
    protected function observacao($x = 0, $y = 0)
2895
    {
2896
        $oldX = $x;
2897
        $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...
2898
        if ($this->orientacao == 'P') {
2899
            $maxW = $this->wPrint;
2900
        } else {
2901
            $maxW = $this->wPrint - $this->wCanhoto;
2902
        }
2903
        $w = $maxW;
2904
        //$h = 18;
2905
        $h = 18.8;
2906
        $texto = 'OBSERVAÇÕES GERAIS';
2907
        $aFont = $this->formatPadrao;
2908
        $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...
2909
        $y += 3.4;
2910
        $this->pdf->line($x, $y, $w + 1, $y);
2911
        $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...
2912
        $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...
2913
        $texto = '';
2914
        foreach ($this->compl as $k => $d) {
2915
            $xObs = $this->getTagValue($this->compl->item($k), "xObs");
2916
            $texto .= $xObs;
2917
        }
2918
        $textoObs = explode("Motorista:", $texto);
2919
        $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : '';
2920
        $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n");
2921
        $aFont = array(
2922
            'font' => $this->fontePadrao,
2923
            'size' => 7.5,
2924
            'style' => '');
2925
        $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...
2926
        $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...
2927
    }
2928
2929
    /**
2930
     * modalRod
2931
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2932
     *
2933
     * @param number $x Posição horizontal canto esquerdo
2934
     * @param number $y Posição vertical canto superior
2935
     * @return number Posição vertical final
2936
     */
2937
    protected function modalRod($x = 0, $y = 0)
2938
    {
2939
        $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...
2940
        $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...
2941
        $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...
2942
        if ($this->orientacao == 'P') {
2943
            $maxW = $this->wPrint;
2944
        } else {
2945
            $maxW = $this->wPrint - $this->wCanhoto;
2946
        }
2947
        $w = $maxW;
2948
        $h = 3;
2949
        $texto = 'DADOS ESPECÍFICOS DO MODAL RODOVIÁRIO';
2950
        $aFont = $this->formatPadrao;
2951
        $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...
2952
        if ($this->lota == 1) {
2953
            $this->pdf->line($x, $y + 12, $w + 1, $y + 12); // LINHA DE BAIXO
2954
        }
2955
        $y += 3.4;
2956
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2957
        $texto = 'RNTRC DA EMPRESA';
2958
        $aFont = $this->formatPadrao;
2959
        $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...
2960
        $texto = $this->getTagValue($this->rodo, "RNTRC");
2961
        $aFont = $this->formatNegrito;
2962
        $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...
2963
        $x += $w * 0.23;
2964
        $this->pdf->line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA
2965
        $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR';
2966
        $aFont = $this->formatPadrao;
2967
        $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...
2968
    }
2969
2970
    /**
2971
     * modalAereo
2972
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2973
     *
2974
     * @param number $x Posição horizontal canto esquerdo
2975
     * @param number $y Posição vertical canto superior
2976
     * @return number Posição vertical final
2977
     */
2978
    protected function modalAereo($x = 0, $y = 0)
2979
    {
2980
        $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...
2981
        $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...
2982
        $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...
2983
        if ($this->orientacao == 'P') {
2984
            $maxW = $this->wPrint;
2985
        } else {
2986
            $maxW = $this->wPrint - $this->wCanhoto;
2987
        }
2988
        $w = $maxW;
2989
        $h = 3;
2990
        $texto = 'DADOS ESPECÍFICOS DO MODAL AÉREO';
2991
        $aFont = $this->formatPadrao;
2992
        $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...
2993
        $y += 3.4;
2994
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA DE CIMA
2995
        $texto = 'NÚMERO OPERACIONAL DO CONHECIMENTO AÉREO';
2996
        $aFont = $this->formatPadrao;
2997
        $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...
2998
        $texto = 'CLASSE DA TARIFA';
2999
        $aFont = $this->formatPadrao;
3000
        $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...
3001
        $texto = 'CÓDIGO DA TARIFA';
3002
        $aFont = $this->formatPadrao;
3003
        $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...
3004
        $texto = 'VALOR DA TARIFA';
3005
        $aFont = $this->formatPadrao;
3006
        $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...
3007
        $texto = $this->getTagValue($this->aereo, "nOCA");
3008
        $aFont = $this->formatNegrito;
3009
        $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...
3010
        $x += $w * 0.23;
3011
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS NÚMERO OP. DO CT-E AEREO
3012
        $texto = $this->getTagValue($this->aereo, "CL");
3013
        $aFont = $this->formatNegrito;
3014
        $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...
3015
        $x += 30;
3016
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS CLASSE DA TARIFA
3017
        $texto = $this->getTagValue($this->aereo, "cTar");
3018
        $aFont = $this->formatNegrito;
3019
        $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...
3020
        $x += 30;
3021
        $this->pdf->line($x, $y, $x, $y + 6); // LINHA APÓS COD DA TARIFA
3022
        $texto = $this->getTagValue($this->aereo, "vTar");
3023
        $aFont = $this->formatNegrito;
3024
        $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...
3025
    }
3026
3027
    /**
3028
     * modalAquaviario
3029
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
3030
     *
3031
     * @param number $x Posição horizontal canto esquerdo
3032
     * @param number $y Posição vertical canto superior
3033
     * @return number Posição vertical final
3034
     */
3035
    protected function modalAquaviario($x = 0, $y = 0)
3036
    {
3037
        $oldX = $x;
3038
        $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...
3039
        if ($this->orientacao == 'P') {
3040
            $maxW = $this->wPrint;
3041
        } else {
3042
            $maxW = $this->wPrint - $this->wCanhoto;
3043
        }
3044
        $w = $maxW;
3045
        $h = 8.5;
3046
        if (empty($this->detCont)) {
3047
            $texto = 'DETALHAMENTO DO CONTAINER - INFORMAÇÕES ESPECÍFICAS DO MODAL AQUAVIÁRIO';
3048
            $aFont = $this->formatPadrao;
3049
            $this->pdf->textBox($x, $y, $w, $h * 1.3, $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...
3050
            $y += 3.4;
3051
            $this->pdf->line($x, $y, $w + 1, $y);
3052
            $texto = 'LACRE';
3053
            $aFont = $this->formatPadrao;
3054
            $this->pdf->textBox($x, $y, $w * 0.33, $h + 7.5, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3055
            $x += $w * 0.50;
3056
            $this->pdf->line($x, $y, $x, $y + 7.5);
3057
            $texto = 'IDENTIFICAÇÃO DO CONTAINER';
3058
            $aFont = $this->formatPadrao;
3059
            $this->pdf->textBox($x, $y, $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...
3060
            $y += 7.5;
3061
        }
3062
        $texto = 'PREVISÃO DO FLUXO DE CARGA';
3063
        $aFont = $this->formatPadrao;
3064
        $x = $oldX;
3065
        $this->pdf->textBox($x, $y, $w, $h * 1.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...
3066
        $y += 3.4;
3067
        $this->pdf->line($x, $y, $x + $w, $y);
3068
        $texto = 'SIGLA OU CÓDIGO INT. DA FILIAL/PORTO/ESTAÇÃO/AEROPORTO DE ORIGEM';
3069
        $this->pdf->textBox($x, $y, $w * 0.33, $h * 1.2, $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...
3070
        $fluxo = $this->dom->getElementsByTagName("fluxo")->item(0);
3071
        $texto = $this->getTagValue($fluxo, 'xOrig');
3072
        $this->pdf->textBox($x, $y + 3.5, $w * 0.33, $h * 1.2, $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...
3073
        $x += $w * 0.33;
3074
        $this->pdf->line($x, $y + 6.5, $x, $y);
3075
        $texto = 'SIGLA OU CÓDIGO INT. DA FILIAL/PORTO/ESTAÇÃO/AEROPORTO DE PASSAGEM';
3076
        $this->pdf->textBox($x, $y, $w * 0.33, $h * 1.2, $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...
3077
        $pass = $this->dom->getElementsByTagName("pass");
3078
        $texto = '';
3079
        foreach ($pass as $passagem) {
3080
            $texto .= $this->getTagValue($passagem, 'xPass');
3081
        }
3082
        $this->pdf->textBox($x, $y + 3.5, $w * 0.33, $h * 1.2, $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...
3083
        $x += $w * 0.33;
3084
        $this->pdf->line($x, $y + 6.5, $x, $y);
3085
        $texto = 'SIGLA OU CÓDIGO INT. DA FILIAL/PORTO/ESTAÇÃO/AEROPORTO DE DESTINO';
3086
        $this->pdf->textBox($x, $y, $w * 0.33, $h * 1.3, $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...
3087
        $texto = $this->getTagValue($fluxo, 'xDest');
3088
        $this->pdf->textBox($x, $y + 3.5, $w * 0.33, $h * 1.3, $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...
3089
        $x = $oldX;
3090
        $y += 6.8;
3091
        $this->observacao($x, $y);
3092
        $y += $h * 2.2;
3093
        $x = 1;
3094
        $aFont = $this->formatPadrao;
3095
        $texto = '';
3096
        $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...
3097
        $texto = 'IDENTIFICAÇÃO DO NAVIO / REBOCADOR';
3098
        $aFont = $this->formatPadrao;
3099
        $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...
3100
        $texto = $this->getTagValue($this->aquav, "xNavio");
3101
        $aFont = $this->formatNegrito;
3102
        $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...
3103
        $x = $w * 0.33;
3104
        $this->pdf->line($x, $y, $x, $y + $h);
3105
        $texto = 'IDENTIFICAÇÃO DA BALSA';
3106
        $aFont = $this->formatPadrao;
3107
        $this->pdf->textBox($x, $y, $w * 0.23, $h * 2, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
3108
        $texto = '';
3109
        if ($this->getTagValue($this->aquav, "balsa") !== '') {
3110
            foreach ($this->aquav->getElementsByTagName('balsa') as $k => $d) {
3111
                if ($k == 0) {
3112
                    $texto = $this->aquav
3113
                        ->getElementsByTagName('balsa')
3114
                        ->item($k)
3115
                        ->getElementsByTagName('xBalsa')
3116
                        ->item(0)
3117
                        ->nodeValue;
3118
                } else {
3119
                    $texto = $texto
3120
                        . ' / '
3121
                        . $this->aquav
3122
                            ->getElementsByTagName('balsa')
3123
                            ->item($k)
3124
                            ->getElementsByTagName('xBalsa')
3125
                            ->item(0)
3126
                            ->nodeValue;
3127
                }
3128
            }
3129
        }
3130
        $aFont = $this->formatNegrito;
3131
        $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...
3132
        $x += $w * 0.33;
3133
        $this->pdf->line($x, $y, $x, $y + 7.7);
3134
        $texto = 'VALOR DO AFRMM';
3135
        $aFont = $this->formatPadrao;
3136
        $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...
3137
        $texto = number_format($this->getTagValue($this->aquav, "vAFRMM"), 2, ",", ".");
3138
        $aFont = $this->formatNegrito;
3139
        $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...
3140
        $x = $oldX;
0 ignored issues
show
Unused Code introduced by
$x 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...
3141
        $y += $h;
3142
    }
3143
3144
    /**
3145
     * modalFerr
3146
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
3147
     *
3148
     * @param number $x Posição horizontal canto esquerdo
3149
     * @param number $y Posição vertical canto superior
3150
     * @return number Posição vertical final
3151
     */
3152
    protected function modalFerr($x = 0, $y = 0)
3153
    {
3154
        $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...
3155
        $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...
3156
        if ($this->orientacao == 'P') {
3157
            $maxW = $this->wPrint;
3158
        } else {
3159
            $maxW = $this->wPrint - $this->wCanhoto;
3160
        }
3161
        $w = $maxW;
3162
        $h = 19.6;
3163
        $texto = 'DADOS ESPECÍFICOS DO MODAL FERROVIÁRIO';
3164
        $aFont = $this->formatPadrao;
3165
        $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...
3166
        $y += 3.4;
3167
        $this->pdf->line($x, $y, $w + 1, $y);
3168
        $texto = 'DCL';
3169
        $aFont = array(
3170
            'font' => $this->fontePadrao,
3171
            'size' => 7,
3172
            'style' => 'B');
3173
        $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...
3174
        $this->pdf->line($x + 49.6, $y, $x + 49.6, $y + 3.5);
3175
        $texto = 'VAGÕES';
3176
        $aFont = array(
3177
            'font' => $this->fontePadrao,
3178
            'size' => 7,
3179
            'style' => 'B');
3180
        $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...
3181
        $y += 3.4;
3182
        $this->pdf->line($x, $y, $w + 1, $y);
3183
        // DCL
3184
        $texto = 'ID TREM';
3185
        $aFont = array(
3186
            'font' => $this->fontePadrao,
3187
            'size' => 6,
3188
            'style' => '');
3189
        $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...
3190
        $texto = $this->getTagValue($this->ferrov, "idTrem");
3191
        $aFont = array(
3192
            'font' => $this->fontePadrao,
3193
            'size' => 6,
3194
            'style' => 'B');
3195
        $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...
3196
        $x += $w * 0.06;
3197
        $y1 = $y + 12.5;
3198
        $this->pdf->line($x, $y, $x, $y1);
3199
        $texto = 'NUM';
3200
        $aFont = array(
3201
            'font' => $this->fontePadrao,
3202
            'size' => 6,
3203
            'style' => '');
3204
        $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...
3205
        $texto = $this->getTagValue($this->rem, "nDoc");
3206
        $aFont = array(
3207
            'font' => $this->fontePadrao,
3208
            'size' => 6,
3209
            'style' => 'B');
3210
        $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...
3211
        $x += $w * 0.06;
3212
        $this->pdf->line($x, $y, $x, $y1);
3213
        $texto = 'SÉRIE';
3214
        $aFont = array(
3215
            'font' => $this->fontePadrao,
3216
            'size' => 6,
3217
            'style' => '');
3218
        $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...
3219
        $texto = $this->getTagValue($this->rem, "serie");
3220
        $aFont = array(
3221
            'font' => $this->fontePadrao,
3222
            'size' => 6,
3223
            'style' => 'B');
3224
        $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...
3225
        $x += $w * 0.06;
3226
        $this->pdf->line($x, $y, $x, $y1);
3227
        $texto = 'EMISSÃO';
3228
        $aFont = array(
3229
            'font' => $this->fontePadrao,
3230
            'size' => 6,
3231
            'style' => '');
3232
        $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...
3233
        $texto = $this->ymdTodmy($this->getTagValue($this->rem, "dEmi"));
3234
        $aFont = array(
3235
            'font' => $this->fontePadrao,
3236
            'size' => 6,
3237
            'style' => 'B');
3238
        $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...
3239
        // VAGOES
3240
        $x += $w * 0.06;
3241
        $this->pdf->line($x, $y, $x, $y1);
3242
        $texto = 'NUM';
3243
        $aFont = array(
3244
            'font' => $this->fontePadrao,
3245
            'size' => 6,
3246
            'style' => '');
3247
        $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...
3248
        $texto = $this->getTagValue($this->ferrov, "nVag");
3249
        $aFont = array(
3250
            'font' => $this->fontePadrao,
3251
            'size' => 6,
3252
            'style' => 'B');
3253
        $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...
3254
        $x += $w * 0.06;
3255
        $this->pdf->line($x, $y, $x, $y1);
3256
        $texto = 'TIPO';
3257
        $aFont = array(
3258
            'font' => $this->fontePadrao,
3259
            'size' => 6,
3260
            'style' => '');
3261
        $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...
3262
        $texto = $this->getTagValue($this->ferrov, "tpVag");
3263
        $aFont = array(
3264
            'font' => $this->fontePadrao,
3265
            'size' => 6,
3266
            'style' => 'B');
3267
        $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...
3268
        $x += $w * 0.06;
3269
        $this->pdf->line($x, $y, $x, $y1);
3270
        $texto = 'CAPACIDADE';
3271
        $aFont = array(
3272
            'font' => $this->fontePadrao,
3273
            'size' => 6,
3274
            'style' => '');
3275
        $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...
3276
        $texto = $this->getTagValue($this->ferrov, "cap");
3277
        $aFont = array(
3278
            'font' => $this->fontePadrao,
3279
            'size' => 6,
3280
            'style' => 'B');
3281
        $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...
3282
        $x += $w * 0.08;
3283
        $this->pdf->line($x, $y, $x, $y1);
3284
        $texto = 'PESO REAL/TON';
3285
        $aFont = array(
3286
            'font' => $this->fontePadrao,
3287
            'size' => 6,
3288
            'style' => '');
3289
        $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...
3290
        $texto = $this->getTagValue($this->ferrov, "pesoR");
3291
        $aFont = array(
3292
            'font' => $this->fontePadrao,
3293
            'size' => 6,
3294
            'style' => 'B');
3295
        $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...
3296
        $x += $w * 0.09;
3297
        $this->pdf->line($x, $y, $x, $y1);
3298
        $texto = 'PESO BRUTO/TON';
3299
        $aFont = array(
3300
            'font' => $this->fontePadrao,
3301
            'size' => 6,
3302
            'style' => '');
3303
        $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...
3304
        $texto = $this->getTagValue($this->ferrov, "pesoBC");
3305
        $aFont = array(
3306
            'font' => $this->fontePadrao,
3307
            'size' => 6,
3308
            'style' => 'B');
3309
        $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...
3310
        $x += $w * 0.1;
3311
        $this->pdf->line($x, $y, $x, $y1);
3312
        $texto = 'IDENTIFICAÇÃO DOS CONTÊINERES';
3313
        $aFont = array(
3314
            'font' => $this->fontePadrao,
3315
            'size' => 6,
3316
            'style' => '');
3317
        $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...
3318
        $texto = $this->getTagValue($this->ferrov, "nCont");
3319
        $aFont = array(
3320
            'font' => $this->fontePadrao,
3321
            'size' => 6,
3322
            'style' => 'B');
3323
        $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...
3324
        // FLUXO
3325
        $x = 1;
3326
        $y += 12.9;
3327
        $h1 = $h * 0.5 + 0.27;
3328
        $wa = round($w * 0.103) + 0.5;
3329
        $texto = 'FLUXO FERROVIARIO';
3330
        $aFont = $this->formatPadrao;
3331
        $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...
3332
        $texto = $this->getTagValue($this->ferrov, "fluxo");
3333
        $aFont = array(
3334
            'font' => $this->fontePadrao,
3335
            'size' => 7,
3336
            'style' => 'B');
3337
        $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...
3338
        $y += 10;
3339
        $texto = 'TIPO DE TRÁFEGO';
3340
        $aFont = $this->formatPadrao;
3341
        $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...
3342
        $texto = $this->convertUnidTrafego($this->getTagValue($this->ferrov, "tpTraf"));
3343
        $aFont = array(
3344
            'font' => $this->fontePadrao,
3345
            'size' => 7,
3346
            'style' => 'B');
3347
        $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...
3348
        // Novo Box Relativo a Modal Ferroviário
3349
        $x = 22.5;
3350
        $y += -10.2;
3351
        $texto = 'INFORMAÇÕES DAS FERROVIAS ENVOLVIDAS';
3352
        $aFont = $this->formatPadrao;
3353
        $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...
3354
        $y += 3.4;
3355
        $this->pdf->line($x, $y, $w + 1, $y);
3356
        $w = $w * 0.2;
3357
        $h = $h * 1.04;
3358
        $texto = 'CÓDIGO INTERNO';
3359
        $aFont = array(
3360
            'font' => $this->fontePadrao,
3361
            'size' => 6,
3362
            'style' => '');
3363
        $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...
3364
        $texto = $this->getTagValue($this->ferrov, "cInt");
3365
        $aFont = array(
3366
            'font' => $this->fontePadrao,
3367
            'size' => 6,
3368
            'style' => 'B');
3369
        $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...
3370
        $texto = 'CNPJ';
3371
        $aFont = array(
3372
            'font' => $this->fontePadrao,
3373
            'size' => 6,
3374
            'style' => '');
3375
        $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...
3376
        $texto = $this->getTagValue($this->ferrov, "CNPJ");
3377
        $aFont = array(
3378
            'font' => $this->fontePadrao,
3379
            'size' => 6,
3380
            'style' => 'B');
3381
        $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...
3382
        $x += 50;
3383
        $texto = 'NOME';
3384
        $aFont = array(
3385
            'font' => $this->fontePadrao,
3386
            'size' => 6,
3387
            'style' => '');
3388
        $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...
3389
        $texto = $this->getTagValue($this->ferrov, "xNome");
3390
        $aFont = array(
3391
            'font' => $this->fontePadrao,
3392
            'size' => 6,
3393
            'style' => 'B');
3394
        $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...
3395
        $texto = 'INSCRICAO ESTADUAL';
3396
        $aFont = array(
3397
            'font' => $this->fontePadrao,
3398
            'size' => 6,
3399
            'style' => '');
3400
        $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...
3401
        $texto = $this->getTagValue($this->ferrov, "IE");
3402
        $aFont = array(
3403
            'font' => $this->fontePadrao,
3404
            'size' => 6,
3405
            'style' => 'B');
3406
        $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...
3407
        $x += 50;
3408
        $texto = 'PARTICIPAÇÃO OUTRA FERROVIA';
3409
        $aFont = array(
3410
            'font' => $this->fontePadrao,
3411
            'size' => 6,
3412
            'style' => '');
3413
        $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...
3414
        $texto = '';
3415
        $aFont = array(
3416
            'font' => $this->fontePadrao,
3417
            'size' => 6,
3418
            'style' => 'B');
3419
        $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...
3420
    }
3421
3422
    /**
3423
     * canhoto
3424
     * Monta o campo com os dados do remetente na DACTE.
3425
     *
3426
     * @param number $x Posição horizontal canto esquerdo
3427
     * @param number $y Posição vertical canto superior
3428
     * @return number Posição vertical final
3429
     */
3430
    protected function canhoto($x = 0, $y = 0)
3431
    {
3432
        $oldX = $x;
3433
        $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...
3434
        if ($this->orientacao == 'P') {
3435
            $maxW = $this->wPrint;
3436
        } else {
3437
            $maxW = $this->wPrint - $this->wCanhoto;
3438
        }
3439
        $w = $maxW - 1;
3440
        $h = 20;
3441
        $y = $y + 1;
3442
        $texto = 'DECLARO QUE RECEBI OS VOLUMES DESTE CONHECIMENTO EM PERFEITO ESTADO ';
3443
        $texto .= 'PELO QUE DOU POR CUMPRIDO O PRESENTE CONTRATO DE TRANSPORTE';
3444
        $aFont = $this->formatPadrao;
3445
        $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...
3446
        $y += 3.4;
3447
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAICO DO TEXTO DECLARO QUE RECEBI...
3448
        $texto = 'NOME';
3449
        $aFont = array(
3450
            'font' => $this->fontePadrao,
3451
            'size' => 6,
3452
            'style' => '');
3453
        $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...
3454
        $x += $w * 0.25;
3455
        $this->pdf->line($x, $y, $x, $y + 16.5);
3456
        $texto = 'ASSINATURA / CARIMBO';
3457
        $aFont = array(
3458
            'font' => $this->fontePadrao,
3459
            'size' => 6,
3460
            'style' => '');
3461
        $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...
3462
        $x += $w * 0.25;
3463
        $this->pdf->line($x, $y, $x, $y + 16.5);
3464
        $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n";
3465
        $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA';
3466
        $aFont = array(
3467
            'font' => $this->fontePadrao,
3468
            'size' => 6,
3469
            'style' => '');
3470
        $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...
3471
        $x = $oldX;
3472
        $y = $y + 5;
3473
        $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME
3474
        $texto = 'RG';
3475
        $aFont = array(
3476
            'font' => $this->fontePadrao,
3477
            'size' => 6,
3478
            'style' => '');
3479
        $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...
3480
        $x += $w * 0.85;
3481
        $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E
3482
        $texto = "CT-E";
3483
        $aFont = $this->formatNegrito;
3484
        $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...
3485
        $texto = "\r\n Nº. DOCUMENTO  " . $this->getTagValue($this->ide, "nCT") . " \n";
3486
        $texto .= "\r\n SÉRIE  " . $this->getTagValue($this->ide, "serie");
3487
        $aFont = array(
3488
            'font' => $this->fontePadrao,
3489
            'size' => 6,
3490
            'style' => '');
3491
        $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...
3492
        $x = $oldX;
3493
        $this->pdf->dashedHLine($x, $y + 12.7, $this->wPrint, 0.1, 80);
3494
    }
3495
3496
    /**
3497
     * dadosAdic
3498
     * Coloca o grupo de dados adicionais da DACTE.
3499
     *
3500
     * @param number $x Posição horizontal canto esquerdo
3501
     * @param number $y Posição vertical canto superior
3502
     * @param number $h altura do campo
3503
     * @return number Posição vertical final
3504
     */
3505
    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...
3506
    {
3507
        $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...
3508
        //###########################################################################
3509
        //DADOS ADICIONAIS DACTE
3510
        if ($this->orientacao == 'P') {
3511
            $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...
3512
        } else {
3513
            $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...
3514
        }
3515
        //INFORMAÇÕES COMPLEMENTARES
3516
        $texto = "USO EXCLUSIVO DO EMISSOR DO CT-E";
3517
        $y += 3;
3518
        $w = $this->wAdic;
3519
        $h = 8; //mudar
3520
        $aFont = array(
3521
            'font' => $this->fontePadrao,
3522
            'size' => 6,
3523
            'style' => '');
3524
        $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...
3525
        //$this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3526
        $this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
3527
        //o texto com os dados adicionais foi obtido na função xxxxxx
3528
        //e carregado em uma propriedade privada da classe
3529
        //$this->wAdic com a largura do campo
3530
        //$this->textoAdic com o texto completo do campo
3531
        $y += 1;
3532
        $aFont = $this->formatPadrao;
3533
        $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...
3534
        //RESERVADO AO FISCO
3535
        $texto = "RESERVADO AO FISCO";
3536
        $x += $w;
3537
        $y -= 1;
3538
        if ($this->orientacao == 'P') {
3539
            $w = $this->wPrint - $w;
3540
        } else {
3541
            $w = $this->wPrint - $w - $this->wCanhoto;
3542
        }
3543
        $aFont = array(
3544
            'font' => $this->fontePadrao,
3545
            'size' => 6,
3546
            'style' => '');
3547
        $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...
3548
        //inserir texto informando caso de contingência
3549
        //1 – Normal – emissão normal;
3550
        //2 – Contingência FS – emissão em contingência com impressão do DACTE em Formulário de Segurança;
3551
        //3 – Contingência SCAN – emissão em contingência  – SCAN;
3552
        //4 – Contingência DPEC - emissão em contingência com envio da Declaração Prévia de
3553
        //Emissão em Contingência – DPEC;
3554
        //5 – Contingência FS-DA - emissão em contingência com impressão do DACTE em Formulário de
3555
        //Segurança para Impressão de Documento Auxiliar de Documento Fiscal Eletrônico (FS-DA).
3556
        $xJust = $this->getTagValue($this->ide, 'xJust', 'Justificativa: ');
3557
        $dhCont = $this->getTagValue($this->ide, 'dhCont', ' Entrada em contingência : ');
3558
        $texto = '';
3559
        switch ($this->tpEmis) {
3560
            case 2:
3561
                $texto = 'CONTINGÊNCIA FS' . $dhCont . $xJust;
3562
                break;
3563
            case 3:
3564
                $texto = 'CONTINGÊNCIA SCAN' . $dhCont . $xJust;
3565
                break;
3566
            case 4:
3567
                $texto = 'CONTINGÊNCIA DPEC' . $dhCont . $xJust;
3568
                break;
3569
            case 5:
3570
                $texto = 'CONTINGÊNCIA FSDA' . $dhCont . $xJust;
3571
                break;
3572
        }
3573
        $y += 2;
3574
        $aFont = $this->formatPadrao;
3575
        $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...
3576
        return $y + $h;
3577
    }
3578
3579
    /**
3580
     * formatCNPJCPF
3581
     * Formata campo CnpjCpf contida na CTe
3582
     *
3583
     * @param string $field campo cnpjCpf da CT-e
3584
     * @return string
3585
     */
3586
    protected function formatCNPJCPF($field)
3587
    {
3588
        if (!isset($field)) {
3589
            return '';
3590
        }
3591
        $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...
3592
            $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...
3593
        if ($cnpj != "" && $cnpj != "00000000000000") {
3594
            $cnpj = $this->formatField($cnpj, '###.###.###/####-##');
3595
        } else {
3596
            $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...
3597
                $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...
3598
        }
3599
        return $cnpj;
3600
    }
3601
3602
    /**
3603
     * formatFone
3604
     * Formata campo fone contida na CTe
3605
     *
3606
     * @param string $field campo fone da CT-e
3607
     * @return string
3608
     */
3609
    protected function formatFone($field)
3610
    {
3611
        try {
3612
            $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...
3613
                $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...
3614
            $foneLen = strlen($fone);
3615
            if ($foneLen > 0) {
3616
                $fone2 = substr($fone, 0, $foneLen - 4);
3617
                $fone1 = substr($fone, 0, $foneLen - 8);
3618
                $fone = '(' . $fone1 . ') ' . substr($fone2, -4) . '-' . substr($fone, -4);
3619
            } else {
3620
                $fone = '';
3621
            }
3622
            return $fone;
3623
        } catch (Exception $exc) {
3624
            return '';
3625
        }
3626
    }
3627
3628
    /**
3629
     * unidade
3630
     * Converte a imformação de peso contida na CTe
3631
     *
3632
     * @param string $c unidade de trafego extraida da CTe
3633
     * @return string
3634
     */
3635
    protected function unidade($c = '')
3636
    {
3637
        switch ($c) {
3638
            case '00':
3639
                $r = 'M3';
3640
                break;
3641
            case '01':
3642
                $r = 'KG';
3643
                break;
3644
            case '02':
3645
                $r = 'TON';
3646
                break;
3647
            case '03':
3648
                $r = 'UN';
3649
                break;
3650
            case '04':
3651
                $r = 'LT';
3652
                break;
3653
            case '05':
3654
                $r = 'MMBTU';
3655
                break;
3656
            default:
3657
                $r = '';
3658
        }
3659
        return $r;
3660
    }
3661
3662
    /**
3663
     * convertUnidTrafego
3664
     * Converte a imformação de peso contida na CTe
3665
     *
3666
     * @param string $U Informação de trafego extraida da CTe
3667
     * @return string
3668
     */
3669
    protected function convertUnidTrafego($U = '')
3670
    {
3671
        if ($U) {
3672
            switch ($U) {
3673
                case '0':
3674
                    $stringU = 'Próprio';
3675
                    break;
3676
                case '1':
3677
                    $stringU = 'Mútuo';
3678
                    break;
3679
                case '2':
3680
                    $stringU = 'Rodoferroviário';
3681
                    break;
3682
                case '3':
3683
                    $stringU = 'Rodoviário';
3684
                    break;
3685
            }
3686
            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...
3687
        }
3688
    }
3689
3690
    /**
3691
     * multiUniPeso
3692
     * Fornece a imformação multiplicação de peso contida na CTe
3693
     *
3694
     * @param interger $U Informação de peso extraida da CTe
3695
     * @return interger
3696
     */
3697
    protected function multiUniPeso($U = '')
3698
    {
3699
        if ($U === "01") {
3700
            // tonelada
3701
            //return 1000;
3702
            return 1;
3703
        }
3704
        return 1; // M3, KG, Unidade, litros, mmbtu
3705
    }
3706
3707
    protected function qrCodeDacte($y = 0)
3708
    {
3709
        $margemInterna = $this->margemInterna;
3710
        $barcode = new Barcode();
3711
        $bobj = $barcode->getBarcodeObj(
3712
            'QRCODE,M',
3713
            $this->qrCodCTe,
3714
            -4,
3715
            -4,
3716
            'black',
3717
            array(-2, -2, -2, -2)
3718
        )->setBackgroundColor('white');
3719
        $qrcode = $bobj->getPngData();
3720
        $wQr = 36;
3721
        $hQr = 36;
3722
        $yQr = ($y + $margemInterna);
3723
        if ($this->orientacao == 'P') {
3724
            $xQr = 170;
3725
        } else {
3726
            $xQr = 250;
3727
        }
3728
        // prepare a base64 encoded "data url"
3729
        $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
3730
        $this->pdf->image($pic, $xQr - 3, $yQr, $wQr, $hQr, 'PNG');
3731
    }
3732
}
3733