Passed
Pull Request — master (#335)
by Roberto
06:25
created

DacteOS::docCompl()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 54

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 2
dl 0
loc 54
ccs 0
cts 54
cp 0
crap 12
rs 9.0036
c 0
b 0
f 0

How to fix   Long Method   

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 DacteOS extends DaCommon
25
{
26
    protected $yDados = 0;
27
    protected $xml;
28
    protected $errMsg = '';
29
    protected $errStatus = false;
30
31
    protected $dom;
32
    protected $infCte;
33
    protected $infPercurso;
34
    protected $infCteComp;
35
    protected $chaveCTeRef;
36
    protected $tpCTe;
37
    protected $ide;
38
    protected $emit;
39
    protected $enderEmit;
40
    protected $infCarga;
41
    protected $infQ;
42
    protected $seg;
43
    protected $modal;
44
    protected $rodo;
45
    protected $moto;
46
    protected $veic;
47
    protected $ferrov;
48
    protected $Comp;
49
    protected $infNF;
50
    protected $infNFe;
51
    protected $compl;
52
    protected $ICMS;
53
    protected $imp;
54
    protected $toma4;
55
    protected $toma03;
56
    protected $tpEmis;
57
    protected $tpImp;
58
    protected $tpAmb;
59
    protected $vPrest;
60
    protected $infServico;
61
    protected $aquav;
62
    
63
    protected $wAdic = 150;
64
    protected $textoAdic = '';
65
    protected $formatPadrao;
66
    protected $formatNegrito;
67
    
68
    protected $preVisualizar;
69
    protected $flagDocOrigContinuacao;
70
    protected $arrayNFe = array();
71
    protected $siteDesenvolvedor;
72
    protected $nomeDesenvolvedor;
73
    protected $totPag;
74
    protected $idDocAntEle = [];
75
    protected $lota;
76
    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
77
    protected $margemInterna = 0;
78
79
    /**
80
     * __construct
81
     *
82
     * @param string $xml Arquivo XML da CTeOS
83
     */
84
    public function __construct(
85
        $xml
86
    ) {
87
        $this->loadDoc($xml);
88
    }
89
90
    private function loadDoc($xml)
91
    {
92
        $this->xml = $xml;
93
        if (!empty($xml)) {
94
            $this->dom = new Dom();
95
            $this->dom->loadXML($this->xml);
96
            $this->cteProc = $this->dom->getElementsByTagName("cteOSProc")->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...
97
            if (empty($this->dom->getElementsByTagName("infCte")->item(0))) {
98
                throw new \Exception('Isso não é um CT-e.');
99
            }
100
            $this->infCte = $this->dom->getElementsByTagName("infCte")->item(0);
101
            $this->ide = $this->dom->getElementsByTagName("ide")->item(0);
102
            if ($this->getTagValue($this->ide, "mod") != '67') {
103
                throw new \Exception("O xml deve ser CT-e modelo 67.");
104
            }
105
            $this->emit = $this->dom->getElementsByTagName("emit")->item(0);
106
            $this->enderEmit = $this->dom->getElementsByTagName("enderEmit")->item(0);
107
            $this->infPercurso = $this->dom->getElementsByTagName("infPercurso");
108
            $this->infCarga = $this->dom->getElementsByTagName("infCarga")->item(0);
109
            $this->infQ = $this->dom->getElementsByTagName("infQ");
110
            $this->seg = $this->dom->getElementsByTagName("seg")->item(0);
111
            $this->rodo = $this->dom->getElementsByTagName("rodoOS")->item(0);
112
            $this->veic = $this->dom->getElementsByTagName("veic");
113
            $this->ferrov = $this->dom->getElementsByTagName("ferrov")->item(0);
114
            // adicionar outros modais
115
            $this->infCteComp = $this->dom->getElementsByTagName("infCteComp")->item(0);
116
            $this->chaveCTeRef = $this->getTagValue($this->infCteComp, "chave");
117
            $this->vPrest = $this->dom->getElementsByTagName("vPrest")->item(0);
118
            $this->Comp = $this->dom->getElementsByTagName("Comp");
119
            $this->infNF = $this->dom->getElementsByTagName("infNF");
120
            $this->infNFe = $this->dom->getElementsByTagName("infNFe");
121
            $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...
122
            $this->infServico = $this->dom->getElementsByTagName("infServico");
123
            $this->compl = $this->dom->getElementsByTagName("compl");
124
            $this->ICMS = $this->dom->getElementsByTagName("ICMS")->item(0);
125
            $this->ICMSSN = $this->dom->getElementsByTagName("ICMSSN")->item(0);
0 ignored issues
show
Bug introduced by
The property ICMSSN 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...
126
            $this->imp = $this->dom->getElementsByTagName("imp")->item(0);
127
128
            $vTrib = $this->getTagValue($this->imp, "vTotTrib");
129
            if (!is_numeric($vTrib)) {
130
                $vTrib = 0;
131
            }
132
            $textoAdic = number_format($vTrib, 2, ",", ".");
133
            $this->textoAdic = "o valor aproximado de tributos incidentes sobre o preço deste serviço é de R$"
134
                .$textoAdic;
135
            $this->toma = $this->dom->getElementsByTagName("toma")->item(0);
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...
136
            $this->enderToma = $this->getTagValue($this->toma, "enderToma");
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...
137
            //modal aquaviário
138
            $this->aquav = $this->dom->getElementsByTagName("aquav")->item(0);
139
            $seguro = $this->getTagValue($this->seg, "respSeg");
140
            switch ($seguro) {
141
                case '4':
142
                    $this->respSeg = 'Emitente';
0 ignored issues
show
Bug introduced by
The property respSeg 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...
143
                    break;
144
                case '5':
145
                    $this->respSeg = 'Tomador do Serviço';
146
                    break;
147
                default:
148
                    $this->respSeg = '';
149
                    break;
150
            }
151
            $this->tpEmis = $this->getTagValue($this->ide, "tpEmis");
152
            $this->tpImp = $this->getTagValue($this->ide, "tpImp");
153
            $this->tpAmb = $this->getTagValue($this->ide, "tpAmb");
154
            $this->tpCTe = $this->getTagValue($this->ide, "tpCTe");
155
            $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...
156
            $this->qrCodMDFe = $this->dom->getElementsByTagName('qrCodCTe')->item(0) ?
0 ignored issues
show
Bug introduced by
The property qrCodMDFe 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...
157
                $this->dom->getElementsByTagName('qrCodCTe')->item(0)->nodeValue : 'SEM INFORMAÇÃO DE QRCODE';
158
            //01-Rodoviário; //02-Aéreo; //03-Aquaviário; //04-Ferroviário;//05-Dutoviário
159
            $this->modal = $this->getTagValue($this->ide, "modal");
160
        }
161
    }
162
163
    /**
164
     * montaDACTE
165
     * Esta função monta a DACTE conforme as informações fornecidas para a classe
166
     * durante sua construção.
167
     * A definição de margens e posições iniciais para a impressão são estabelecidas no
168
     * pelo conteúdo da funçao e podem ser modificados.
169
     *
170
     * @param  string $logo
171
     * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
172
     */
173
    protected function monta(
174
        $logo = ''
175
    ) {
176
        $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...
177
        if (!empty($logo)) {
178
            $this->logomarca = $this->adjustImage($logo);
179
        }
180
        //se a orientação estiver em branco utilizar o padrão estabelecido na NF
181
        if ($this->orientacao == '') {
182
            if ($this->tpImp == '1') {
183
                $this->orientacao = 'P';
184
            } else {
185
                $this->orientacao = 'P';
186
            }
187
        }
188
        //instancia a classe pdf
189
        $margSup = $this->margsup;
190
        $margEsq = $this->margesq;
191
        $margDir = $this->margesq;
192
        
193
        $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...
194
        $this->formatPadrao = array(
195
            'font' => $this->fontePadrao,
196
            'size' => 6,
197
            'style' => '');
198
        $this->formatNegrito = array(
199
            'font' => $this->fontePadrao,
200
            'size' => 7,
201
            'style' => 'B');
202
        if ($this->orientacao == 'P') {
203
            // posição inicial do relatorio
204
            $xInic = 1;
205
            $yInic = 1;
206
            if ($this->papel == 'A4') {
207
                //A4 210x297mm
208
                $maxW = 210;
209
                $maxH = 297;
210
            }
211
        } else {
212
            // posição inicial do relatorio
213
            $xInic = 5;
214
            $yInic = 5;
215
            if ($this->papel == 'A4') {
216
                //A4 210x297mm
217
                $maxH = 210;
218
                $maxW = 297;
219
                $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...
220
            }
221
        }
222
        //total inicial de paginas
223
        $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...
224
        //largura imprimivel em mm
225
        $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...
226
        //comprimento imprimivel em mm
227
        $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...
228
        // estabelece contagem de paginas
229
        $this->pdf->aliasNbPages();
230
        // fixa as margens
231
        $this->pdf->setMargins($margEsq, $margSup, $margDir);
232
        $this->pdf->setDrawColor(0, 0, 0);
233
        $this->pdf->setFillColor(255, 255, 255);
234
        // inicia o documento
235
        $this->pdf->open();
236
        // adiciona a primeira página
237
        $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...
238
        $this->pdf->setLineWidth(0.1);
239
        $this->pdf->setTextColor(0, 0, 0);
240
        //calculo do numero de páginas ???
241
        $totPag = 1;
242
        //montagem da primeira página
243
        $pag = 1;
244
        $x = $xInic;
245
        $y = $yInic;
246
        //coloca o cabeçalho
247
        //$r = $this->cabecalho($x, $y, $pag, $totPag);
248
        $y += 70;
249
        $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...
250
        if ($this->tpCTe == '0') {
251
            //Normal
252
            $y += 10;
253
            $x = $xInic;
254
            //$r = $this->zDocOrig($x, $y);
255
            $r = $this->infPrestacaoServico($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...
256
            $y += 53;
257
            $x = $xInic;
258
            $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...
259
            $y += 25;
260
            $x = $xInic;
261
            $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...
262
            $y += 13;
263
            $x = $xInic;
264
            $r = $this->observacoes($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...
265
            $y += 19;
266
            $x = $xInic;
267
            $r = $this->seguro($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...
268
            $y = $y-12;
269
            switch ($this->modal) {
270
                case '1':
271
                    $y += 24.9;
272
                    $x = $xInic;
273
                    $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...
274
                    break;
275
                case '2':
276
                    $y += 17.9;
277
                    $x = $xInic;
278
                    // TODO fmertins 31/10/14: este método não existe...
279
                    $r = $this->modalAereo($x, $y);
0 ignored issues
show
Bug introduced by
The method modalAereo() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
280
                    break;
281
                case '3':
282
                    $y += 17.9;
283
                    $x = $xInic;
284
                    $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...
285
                    break;
286
                case '4':
287
                    $y += 17.9;
288
                    $x = $xInic;
289
                    $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...
290
                    break;
291
                case '5':
292
                    $y += 17.9;
293
                    $x = $xInic;
294
                    // TODO fmertins 31/10/14: este método não existe...
295
                    $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\DacteOS>.

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...
296
                    break;
297
            }
298
            if ($this->modal == '1') {
299
                if ($this->lota == 1) {
300
                    $y += 37;
301
                } else {
302
                    $y += 8.9;
303
                }
304
            } elseif ($this->modal == '3') {
305
                $y += 24.15;
306
            } else {
307
                $y += 37;
308
            }
309
        } else {
310
            $r = $this->cabecalho(1, 1, $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...
311
            //Complementado
312
            $y += 10;
313
            $x = $xInic;
314
            $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...
315
            $y += 80;
316
            $x = $xInic;
317
            $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...
318
            $y += 25;
319
            $x = $xInic;
320
            $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...
321
            $y += 13;
322
            $x = $xInic;
323
            $r = $this->observacoes($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...
324
            $y += 15;
325
        }
326
        $x = $xInic;
327
        $y += 1;
328
        $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...
329
330
        $y += 21;
331
        //$y += 11;
332
        $y = $this->canhoto($x, $y);
0 ignored issues
show
Unused Code introduced by
$y 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...
333
334
        //coloca o rodapé da página
335
        if ($this->orientacao == 'P') {
336
            $this->rodape(2, $this->hPrint - 2);
337
        } else {
338
            $this->rodape($xInic, $this->hPrint + 2.3);
339
        }
340
        if ($this->flagDocOrigContinuacao == 1) {
341
            $this->docOrigContinuacao(1, 71);
0 ignored issues
show
Bug introduced by
The method docOrigContinuacao() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
342
        }
343
    }
344
345
    /**
346
     * cabecalho
347
     * Monta o cabelhalho da DACTE ( retrato e paisagem )
348
     *
349
     * @param  number $x Posição horizontal inicial, canto esquerdo
350
     * @param  number $y Posição vertical inicial, canto superior
351
     * @param  number $pag Número da Página
352
     * @param  number $totPag Total de páginas
353
     * @return number Posição vertical final
354
     */
355
    protected function cabecalho($x = 0, $y = 0, $pag = '1', $totPag = '1')
0 ignored issues
show
Unused Code introduced by
The parameter $totPag 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...
356
    {
357
        $oldX = $x;
358
        $oldY = $y;
359
        if ($this->orientacao == 'P') {
360
            $maxW = $this->wPrint;
361
        } else {
362
            if ($pag == 1) {
363
                // primeira página
364
                $maxW = $this->wPrint - $this->wCanhoto;
365
            } else {
366
                // páginas seguintes
367
                $maxW = $this->wPrint;
368
            }
369
        }
370
        //##################################################################
371
        //coluna esquerda identificação do emitente
372
        $w = round($maxW * 0.42);
373
        if ($this->orientacao == 'P') {
374
            $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...
375
                'font' => $this->fontePadrao,
376
                'size' => 6,
377
                'style' => '');
378
        } else {
379
            $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...
380
        }
381
        $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...
382
        $h = 35;
383
        $oldY += $h;
384
        //desenha a caixa
385
        $this->pdf->textBox($x, $y, $w + 2, $h + 1);
386
        // coloca o logo
387
        if (!empty($this->logomarca)) {
388
            $logoInfo = getimagesize($this->logomarca);
389
            //largura da imagem em mm
390
            $logoWmm = ($logoInfo[0] / 72) * 25.4;
391
            //altura da imagem em mm
392
            $logoHmm = ($logoInfo[1] / 72) * 25.4;
393
            if ($this->logoAlign == 'L') {
394
                $nImgW = round($w / 3, 0);
395
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
396
                $xImg = $x + 1;
397
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
398
                //estabelecer posições do texto
399
                $x1 = round($xImg + $nImgW + 1, 0);
400
                $y1 = round($h / 3 + $y, 0);
401
                $tw = round(2 * $w / 3, 0);
402
            } elseif ($this->logoAlign == 'C') {
403
                $nImgH = round($h / 3, 0);
404
                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
405
                $xImg = round(($w - $nImgW) / 2 + $x, 0);
406
                $yImg = $y + 3;
407
                $x1 = $x;
408
                $y1 = round($yImg + $nImgH + 1, 0);
409
                $tw = $w;
410
            } elseif ($this->logoAlign == 'R') {
411
                $nImgW = round($w / 3, 0);
412
                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
413
                $xImg = round($x + ($w - (1 + $nImgW)), 0);
414
                $yImg = round(($h - $nImgH) / 2, 0) + $y;
415
                $x1 = $x;
416
                $y1 = round($h / 3 + $y, 0);
417
                $tw = round(2 * $w / 3, 0);
418
            }
419
            $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...
420
        } else {
421
            $x1 = $x;
422
            $y1 = round($h / 3 + $y, 0);
423
            $tw = $w;
424
        }
425
        //Nome emitente
426
        $aFont = array(
427
            'font' => $this->fontePadrao,
428
            'size' => 9,
429
            'style' => 'B');
430
        $texto = $this->getTagValue($this->emit, "xNome");
431
        $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...
432
        //endereço
433
        $y1 = $y1 + 3;
434
        $aFont = array(
435
            'font' => $this->fontePadrao,
436
            'size' => 7,
437
            'style' => '');
438
        $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...
439
        $lgr = $this->getTagValue($this->enderEmit, "xLgr");
440
        $nro = $this->getTagValue($this->enderEmit, "nro");
441
        $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...
442
        $bairro = $this->getTagValue($this->enderEmit, "xBairro");
443
        $CEP = $this->getTagValue($this->enderEmit, "CEP");
444
        $CEP = $this->formatField($CEP, "#####-###");
445
        $mun = $this->getTagValue($this->enderEmit, "xMun");
446
        $UF = $this->getTagValue($this->enderEmit, "UF");
447
        $xPais = $this->getTagValue($this->enderEmit, "xPais");
448
        $texto = $lgr . "," . $nro . "\n" . $bairro . " - "
449
            . $CEP . " - " . $mun . " - " . $UF . " " . $xPais
450
            . "\n  Fone/Fax: " . $fone;
451
        $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...
452
        //CNPJ/CPF IE
453
        $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...
454
        $ie = $this->getTagValue($this->emit, "IE");
455
        $texto = 'CNPJ/CPF:  ' . $cpfCnpj . '     Insc.Estadual: ' . $ie;
456
        $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...
457
        //outra caixa
458
        $h1 = 17.5;
459
        $y1 = $y + $h + 1;
460
        $this->pdf->textBox($x, $y1, $w + 2, $h1);
461
        //TIPO DO CT-E
462
        $texto = 'TIPO DO CTE';
463
        $wa = 37;
464
        $aFont = array(
465
            'font' => $this->fontePadrao,
466
            'size' => 8,
467
            'style' => '');
468
        $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...
469
        $tpCTe = $this->getTagValue($this->ide, "tpCTe");
470
        //0 - CT-e Normal,1 - CT-e de Complemento de Valores,
471
        //2 - CT-e de Anulação de Valores,3 - CT-e Substituto
472
        switch ($tpCTe) {
473
            case '0':
474
                $texto = 'Normal';
475
                break;
476
            case '1':
477
                $texto = 'Complemento de Valores';
478
                break;
479
            case '2':
480
                $texto = 'Anulação de Valores';
481
                break;
482
            case '3':
483
                $texto = 'Substituto';
484
                break;
485
            default:
486
                $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...
487
        }
488
        $aFont = $this->formatNegrito;
489
        $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...
490
        //TIPO DO SERVIÇO
491
        $texto = 'TIPO DO SERVIÇO';
492
        $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...
493
        $aFont = array(
494
            'font' => $this->fontePadrao,
495
            'size' => 8,
496
            'style' => '');
497
        $this->pdf->textBox($x + $wa + 4.5, $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...
498
        $tpServ = $this->getTagValue($this->ide, "tpServ");
499
        //'6' => 'Transporte de Pessoas', '7' => 'Transporte de Valores', '8' => 'Transporte de Bagagem'
500
        switch ($tpServ) {
501
            case '6':
502
                $texto = 'Transporte de Pessoas';
503
                break;
504
            case '7':
505
                $texto = 'Transporte de Valores';
506
                break;
507
            case '8':
508
                $texto = 'Transporte de Bagagem';
509
                break;
510
            default:
511
                $texto = 'ERRO' . $tpServ;
512
        }
513
        $aFont = $this->formatNegrito;
514
        $this->pdf->textBox($x + $wa + 4.5, $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...
515
        $this->pdf->line($w * 0.5, $y1, $w * 0.5, $y1 + $h1);
516
        //TOMADOR DO SERVIÇO
517
        $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...
518
519
        //##################################################################
520
        //coluna direita
521
        $x += $w + 2;
522
        $w = round($maxW * 0.335);
523
        $w1 = $w;
524
        $h = 11;
525
        $this->pdf->textBox($x, $y, $w + 10, $h + 1);
526
        $texto = "DACTE OS";
527
        $aFont = array(
528
            'font' => $this->fontePadrao,
529
            'size' => 10,
530
            'style' => 'B');
531
        $this->pdf->textBox($x, $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...
532
        $aFont = array(
533
            'font' => $this->fontePadrao,
534
            'size' => 9,
535
            'style' => '');
536
        $texto = "Documento Auxiliar do Conhecimento\nde Transporte Eletrônico para Outros Serviços";
537
        $h = 10;
538
        $this->pdf->textBox($x, $y + 4, $w, $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...
539
        $x1 = $x + $w + 2;
540
        $w = round($maxW * 0.22, 0);
541
        $w2 = $w;
0 ignored issues
show
Unused Code introduced by
$w2 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...
542
        $h = 11;
543
        $this->pdf->textBox($x1 + 8, $y, $w - 7.5, $h + 1);
544
        $texto = "MODAL";
545
        $aFont = array(
546
            'font' => $this->fontePadrao,
547
            'size' => 10,
548
            'style' => '');
549
        $this->pdf->textBox($x1, $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...
550
        switch ($this->modal) {
551
            case '1':
552
                $texto = 'Rodoviário';
553
                break;
554
            case '2':
555
                $texto = 'Aéreo';
556
                break;
557
            case '3':
558
                $texto = 'Aquaviário';
559
                break;
560
            case '4':
561
                $texto = 'Ferroviário';
562
                break;
563
            case '5':
564
                $texto = 'Dutoviário';
565
                break;
566
        }
567
        $aFont = array(
568
            'font' => $this->fontePadrao,
569
            'size' => 10,
570
            'style' => 'B');
571
        $this->pdf->textBox($x1, $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...
572
        //outra caixa
573
        $y += 12;
574
        $h = 9;
575
        $w = $w1 + 10;
576
        $this->pdf->textBox($x, $y, $w, $h + 1);
577
        //modelo
578
        $wa = 12;
579
        $xa = $x;
580
        $texto = 'MODELO';
581
        $aFont = array(
582
            'font' => $this->fontePadrao,
583
            'size' => 8,
584
            'style' => '');
585
        $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...
586
        $texto = $this->getTagValue($this->ide, "mod");
587
        $aFont = $this->formatNegrito;
588
        $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...
589
        $this->pdf->line($x + $wa, $y, $x + $wa, $y + $h + 1);
590
        //serie
591
        $xa += $wa;
592
        $texto = 'SÉRIE';
593
        $aFont = array(
594
            'font' => $this->fontePadrao,
595
            'size' => 8,
596
            'style' => '');
597
        $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...
598
        $texto = $this->getTagValue($this->ide, "serie");
599
        $aFont = $this->formatNegrito;
600
        $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...
601
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
602
        //numero
603
        $xa += $wa;
604
        $wa = 20;
605
        $texto = 'NÚMERO';
606
        $aFont = array(
607
            'font' => $this->fontePadrao,
608
            'size' => 8,
609
            'style' => '');
610
        $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...
611
        $texto = $this->getTagValue($this->ide, "nCT");
612
        $aFont = $this->formatNegrito;
613
        $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...
614
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
615
        //data  hora de emissão
616
        $xa += $wa;
617
        $wa = 35;
618
        $texto = 'DATA E HORA DE EMISSÃO';
619
        $aFont = array(
620
            'font' => $this->fontePadrao,
621
            'size' => 8,
622
            'style' => '');
623
        $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...
624
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
625
        $texto = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
626
            date('d/m/Y H:i:s', $this->toTimestamp($this->getTagValue($this->ide, "dhEmi"))) : '';
627
        $aFont = $this->formatNegrito;
628
        $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...
629
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1);
630
        //outra caixa
631
        $y += $h + 1;
632
        $h = 23;
633
        $h1 = 14;
634
        //$this->pdf->textBox($x, $y, $w + 0.5, $h1);
635
        //CODIGO DE BARRAS
636
        $chave_acesso = str_replace('CTe', '', $this->infCte->getAttribute("Id"));
637
        $bW = 75;
638
        $bH = 10;
639
        //codigo de barras
640
        $this->pdf->setFillColor(0, 0, 0);
641
        $this->pdf->code128($x + 2, $y + 2, $chave_acesso, $bW, $bH);
642
        $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h - 1);
643
        $this->pdf->textBox($x, $y + $h1, $w + 0.5, $h1 - 6);
644
        $texto = 'CHAVE DE ACESSO';
645
        $aFont = $this->formatPadrao;
646
        $this->pdf->textBox($x + 1, $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...
647
        $aFont = $this->formatNegrito;
648
        $texto = $this->formatField($chave_acesso, $this->formatoChave);
649
        $this->pdf->textBox($x + 1, $y + $h1 + 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...
650
        $this->pdf->textBox($x, $y + $h1 + 8, $w + 0.5, $h1 - 4.5);
651
        $texto = "Consulta de autenticidade no portal nacional do CT-e, ";
652
        $texto .= "no site da Sefaz Autorizadora, \r\n ou em http://www.cte.fazenda.gov.br";
653
        if ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
654
            $texto = "";
655
            $this->pdf->setFillColor(0, 0, 0);
656
            if ($this->tpEmis == 5) {
657
                $chaveContingencia = $this->geraChaveAdicCont();
658
                $this->pdf->code128($x + 20, $y1 + 10, $chaveContingencia, $bW * .9, $bH / 2);
659
            } else {
660
                $chaveContingencia = $this->getTagValue($this->protCTe, "nProt");
661
                $this->pdf->code128($x + 40, $y1 + 10, $chaveContingencia, $bW * .4, $bH / 2);
662
            }
663
            //codigo de barras
664
        }
665
        $aFont = array(
666
            'font' => $this->fontePadrao,
667
            'size' => 8,
668
            'style' => '');
669
        $this->pdf->textBox($x, $y + $h1 + 9, $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...
670
        //outra caixa
671
        $y += $h + 1;
672
        $h = 8.5;
673
        $wa = $w;
674
        $this->pdf->textBox($x, $y + 7.5, $w + 0.5, $h);
675
        if (!empty($this->numdepec)) {
676
            $texto = 'NÚMERO DE REGISTRO DPEC';
677
        } elseif ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) {
678
            $texto = "DADOS DO CT-E";
679
        } else {
680
            $texto = 'PROTOCOLO DE AUTORIZAÇÃO DE USO';
681
        }
682
        $aFont = $this->formatPadrao;
683
        $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...
684
        if (!empty($this->numdepec)) {
685
            $texto = $this->numdepec;
686
        } elseif ($this->tpEmis == 5) {
687
            $chaveContingencia = $this->geraChaveAdicCont();
688
            $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...
689
                'font' => $this->fontePadrao,
690
                'size' => 8,
691
                'style' => 'B');
692
            $texto = $this->formatField($chaveContingencia, "#### #### #### #### #### #### #### #### ####");
693
            $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...
694
        } else {
695
            $texto = $this->getTagValue($this->protCTe, "nProt") . " - ";
696
            // empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue)
697
            if (!empty($this->protCTe)
698
                && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue)
699
            ) {
700
                $texto .= date(
701
                    'd/m/Y   H:i:s',
702
                    $this->toTimestamp($this->getTagValue($this->protCTe, "dhRecbto"))
703
                );
704
            }
705
            $texto = $this->getTagValue($this->protCTe, "nProt") == '' ? '' : $texto;
706
        }
707
        $aFont = $this->formatNegrito;
708
        $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...
709
710
        if ($this->qrCodMDFe !== null) {
711
            $this->qrCodeDacteOs($y-25);
712
            $w = 38;
713
            $x += 79;
714
            $this->pdf->textBox($x, $y - 34, $w + 0.5, $h + 41.5);
715
        }
716
        //CFOP
717
        $x = $oldX;
718
        $h = 8.5;
719
        $w = round($maxW * 0.42);
720
        $y1 = $y + 7.5;
721
        $this->pdf->textBox($x, $y1, $w + 2, $h);
722
        $texto = 'CFOP - NATUREZA DA PRESTAÇÃO';
723
        $aFont = array(
724
            'font' => $this->fontePadrao,
725
            'size' => 8,
726
            'style' => '');
727
        $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...
728
        $texto = $this->getTagValue($this->ide, "CFOP") . ' - ' . $this->getTagValue($this->ide, "natOp");
729
        $aFont = $this->formatNegrito;
730
        $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...
731
        //ORIGEM DA PRESTAÇÃO
732
        $y += $h + 7.5;
733
        $x = $oldX;
734
        $h = 8;
735
        $w = ($maxW * 0.33);
736
        $this->pdf->textBox($x, $y, $w + 0.5, $h);
737
        $texto = 'INÍCIO DA PRESTAÇÃO';
738
        $aFont = array(
739
            'font' => $this->fontePadrao,
740
            'size' => 8,
741
            'style' => '');
742
        $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...
743
        $texto = $this->getTagValue($this->ide, "xMunIni") . ' - ' . $this->getTagValue($this->ide, "UFIni");
744
        $aFont = $this->formatNegrito;
745
        $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...
746
        //PERCURSO DO VEÍCULO
747
        $x = $oldX + 69;
748
        $oldX = $x;
749
        $h = 8;
750
        $w = ($maxW * 0.334);
751
        $this->pdf->textBox($x, $y, $w + 0.5, $h);
752
        $texto = 'PERCURSO DO VEÍCULO';
753
        $aFont = array(
754
            'font' => $this->fontePadrao,
755
            'size' => 8,
756
            'style' => '');
757
        $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...
758
        $texto = '';
759
        $first = true;
760
        if (!empty($this->infPercurso)) {
761
            foreach ($this->infPercurso as $k => $d) {
762
                if (!$first) {
763
                    $texto .= ' - ';
764
                } else {
765
                    $first = false;
766
                }
767
                $texto .= $this->infPercurso->item($k)->getElementsByTagName('UFPer')->item(0)->nodeValue;
768
            }
769
        }
770
        $aFont = $this->formatNegrito;
771
        $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...
772
        //DESTINO DA PRESTAÇÃO
773
        $x = $oldX + $w + 1;
774
        $h = 8;
775
        $w = $w - 1.3;
776
        $this->pdf->textBox($x - 0.5, $y, $w + 0.5, $h);
777
        $texto = 'TÉRMINO DA PRESTAÇÃO';
778
        $aFont = array(
779
            'font' => $this->fontePadrao,
780
            'size' => 8,
781
            'style' => '');
782
        $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...
783
        $texto = $this->getTagValue($this->ide, "xMunFim") . ' - ' . $this->getTagValue($this->ide, "UFFim");
784
        $aFont = $this->formatNegrito;
785
        $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...
786
        //#########################################################################
787
        //Indicação de CTe Homologação, cancelamento e falta de protocolo
788
        $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue;
789
        //indicar cancelamento
790
        $cStat = $this->getTagValue($this->cteProc, "cStat");
791
        if ($cStat == '101' || $cStat == '135') {
792
            //101 Cancelamento
793
            $x = 10;
794
            $y = $this->hPrint - 130;
795
            $h = 25;
796
            $w = $maxW - (2 * $x);
797
            $this->pdf->setTextColor(90, 90, 90);
798
            $texto = "CTe CANCELADO";
799
            $aFont = array(
800
                'font' => $this->fontePadrao,
801
                'size' => 48,
802
                'style' => 'B');
803
            $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...
804
            $this->pdf->setTextColor(0, 0, 0);
805
        }
806
        $cStat = $this->getTagValue($this->cteProc, "cStat");
807
        if ($cStat == '110' ||
808
            $cStat == '301' ||
809
            $cStat == '302'
810
        ) {
811
            //110 Denegada
812
            $x = 10;
813
            $y = $this->hPrint - 130;
814
            $h = 25;
815
            $w = $maxW - (2 * $x);
816
            $this->pdf->setTextColor(90, 90, 90);
817
            $texto = "CTe USO DENEGADO";
818
            $aFont = array(
819
                'font' => $this->fontePadrao,
820
                'size' => 48,
821
                'style' => 'B');
822
            $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...
823
            $y += $h;
824
            $h = 5;
825
            $w = $maxW - (2 * $x);
826
            $texto = "SEM VALOR FISCAL";
827
            $aFont = array(
828
                'font' => $this->fontePadrao,
829
                'size' => 48,
830
                'style' => 'B');
831
            $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...
832
            $this->pdf->setTextColor(0, 0, 0);
833
        }
834
        //indicar sem valor
835
        if ($tpAmb != 1) { // caso não seja uma DA de produção
836
            $x = 10;
837
            if ($this->orientacao == 'P') {
838
                $y = round($this->hPrint / 2, 0);
839
            } else {
840
                $y = round($this->hPrint / 2, 0);
841
            }
842
            $h = 5;
843
            $w = $maxW - (2 * $x);
844
            $this->pdf->setTextColor(90, 90, 90);
845
            $texto = "SEM VALOR FISCAL";
846
            $aFont = array(
847
                'font' => $this->fontePadrao,
848
                'size' => 48,
849
                'style' => 'B');
850
            $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...
851
            $aFont = array(
852
                'font' => $this->fontePadrao,
853
                'size' => 30,
854
                'style' => 'B');
855
            $texto = "AMBIENTE DE HOMOLOGAÇÃO";
856
            $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...
857
            $this->pdf->setTextColor(0, 0, 0);
858
        } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização
859
            $h = 5;
860
            $w = $maxW - (2 * 10);
861
            $x = 55;
862
            $y = 240;
863
            $this->pdf->setTextColor(255, 100, 100);
864
            $aFont = array(
865
                'font' => $this->fontePadrao,
866
                'size' => 40,
867
                'style' => 'B');
868
            $texto = "Pré-visualização";
869
            $this->pdf->textBox90($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
870
            $this->pdf->setTextColor(255, 100, 100);
871
            $aFont = array(
872
                'font' => $this->fontePadrao,
873
                'size' => 41,
874
                'style' => 'B');
875
            $texto = "Sem Validade Jurídica";
876
            $this->pdf->textBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
877
            $this->pdf->setTextColor(90, 90, 90);
878
            $texto = "SEM VALOR FISCAL";
879
            $aFont = array(
880
                'font' => $this->fontePadrao,
881
                'size' => 48,
882
                'style' => 'B');
883
            $this->pdf->textBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
884
            $this->pdf->setTextColor(0, 0, 0); // voltar a cor default
885
        } else {
886
            $x = 10;
887
            if ($this->orientacao == 'P') {
888
                $y = round($this->hPrint * 2 / 3, 0);
889
            } else {
890
                $y = round($this->hPrint / 2, 0);
891
            } //fim orientacao
892
            $h = 5;
893
            $w = $maxW - (2 * $x);
894
            $this->pdf->setTextColor(90, 90, 90);
895
            //indicar FALTA DO PROTOCOLO se NFe não for em contingência
896
            if (($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) && !$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
897
                //Contingência
898
                $texto = "DACTE Emitido em Contingência";
899
                $aFont = array(
900
                    'font' => $this->fontePadrao,
901
                    'size' => 48,
902
                    'style' => 'B');
903
                $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...
904
                $aFont = array(
905
                    'font' => $this->fontePadrao,
906
                    'size' => 30,
907
                    'style' => 'B');
908
                $texto = "devido à problemas técnicos";
909
                $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...
910
            } else {
911
                if (!isset($this->protCTe)) {
912
                    if (!$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
913
                        $texto = "SEM VALOR FISCAL";
914
                        $aFont = array(
915
                            'font' => $this->fontePadrao,
916
                            'size' => 48,
917
                            'style' => 'B');
918
                        $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...
919
                    }
920
                    $aFont = array(
921
                        'font' => $this->fontePadrao,
922
                        'size' => 30,
923
                        'style' => 'B');
924
                    $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ";
925
                    if (!$this->cteDPEC()) {
0 ignored issues
show
Bug introduced by
The method cteDPEC() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
926
                        $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...
927
                    } else {
928
                        $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...
929
                    }
930
                } //fim cteProc
931
                if ($this->tpEmis == 4) {
932
                    //DPEC
933
                    $x = 10;
934
                    $y = $this->hPrint - 130;
935
                    $h = 25;
936
                    $w = $maxW - (2 * $x);
937
                    $this->pdf->setTextColor(200, 200, 200); // 90,90,90 é muito escuro
938
                    $texto = "DACTE impresso em contingência -\n"
939
                        . "DPEC regularmente recebido pela Receita\n"
940
                        . "Federal do Brasil";
941
                    $aFont = array(
942
                        'font' => $this->fontePadrao,
943
                        'size' => 48,
944
                        'style' => 'B');
945
                    $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...
946
                    $this->pdf->setTextColor(0, 0, 0);
947
                }
948
            } //fim tpEmis
949
            $this->pdf->setTextColor(0, 0, 0);
950
        }
951
        return $oldY;
952
    }
953
954
    /**
955
     * rodapeDACTE
956
     * Monta o rodape no final da DACTE ( retrato e paisagem )
957
     *
958
     * @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...
959
     * @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...
960
     */
961
    protected function rodape($x, $y)
962
    {
963
        $texto = "Impresso em  " . date('d/m/Y   H:i:s');
964
        $w = $this->wPrint - 4;
965
        $aFont = array(
966
            'font' => $this->fontePadrao,
967
            'size' => 6,
968
            'style' => '');
969
        $this->pdf->textBox($x-1, $y+2, $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...
970
971
        $texto = $this->creditos .  "  Powered by NFePHP®";
972
        $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'R', false, '');
973
    }
974
975
    /**
976
     * tomador
977
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
978
     *
979
     * @param  number $x Posição horizontal canto esquerdo
980
     * @param  number $y Posição vertical canto superior
981
     * @return number Posição vertical final
982
     */
983
    protected function tomador($x = 0, $y = 0)
984
    {
985
        $oldX = $x;
986
        $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...
987
        if ($this->orientacao == 'P') {
988
            $maxW = $this->wPrint;
989
        } else {
990
            $maxW = $this->wPrint - $this->wCanhoto;
991
        }
992
        $w = $maxW;
993
        $h = 10;
994
        $texto = 'TOMADOR DO SERVIÇO';
995
        $aFont = $this->formatPadrao;
996
        $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...
997
        $aFont = $this->formatNegrito;
998
        $texto = $this->getTagValue($this->toma, "xNome");
999
        $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...
1000
        $x = $maxW * 0.60;
1001
        $texto = 'MUNICÍPIO';
1002
        $aFont = $this->formatPadrao;
1003
        $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...
1004
        $texto = $this->getTagValue($this->toma, "xMun");
1005
        $aFont = $this->formatNegrito;
1006
        $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...
1007
        $x = $maxW * 0.85;
1008
        $texto = 'UF';
1009
        $aFont = $this->formatPadrao;
1010
        $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...
1011
        $texto = $this->getTagValue($this->toma, "UF");
1012
        $aFont = $this->formatNegrito;
1013
        $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...
1014
        $x = $w - 18;
1015
        $texto = 'CEP';
1016
        $aFont = $this->formatPadrao;
1017
        $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...
1018
        $texto = $this->formatField($this->getTagValue($this->toma, "CEP"), "#####-###");
1019
        $aFont = $this->formatNegrito;
1020
        $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...
1021
        $y += 3;
1022
        $x = $oldX;
1023
        $texto = 'ENDEREÇO';
1024
        $aFont = $this->formatPadrao;
1025
        $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...
1026
        $aFont = $this->formatNegrito;
1027
        $texto = $this->getTagValue($this->toma, "xLgr") . ',';
1028
        $texto .= $this->getTagValue($this->toma, "nro");
1029
        $texto .= ($this->getTagValue($this->toma, "xCpl") != "") ?
1030
            ' - ' . $this->getTagValue($this->toma, "xCpl") : '';
1031
        $texto .= ' - ' . $this->getTagValue($this->toma, "xBairro");
1032
        $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...
1033
        $y += 3;
1034
        $texto = 'CNPJ/CPF';
1035
        $aFont = $this->formatPadrao;
1036
        $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...
1037
        $texto = $this->formatCNPJCPF($this->toma);
1038
        $aFont = $this->formatNegrito;
1039
        $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...
1040
        $x = $x + 65;
1041
        $texto = 'INSCRIÇÃO ESTADUAL';
1042
        $aFont = $this->formatPadrao;
1043
        $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...
1044
        $texto = $this->getTagValue($this->toma, "IE");
1045
        $aFont = $this->formatNegrito;
1046
        $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...
1047
        $x = $w * 0.75;
1048
        $texto = 'PAÍS';
1049
        $aFont = $this->formatPadrao;
1050
        $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...
1051
        $texto = $this->getTagValue($this->toma, "xPais") != "" ?
1052
            $this->getTagValue($this->toma, "xPais") : 'BRASIL';
1053
        $aFont = $this->formatNegrito;
1054
        $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...
1055
        $x = $w - 27;
1056
        $texto = 'FONE';
1057
        $aFont = $this->formatPadrao;
1058
        $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...
1059
        $texto = $this->getTagValue($this->toma, "fone")!=""? $this->formatFone($this->toma):'';
1060
        $aFont = $this->formatNegrito;
1061
        $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...
1062
    }
1063
1064
    /**
1065
     * compValorServ
1066
     * Monta o campo com os componentes da prestação de serviços.
1067
     *
1068
     * @param  number $x Posição horizontal canto esquerdo
1069
     * @param  number $y Posição vertical canto superior
1070
     * @return number Posição vertical final
1071
     */
1072
    protected function compValorServ($x = 0, $y = 0)
1073
    {
1074
        $oldX = $x;
1075
        $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...
1076
        if ($this->orientacao == 'P') {
1077
            $maxW = $this->wPrint;
1078
        } else {
1079
            $maxW = $this->wPrint - $this->wCanhoto;
1080
        }
1081
        $w = $maxW;
1082
        $h = 25;
1083
        $texto = 'COMPONENTES DO VALOR DA PRESTAÇÃO DO SERVIÇO';
1084
        $aFont = $this->formatPadrao;
1085
        $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...
1086
        $y += 3.4;
1087
        $this->pdf->line($x, $y, $w + 1, $y);
1088
        $texto = 'NOME';
1089
        $aFont = $this->formatPadrao;
1090
        $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...
1091
        $yIniDados = $y;
1092
        $x = $w * 0.14;
1093
        $texto = 'VALOR';
1094
        $aFont = $this->formatPadrao;
1095
        $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...
1096
        $x = $w * 0.28;
1097
        $this->pdf->line($x, $y, $x, $y + 21.5);
1098
        $texto = 'NOME';
1099
        $aFont = $this->formatPadrao;
1100
        $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...
1101
        $x = $w * 0.42;
1102
        $texto = 'VALOR';
1103
        $aFont = $this->formatPadrao;
1104
        $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...
1105
        $x = $w * 0.56;
1106
        $this->pdf->line($x, $y, $x, $y + 21.5);
1107
        $texto = 'NOME';
1108
        $aFont = $this->formatPadrao;
1109
        $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...
1110
        $x = $w * 0.70;
1111
        $texto = 'VALOR';
1112
        $aFont = $this->formatPadrao;
1113
        $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...
1114
        $x = $w * 0.86;
1115
        $this->pdf->line($x, $y, $x, $y + 21.5);
1116
        $y += 1;
1117
        $texto = 'VALOR TOTAL DO SERVIÇO';
1118
        $aFont = $this->formatPadrao;
1119
        $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...
1120
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
1121
        $aFont = array(
1122
            'font' => $this->fontePadrao,
1123
            'size' => 9,
1124
            'style' => 'B');
1125
        $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...
1126
        $y += 10;
1127
        $this->pdf->line($x, $y, $w + 1, $y);
1128
        $y += 1;
1129
        $texto = 'VALOR A RECEBER';
1130
        $aFont = $this->formatPadrao;
1131
        $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...
1132
        $texto = number_format($this->getTagValue($this->vPrest, "vRec"), 2, ",", ".");
1133
        $aFont = array(
1134
            'font' => $this->fontePadrao,
1135
            'size' => 9,
1136
            'style' => 'B');
1137
        $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...
1138
        $auxX = $oldX;
1139
        $yIniDados += 4;
1140
1141
        foreach ($this->Comp as $k => $d) {
1142
            $nome = $this->Comp->item($k)->getElementsByTagName('xNome')->item(0)->nodeValue;
1143
            $valor = number_format(
1144
                $this->Comp->item($k)->getElementsByTagName('vComp')->item(0)->nodeValue,
1145
                2,
1146
                ",",
1147
                "."
1148
            );
1149
            if ($auxX > $w * 0.60) {
1150
                $yIniDados = $yIniDados + 4;
1151
                $auxX = $oldX;
1152
            }
1153
            $texto = $nome;
1154
            $aFont = $this->formatPadrao;
1155
            $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...
1156
            $auxX += $w * 0.14;
1157
            $texto = $valor;
1158
            $aFont = $this->formatPadrao;
1159
            $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...
1160
            $auxX += $w * 0.14;
1161
        }
1162
    } //fim da função compValorDACTE
1163
1164
    /**
1165
     * impostos
1166
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1167
     *
1168
     * @param  number $x Posição horizontal canto esquerdo
1169
     * @param  number $y Posição vertical canto superior
1170
     * @return number Posição vertical final
1171
     */
1172
    protected function impostos($x = 0, $y = 0)
1173
    {
1174
        $oldX = $x;
1175
        $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...
1176
        if ($this->orientacao == 'P') {
1177
            $maxW = $this->wPrint;
1178
        } else {
1179
            $maxW = $this->wPrint - $this->wCanhoto;
1180
        }
1181
        $w = $maxW;
1182
        $h = 13;
1183
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
1184
        $aFont = $this->formatPadrao;
1185
        $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...
1186
1187
        $y += 3.4;
1188
        $this->pdf->line($x, $y, $w + 1, $y);
1189
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
1190
        $aFont = $this->formatPadrao;
1191
        $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...
1192
1193
        $x += $w * 0.26;
1194
        $this->pdf->line($x, $y, $x, $y + 9.5);
1195
        $texto = 'BASE DE CALCULO';
1196
        $aFont = $this->formatPadrao;
1197
        $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...
1198
1199
        $wCol02=0.18;
1200
        $x += $w * $wCol02;
1201
        $this->pdf->line($x, $y, $x, $y + 9.5);
1202
        $texto = 'ALÍQ ICMS';
1203
        $aFont = $this->formatPadrao;
1204
        $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...
1205
1206
        $x += $w * $wCol02;
1207
        $this->pdf->line($x, $y, $x, $y + 9.5);
1208
        $texto = 'VALOR ICMS';
1209
        $aFont = $this->formatPadrao;
1210
        $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...
1211
1212
        $x += $w * $wCol02;
1213
        $this->pdf->line($x, $y, $x, $y + 9.5);
1214
        $texto = '% RED. BC ICMS';
1215
        $aFont = $this->formatPadrao;
1216
        $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...
1217
1218
        /*$x += $w * 0.14;
1219
        $this->pdf->line($x, $y, $x, $y + 9.5);
1220
        $texto = 'ICMS ST';
1221
        $aFont = $this->formatPadrao;
1222
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
1223
         * */
1224
1225
        $x = $oldX;
1226
        $y = $y + 4;
1227
        $texto = $this->getTagValue($this->ICMS, "CST");
1228
        switch ($texto) {
1229
            case '00':
1230
                $texto = "00 - Tributação normal ICMS";
1231
                break;
1232
            case '20':
1233
                $texto = "20 - Tributação com BC reduzida do ICMS";
1234
                break;
1235
            case '40':
1236
                $texto = "40 - ICMS isenção";
1237
                break;
1238
            case '41':
1239
                $texto = "41 - ICMS não tributada";
1240
                break;
1241
            case '51':
1242
                $texto = "51 - ICMS diferido";
1243
                break;
1244
            case '60':
1245
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
1246
                break;
1247
            case '90':
1248
                $texto = "90 - ICMS outros";
1249
                break;
1250
        }
1251
        $texto = $this->getTagValue($this->ICMSSN, "indSN") == 1 ? 'Simples Nacional' : $texto;
1252
        $aFont = $this->formatNegrito;
1253
        $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...
1254
        $x += $w * 0.26;
1255
1256
        $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
1257
            number_format($this->getTagValue($this->ICMS, "vBC"), 2, ",", ".") : '';
1258
        $aFont = $this->formatNegrito;
1259
        $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...
1260
        $x += $w * $wCol02;
1261
1262
        $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
1263
            number_format($this->getTagValue($this->ICMS, "pICMS"), 2, ",", ".") : '';
1264
        $aFont = $this->formatNegrito;
1265
        $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...
1266
        $x += $w * $wCol02;
1267
1268
        $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
1269
            number_format($this->getTagValue($this->ICMS, "vICMS"), 2, ",", ".") : '';
1270
        $aFont = $this->formatNegrito;
1271
        $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...
1272
        $x += $w * $wCol02;
1273
1274
        $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
1275
            number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :'';
1276
        $aFont = $this->formatNegrito;
1277
        $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...
1278
1279
        /*$x += $w * 0.14;
1280
        $texto = '';
1281
        $aFont = $this->formatNegrito;
1282
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1283
    } //fim da função compValorDACTE
1284
1285
    /**
1286
     * geraChaveAdicCont
1287
     *
1288
     * @return string chave
1289
     */
1290
    protected function geraChaveAdicCont()
1291
    {
1292
        //cUF tpEmis CNPJ vNF ICMSp ICMSs DD  DV
1293
        // Quantidade de caracteres  02   01      14  14    01    01  02 01
1294
        $forma = "%02d%d%s%014d%01d%01d%02d";
1295
        $cUF = $this->ide->getElementsByTagName('cUF')->item(0)->nodeValue;
1296
        $CNPJ = "00000000000000" . $this->emit->getElementsByTagName('CNPJ')->item(0)->nodeValue;
1297
        $CNPJ = substr($CNPJ, -14);
1298
        $vCT = number_format($this->getTagValue($this->vPrest, "vRec"), 2, "", "") * 100;
1299
        $ICMS_CST = $this->getTagValue($this->ICMS, "CST");
1300
        switch ($ICMS_CST) {
1301
            case '00':
1302
            case '20':
1303
                $ICMSp = '1';
1304
                $ICMSs = '2';
1305
                break;
1306
            case '40':
1307
            case '41':
1308
            case '51':
1309
            case '90':
1310
                $ICMSp = '2';
1311
                $ICMSs = '2';
1312
                break;
1313
            case '60':
1314
                $ICMSp = '2';
1315
                $ICMSs = '1';
1316
                break;
1317
        }
1318
        $dd = $this->ide->getElementsByTagName('dEmi')->item(0)->nodeValue;
1319
        $rpos = strrpos($dd, '-');
1320
        $dd = substr($dd, $rpos + 1);
1321
        $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...
1322
        $chave = $chave . $this->pModulo11($chave);
0 ignored issues
show
Bug introduced by
The method pModulo11() does not exist on NFePHP\DA\CTe\DacteOS. Did you maybe mean modulo11()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
1323
        return $chave;
1324
    } //fim geraChaveAdicCont
1325
1326
    /**
1327
     * infPrestacaoServico
1328
     * Monta o campo com das informações da prestação do serviço
1329
     *
1330
     * @param  number $x Posição horizontal canto esquerdo
1331
     * @param  number $y Posição vertical canto superior
1332
     * @return number Posição vertical final
1333
     */
1334
    protected function infPrestacaoServico($x = 0, $y = 0)
1335
    {
1336
        $oldX = $x;
1337
        $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...
1338
        if ($this->orientacao == 'P') {
1339
            $maxW = $this->wPrint;
1340
        } else {
1341
            $maxW = $this->wPrint - $this->wCanhoto;
1342
        }
1343
        $w = $maxW;
1344
1345
        // SE FOR RODOVIARIO ( BTR-SEMPRE SERÁ )
1346
        if ($this->modal == '1') {
1347
            // 0 - Não; 1 - Sim Será lotação quando houver um único conhecimento de transporte por veículo,
1348
            // ou combinação veicular, e por viagem
1349
            $h = $this->lota == 1 ? 35 : 53;
1350
        } elseif ($this->modal == '3') {
1351
            $h = 37.6;
1352
        } else {
1353
            $h = 35;
1354
        }
1355
        $texto = 'INFORMAÇÕES DA PRESTAÇÃO DO SERVIÇO';
1356
        $aFont = $this->formatPadrao;
1357
        $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...
1358
        $descr1 = 'QUANTIDADE';
1359
        $descr2 = 'DESCRIÇÃO DO SERVIÇO PRESTADO';
1360
1361
        $y += 3.4;
1362
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAIXO DO TEXTO: "DOCUMENTOS ORIGINÁRIOS
1363
        $texto = $descr1;
1364
        $aFont = $this->formatPadrao;
1365
        $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...
1366
        $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...
1367
1368
        $x += $w * 0.14;
1369
        if ($this->modal == '1') {
1370
            if ($this->lota == 1) {
1371
                $this->pdf->line($x, $y, $x, $y + 31.5); // TESTE
1372
            } else {
1373
                $this->pdf->line($x, $y, $x, $y + 49.5); // TESTE
1374
            }
1375
        } elseif ($this->modal == '3') {
1376
            $this->pdf->line($x, $y, $x, $y + 34.1);
1377
        } else {
1378
            $this->pdf->line($x, $y, $x, $y + 21.5);
1379
        }
1380
1381
        $x += $w * 0.08;
1382
        $texto = $descr2;
1383
        $aFont = $this->formatPadrao;
1384
        $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...
1385
1386
        //$auxX = $oldX;
1387
        //$yIniDados += 3;
1388
1389
        $x = $oldX;
1390
        $y = $y + 4;
1391
        $texto = number_format($this->getTagValue($this->infQ->item(0), "qCarga"), 3, ",", ".");
1392
        $aFont = $this->formatNegrito;
1393
        $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...
1394
        $x += $w * 0.26;
1395
1396
        $x = $oldX + 35;
1397
        $texto = $this->getTagValue($this->infServico->item(0), "xDescServ");
1398
        $aFont = $this->formatNegrito;
1399
        $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...
1400
        $x += $w * 0.26;
1401
1402
1403
        $r = $this->cabecalho(1, 1, '1', $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...
1404
        $contador = 0;
0 ignored issues
show
Unused Code introduced by
$contador 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...
1405
    }
1406
1407
    /**
1408
     * docCompl
1409
     * Monta o campo com os dados do remetente na DACTE.
1410
     *
1411
     * @param number $x Posição horizontal canto esquerdo
1412
     * @param number $y Posição vertical canto superior
1413
     * @return number Posição vertical final
1414
     */
1415
    protected function docCompl($x = 0, $y = 0)
1416
    {
1417
        $oldX = $x;
1418
        $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...
1419
        if ($this->orientacao == 'P') {
1420
            $maxW = $this->wPrint;
1421
        } else {
1422
            $maxW = $this->wPrint - $this->wCanhoto;
1423
        }
1424
        $w = $maxW;
1425
        $h = 80;
1426
        $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
1427
        $aFont = $this->formatPadrao;
1428
        $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...
1429
        $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
1430
        $descr2 = 'VALOR COMPLEMENTADO';
1431
        $y += 3.4;
1432
        $this->pdf->line($x, $y, $w + 1, $y);
1433
        $texto = $descr1;
1434
        $aFont = $this->formatPadrao;
1435
        $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...
1436
        $yIniDados = $y;
1437
        $x += $w * 0.37;
1438
        $texto = $descr2;
1439
        $aFont = $this->formatPadrao;
1440
        $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...
1441
        $x += $w * 0.13;
1442
        $this->pdf->line($x, $y, $x, $y + 76.5);
1443
        $texto = $descr1;
1444
        $aFont = $this->formatPadrao;
1445
        $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
0 ignored issues
show
Documentation introduced by
0 is of type integer, but the function expects a boolean.

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

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

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

function acceptsInteger($int) { }

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

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
1446
        $x += $w * 0.3;
1447
        $texto = $descr2;
1448
        $aFont = $this->formatPadrao;
1449
        $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...
1450
        $auxX = $oldX;
1451
        $yIniDados += 4;
1452
        if ($auxX > $w * 0.90) {
1453
            $yIniDados = $yIniDados + 4;
1454
            $auxX = $oldX;
1455
        }
1456
        $texto = $this->chaveCTeRef;
1457
        $aFont = array(
1458
            'font' => $this->fontePadrao,
1459
            'size' => 8,
1460
            'style' => '');
1461
        $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...
1462
        $texto = number_format($this->getTagValue($this->vPrest, "vTPrest"), 2, ",", ".");
1463
        $aFont = array(
1464
            'font' => $this->fontePadrao,
1465
            'size' => 8,
1466
            'style' => '');
1467
        $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...
1468
    }
1469
1470
    /**
1471
     * observacoes
1472
     * Monta o campo com os dados do remetente na DACTE.
1473
     *
1474
     * @param  number $x Posição horizontal canto esquerdo
1475
     * @param  number $y Posição vertical canto superior
1476
     * @return number Posição vertical final
1477
     */
1478
    protected function observacoes($x = 0, $y = 0)
1479
    {
1480
        $oldX = $x;
1481
        $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...
1482
        if ($this->orientacao == 'P') {
1483
            $maxW = $this->wPrint;
1484
        } else {
1485
            $maxW = $this->wPrint - $this->wCanhoto;
1486
        }
1487
        $w = $maxW;
1488
        //$h = 18;
1489
        $h = 18.8;
1490
        $texto = 'OBSERVAÇÕES GERAIS';
1491
        $aFont = $this->formatPadrao;
1492
        $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...
1493
        $y += 3.4;
1494
        $this->pdf->line($x, $y, $w + 1, $y);
1495
        $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...
1496
        $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...
1497
        $texto = '';
1498
        foreach ($this->compl as $k => $d) {
1499
            $xObs = $this->getTagValue($this->compl->item($k), "xObs");
1500
            $texto .= $xObs;
1501
        }
1502
        $textoObs = explode("Motorista:", $texto);
1503
        $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: '';
1504
        $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n");
1505
        $aFont = array(
1506
            'font' => $this->fontePadrao,
1507
            'size' => 7.5,
1508
            'style' => '');
1509
        $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...
1510
        $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...
1511
    }
1512
1513
    /**
1514
     * seguro
1515
     * Monta o campo com os dados de seguro do CT-e OS.
1516
     *
1517
     * @param  number $x Posição horizontal canto esquerdo
1518
     * @param  number $y Posição vertical canto superior
1519
     * @return number Posição vertical final
1520
     */
1521
    protected function seguro($x = 0, $y = 0)
1522
    {
1523
        $oldX = $x;
1524
        $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...
1525
        if ($this->orientacao == 'P') {
1526
            $maxW = $this->wPrint;
1527
        } else {
1528
            $maxW = $this->wPrint - $this->wCanhoto;
1529
        }
1530
        $w = $maxW;
1531
        $h = 13;
1532
        $texto = 'SEGURO DA VIAGEM';
1533
        $aFont = $this->formatPadrao;
1534
        $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...
1535
1536
        $y += 3.4;
1537
        $this->pdf->line($x, $y, $w + 1, $y);
1538
        $texto = 'RESPONSÁVEL';
1539
        $aFont = $this->formatPadrao;
1540
        $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...
1541
1542
        $x += $w * 0.33;
1543
        $this->pdf->line($x, $y, $x, $y + 9.5);
1544
        $texto = 'NOME DA SEGURADORA';
1545
        $aFont = $this->formatPadrao;
1546
        $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...
1547
1548
        $wCol02=0.33;
1549
        $x += $w * $wCol02;
1550
        $this->pdf->line($x, $y, $x, $y + 9.5);
1551
        $texto = 'NÚMERO DA APÓLICE';
1552
        $aFont = $this->formatPadrao;
1553
        $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...
1554
1555
        $x = $oldX;
1556
        $y = $y + 4;
1557
        $texto = $this->respSeg;
1558
        $aFont = $this->formatNegrito;
1559
        $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...
1560
        $x += $w * 0.26;
1561
1562
        $texto = '';
1563
        $aFont = $this->formatNegrito;
1564
        $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...
1565
        $x += $w * $wCol02;
1566
1567
        $texto = '';
1568
        $aFont = $this->formatNegrito;
1569
        $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...
1570
        $x += $w * $wCol02;
1571
    }
1572
1573
    /**
1574
     * modalRod
1575
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1576
     *
1577
     * @param  number $x Posição horizontal canto esquerdo
1578
     * @param  number $y Posição vertical canto superior
1579
     * @return number Posição vertical final
1580
     */
1581
    protected function modalRod($x = 0, $y = 0)
1582
    {
1583
        $oldX = $x;
1584
        $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...
1585
        if ($this->orientacao == 'P') {
1586
            $maxW = $this->wPrint;
1587
        } else {
1588
            $maxW = $this->wPrint - $this->wCanhoto;
1589
        }
1590
        $w = $maxW;
1591
        $h = 13;
1592
        $texto = 'DADOS ESPECÍFICOS DO MODAL RODOVIÁRIO';
1593
        $aFont = $this->formatPadrao;
1594
        $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...
1595
1596
        $y += 3.4;
1597
        $this->pdf->line($x, $y, $w + 1, $y);
1598
        $texto = 'TERMO DE AUTORIZAÇÃO DE FRETAMENTO';
1599
        $aFont = $this->formatPadrao;
1600
        $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...
1601
1602
        $x += $w * 0.26;
1603
        $this->pdf->line($x, $y, $x, $y + 9.5);
1604
        $texto = 'Nº DE REGISTRO ESTADUAL';
1605
        $aFont = $this->formatPadrao;
1606
        $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...
1607
1608
        $wCol02=0.18;
1609
        $x += $w * $wCol02;
1610
        $this->pdf->line($x, $y, $x, $y + 9.5);
1611
        $texto = 'PLACA DO VEÍCULO';
1612
        $aFont = $this->formatPadrao;
1613
        $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...
1614
1615
        $x += $w * $wCol02;
1616
        $this->pdf->line($x, $y, $x, $y + 9.5);
1617
        $texto = 'RENAVAM DO VEÍCULO';
1618
        $aFont = $this->formatPadrao;
1619
        $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...
1620
1621
        $x += $w * $wCol02;
1622
        $this->pdf->line($x, $y, $x, $y + 9.5);
1623
        $texto = 'CNPJ/CPF';
1624
        $aFont = $this->formatPadrao;
1625
        $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...
1626
1627
        $x = $oldX;
1628
        $y = $y + 4;
1629
        $texto = $this->getTagValue($this->rodo, "TAF");
1630
        $aFont = $this->formatNegrito;
1631
        $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...
1632
        $x += $w * 0.26;
1633
1634
        $texto = $this->getTagValue($this->rodo, "NroRegEstadual");
1635
        $aFont = $this->formatNegrito;
1636
        $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...
1637
        $x += $w * $wCol02;
1638
1639
        $texto = $this->getTagValue($this->veic->item(0), "placa");
1640
        $aFont = $this->formatNegrito;
1641
        $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...
1642
        $x += $w * $wCol02;
1643
1644
        $texto = $this->getTagValue($this->veic->item(0), "RENAVAM");
1645
        $aFont = $this->formatNegrito;
1646
        $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...
1647
        $x += $w * $wCol02;
1648
1649
        $texto = !empty($this->getTagValue($this->veic->item(0), "CPF")) ?
1650
            $this->getTagValue($this->veic->item(0), "CPF") :
1651
            (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ?
1652
            $this->getTagValue($this->veic->item(0), "CNPJ") : '');
1653
        $aFont = $this->formatNegrito;
1654
        $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...
1655
1656
        /*$x += $w * 0.14;
1657
        $texto = '';
1658
        $aFont = $this->formatNegrito;
1659
        $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
1660
    }
1661
1662
    /**
1663
     * modalAquaviario
1664
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1665
     *
1666
     * @param  number $x Posição horizontal canto esquerdo
1667
     * @param  number $y Posição vertical canto superior
1668
     * @return number Posição vertical final
1669
     */
1670
    protected function modalAquaviario($x = 0, $y = 0)
1671
    {
1672
        $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...
1673
        $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...
1674
        if ($this->orientacao == 'P') {
1675
            $maxW = $this->wPrint;
1676
        } else {
1677
            $maxW = $this->wPrint - $this->wCanhoto;
1678
        }
1679
        $w = $maxW;
1680
        $h = 8.5;
1681
        $texto = 'DADOS ESPECÍFICOS DO MODAL AQUAVIÁRIO';
1682
        $aFont = $this->formatPadrao;
1683
        $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...
1684
        $y += 3.4;
1685
        $this->pdf->line($x, $y, $w + 1, $y);
1686
        $texto = 'PORTO DE EMBARQUE';
1687
        $aFont = $this->formatPadrao;
1688
        $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...
1689
        $texto = $this->getTagValue($this->aquav, "prtEmb");
1690
        $aFont = $this->formatNegrito;
1691
        $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...
1692
        $x += $w * 0.50;
1693
        $this->pdf->line($x, $y, $x, $y + 7.7);
1694
        $texto = 'PORTO DE DESTINO';
1695
        $aFont = $this->formatPadrao;
1696
        $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...
1697
        $texto = $this->getTagValue($this->aquav, "prtDest");
1698
        $aFont = $this->formatNegrito;
1699
        $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...
1700
        $y += 8;
1701
        $this->pdf->line(208, $y, 1, $y);
1702
        $x = 1;
1703
        $texto = 'IDENTIFICAÇÃO DO NAVIO / REBOCADOR';
1704
        $aFont = $this->formatPadrao;
1705
        $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...
1706
        $texto = $this->getTagValue($this->aquav, "xNavio");
1707
        $aFont = $this->formatNegrito;
1708
        $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...
1709
        $x += $w * 0.50;
1710
        $this->pdf->line($x, $y, $x, $y + 7.7);
1711
        $texto = 'VR DA B. DE CALC. AFRMM';
1712
        $aFont = $this->formatPadrao;
1713
        $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...
1714
        $texto = $this->getTagValue($this->aquav, "vPrest");
1715
        $aFont = $this->formatNegrito;
1716
        $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...
1717
        $x += $w * 0.17;
1718
        $this->pdf->line($x, $y, $x, $y + 7.7);
1719
        $texto = 'VALOR DO AFRMM';
1720
        $aFont = $this->formatPadrao;
1721
        $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...
1722
        $texto = $this->getTagValue($this->aquav, "vAFRMM");
1723
        $aFont = $this->formatNegrito;
1724
        $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...
1725
        $x += $w * 0.12;
1726
        $this->pdf->line($x, $y, $x, $y + 7.7);
1727
        $texto = 'TIPO DE NAVEGAÇÃO';
1728
        $aFont = $this->formatPadrao;
1729
        $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...
1730
        $texto = $this->getTagValue($this->aquav, "tpNav");
1731
        switch ($texto) {
1732
            case '0':
1733
                $texto = 'INTERIOR';
1734
                break;
1735
            case '1':
1736
                $texto = 'CABOTAGEM';
1737
                break;
1738
        }
1739
        $aFont = $this->formatNegrito;
1740
        $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...
1741
        $x += $w * 0.14;
1742
        $this->pdf->line($x, $y, $x, $y + 7.7);
1743
        $texto = 'DIREÇÃO';
1744
        $aFont = $this->formatPadrao;
1745
        $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...
1746
        $texto = $this->getTagValue($this->aquav, "direc");
1747
        switch ($texto) {
1748
            case 'N':
1749
                $texto = 'NORTE';
1750
                break;
1751
            case 'L':
1752
                $texto = 'LESTE';
1753
                break;
1754
            case 'S':
1755
                $texto = 'SUL';
1756
                break;
1757
            case 'O':
1758
                $texto = 'OESTE';
1759
                break;
1760
        }
1761
        $aFont = $this->formatNegrito;
1762
        $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...
1763
        $y += 8;
1764
        $this->pdf->line(208, $y, 1, $y);
1765
        $x = 1;
1766
        $texto = 'IDENTIFICAÇÃO DOS CONTEINERS';
1767
        $aFont = $this->formatPadrao;
1768
        $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...
1769
        if ($this->infNF->item(0) !== null && $this->infNF->item(0)->getElementsByTagName('infUnidCarga') !== null) {
1770
            $texto = $this->infNF
1771
                ->item(0)
1772
                ->getElementsByTagName('infUnidCarga')
1773
                ->item(0)
1774
                ->getElementsByTagName('idUnidCarga')
1775
                ->item(0)->nodeValue;
1776
        } elseif ($this->infNFe->item(0) !== null
1777
            && $this->infNFe->item(0)->getElementsByTagName('infUnidCarga') !== null
1778
        ) {
1779
            $texto = $this->infNFe
1780
                ->item(0)
1781
                ->getElementsByTagName('infUnidCarga')
1782
                ->item(0)
1783
                ->getElementsByTagName('idUnidCarga')
1784
                ->item(0)
1785
                ->nodeValue;
1786
        } elseif ($this->infOutros->item(0) !== null
1787
            && $this->infOutros->item(0)->getElementsByTagName('infUnidCarga') !== null
1788
        ) {
1789
            $texto = $this->infOutros
1790
                ->item(0)
1791
                ->getElementsByTagName('infUnidCarga')
1792
                ->item(0)
1793
                ->getElementsByTagName('idUnidCarga')
1794
                ->item(0)
1795
                ->nodeValue;
1796
        } else {
1797
            $texto = '';
1798
        }
1799
        $aFont = $this->formatNegrito;
1800
        $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...
1801
        $x += $w * 0.50;
1802
        $this->pdf->line($x, $y, $x, $y + 7.7);
1803
        $texto = 'IDENTIFICAÇÃO DAS BALSAS';
1804
        $aFont = $this->formatPadrao;
1805
        $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...
1806
        $texto = '';
1807
        if ($this->getTagValue($this->aquav, "balsa") !== '') {
1808
            foreach ($this->aquav->getElementsByTagName('balsa') as $k => $d) {
1809
                if ($k == 0) {
1810
                    $texto = $this->aquav
1811
                        ->getElementsByTagName('balsa')
1812
                        ->item($k)
1813
                        ->getElementsByTagName('xBalsa')
1814
                        ->item(0)
1815
                        ->nodeValue;
1816
                } else {
1817
                    $texto = $texto
1818
                        . ' / '
1819
                        . $this->aquav
1820
                            ->getElementsByTagName('balsa')
1821
                            ->item($k)
1822
                            ->getElementsByTagName('xBalsa')
1823
                            ->item(0)
1824
                            ->nodeValue;
1825
                }
1826
            }
1827
        }
1828
        $aFont = $this->formatNegrito;
1829
        $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...
1830
    }
1831
1832
    /**
1833
     * modalFerr
1834
     * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1835
     *
1836
     * @param  number $x Posição horizontal canto esquerdo
1837
     * @param  number $y Posição vertical canto superior
1838
     * @return number Posição vertical final
1839
     */
1840
    protected function modalFerr($x = 0, $y = 0)
1841
    {
1842
        $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...
1843
        $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...
1844
        if ($this->orientacao == 'P') {
1845
            $maxW = $this->wPrint;
1846
        } else {
1847
            $maxW = $this->wPrint - $this->wCanhoto;
1848
        }
1849
        $w = $maxW;
1850
        $h = 19.6;
1851
        $texto = 'DADOS ESPECÍFICOS DO MODAL FERROVIÁRIO';
1852
        $aFont = $this->formatPadrao;
1853
        $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...
1854
        $y += 3.4;
1855
        $this->pdf->line($x, $y, $w + 1, $y);
1856
        $texto = 'DCL';
1857
        $aFont = array(
1858
            'font' => $this->fontePadrao,
1859
            'size' => 7,
1860
            'style' => 'B');
1861
        $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...
1862
        $this->pdf->line($x + 49.6, $y, $x + 49.6, $y + 3.5);
1863
        $texto = 'VAGÕES';
1864
        $aFont = array(
1865
            'font' => $this->fontePadrao,
1866
            'size' => 7,
1867
            'style' => 'B');
1868
        $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...
1869
        $y += 3.4;
1870
        $this->pdf->line($x, $y, $w + 1, $y);
1871
        // DCL
1872
        $texto = 'ID TREM';
1873
        $aFont = array(
1874
            'font' => $this->fontePadrao,
1875
            'size' => 6,
1876
            'style' => '');
1877
        $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...
1878
        $texto = $this->getTagValue($this->ferrov, "idTrem");
1879
        $aFont = array(
1880
            'font' => $this->fontePadrao,
1881
            'size' => 6,
1882
            'style' => 'B');
1883
        $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...
1884
        $x += $w * 0.06;
1885
        $y1 = $y + 12.5;
1886
        $this->pdf->line($x, $y, $x, $y1);
1887
        $texto = 'NUM';
1888
        $aFont = array(
1889
            'font' => $this->fontePadrao,
1890
            'size' => 6,
1891
            'style' => '');
1892
        $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...
1893
        $texto = $this->getTagValue($this->rem, "nDoc");
0 ignored issues
show
Bug introduced by
The property rem 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...
1894
        $aFont = array(
1895
            'font' => $this->fontePadrao,
1896
            'size' => 6,
1897
            'style' => 'B');
1898
        $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...
1899
        $x += $w * 0.06;
1900
        $this->pdf->line($x, $y, $x, $y1);
1901
        $texto = 'SÉRIE';
1902
        $aFont = array(
1903
            'font' => $this->fontePadrao,
1904
            'size' => 6,
1905
            'style' => '');
1906
        $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...
1907
        $texto = $this->getTagValue($this->rem, "serie");
1908
        $aFont = array(
1909
            'font' => $this->fontePadrao,
1910
            'size' => 6,
1911
            'style' => 'B');
1912
        $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...
1913
        $x += $w * 0.06;
1914
        $this->pdf->line($x, $y, $x, $y1);
1915
        $texto = 'EMISSÃO';
1916
        $aFont = array(
1917
            'font' => $this->fontePadrao,
1918
            'size' => 6,
1919
            'style' => '');
1920
        $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...
1921
        $texto = $this->pYmd2dmy($this->getTagValue($this->rem, "dEmi"));
0 ignored issues
show
Bug introduced by
The method pYmd2dmy() does not seem to exist on object<NFePHP\DA\CTe\DacteOS>.

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...
1922
        $aFont = array(
1923
            'font' => $this->fontePadrao,
1924
            'size' => 6,
1925
            'style' => 'B');
1926
        $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...
1927
        // VAGOES
1928
        $x += $w * 0.06;
1929
        $this->pdf->line($x, $y, $x, $y1);
1930
        $texto = 'NUM';
1931
        $aFont = array(
1932
            'font' => $this->fontePadrao,
1933
            'size' => 6,
1934
            'style' => '');
1935
        $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...
1936
        $texto = $this->getTagValue($this->ferrov, "nVag");
1937
        $aFont = array(
1938
            'font' => $this->fontePadrao,
1939
            'size' => 6,
1940
            'style' => 'B');
1941
        $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...
1942
        $x += $w * 0.06;
1943
        $this->pdf->line($x, $y, $x, $y1);
1944
        $texto = 'TIPO';
1945
        $aFont = array(
1946
            'font' => $this->fontePadrao,
1947
            'size' => 6,
1948
            'style' => '');
1949
        $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...
1950
        $texto = $this->getTagValue($this->ferrov, "tpVag");
1951
        $aFont = array(
1952
            'font' => $this->fontePadrao,
1953
            'size' => 6,
1954
            'style' => 'B');
1955
        $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...
1956
        $x += $w * 0.06;
1957
        $this->pdf->line($x, $y, $x, $y1);
1958
        $texto = 'CAPACIDADE';
1959
        $aFont = array(
1960
            'font' => $this->fontePadrao,
1961
            'size' => 6,
1962
            'style' => '');
1963
        $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...
1964
        $texto = $this->getTagValue($this->ferrov, "cap");
1965
        $aFont = array(
1966
            'font' => $this->fontePadrao,
1967
            'size' => 6,
1968
            'style' => 'B');
1969
        $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...
1970
        $x += $w * 0.08;
1971
        $this->pdf->line($x, $y, $x, $y1);
1972
        $texto = 'PESO REAL/TON';
1973
        $aFont = array(
1974
            'font' => $this->fontePadrao,
1975
            'size' => 6,
1976
            'style' => '');
1977
        $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...
1978
        $texto = $this->getTagValue($this->ferrov, "pesoR");
1979
        $aFont = array(
1980
            'font' => $this->fontePadrao,
1981
            'size' => 6,
1982
            'style' => 'B');
1983
        $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...
1984
        $x += $w * 0.09;
1985
        $this->pdf->line($x, $y, $x, $y1);
1986
        $texto = 'PESO BRUTO/TON';
1987
        $aFont = array(
1988
            'font' => $this->fontePadrao,
1989
            'size' => 6,
1990
            'style' => '');
1991
        $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...
1992
        $texto = $this->getTagValue($this->ferrov, "pesoBC");
1993
        $aFont = array(
1994
            'font' => $this->fontePadrao,
1995
            'size' => 6,
1996
            'style' => 'B');
1997
        $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...
1998
        $x += $w * 0.1;
1999
        $this->pdf->line($x, $y, $x, $y1);
2000
        $texto = 'IDENTIFICAÇÃO DOS CONTÊINERES';
2001
        $aFont = array(
2002
            'font' => $this->fontePadrao,
2003
            'size' => 6,
2004
            'style' => '');
2005
        $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...
2006
        $texto = $this->getTagValue($this->ferrov, "nCont");
2007
        $aFont = array(
2008
            'font' => $this->fontePadrao,
2009
            'size' => 6,
2010
            'style' => 'B');
2011
        $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...
2012
        // FLUXO
2013
        $x = 1;
2014
        $y += 12.9;
2015
        $h1 = $h * 0.5 + 0.27;
2016
        $wa = round($w * 0.103) + 0.5;
2017
        $texto = 'FLUXO FERROVIARIO';
2018
        $aFont = $this->formatPadrao;
2019
        $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...
2020
        $texto = $this->getTagValue($this->ferrov, "fluxo");
2021
        $aFont = array(
2022
            'font' => $this->fontePadrao,
2023
            'size' => 7,
2024
            'style' => 'B');
2025
        $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...
2026
        $y += 10;
2027
        $texto = 'TIPO DE TRÁFEGO';
2028
        $aFont = $this->formatPadrao;
2029
        $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...
2030
        $texto = $this->convertUnidTrafego($this->getTagValue($this->ferrov, "tpTraf"));
2031
        $aFont = array(
2032
            'font' => $this->fontePadrao,
2033
            'size' => 7,
2034
            'style' => 'B');
2035
        $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...
2036
        // Novo Box Relativo a Modal Ferroviário
2037
        $x = 22.5;
2038
        $y += -10.2;
2039
        $texto = 'INFORMAÇÕES DAS FERROVIAS ENVOLVIDAS';
2040
        $aFont = $this->formatPadrao;
2041
        $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...
2042
        $y += 3.4;
2043
        $this->pdf->line($x, $y, $w + 1, $y);
2044
        $w = $w * 0.2;
2045
        $h = $h * 1.04;
2046
        $texto = 'CÓDIGO INTERNO';
2047
        $aFont = array(
2048
            'font' => $this->fontePadrao,
2049
            'size' => 6,
2050
            'style' => '');
2051
        $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...
2052
        $texto = $this->getTagValue($this->ferrov, "cInt");
2053
        $aFont = array(
2054
            'font' => $this->fontePadrao,
2055
            'size' => 6,
2056
            'style' => 'B');
2057
        $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...
2058
        $texto = 'CNPJ';
2059
        $aFont = array(
2060
            'font' => $this->fontePadrao,
2061
            'size' => 6,
2062
            'style' => '');
2063
        $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...
2064
        $texto = $this->getTagValue($this->ferrov, "CNPJ");
2065
        $aFont = array(
2066
            'font' => $this->fontePadrao,
2067
            'size' => 6,
2068
            'style' => 'B');
2069
        $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...
2070
        $x += 50;
2071
        $texto = 'NOME';
2072
        $aFont = array(
2073
            'font' => $this->fontePadrao,
2074
            'size' => 6,
2075
            'style' => '');
2076
        $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...
2077
        $texto = $this->getTagValue($this->ferrov, "xNome");
2078
        $aFont = array(
2079
            'font' => $this->fontePadrao,
2080
            'size' => 6,
2081
            'style' => 'B');
2082
        $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...
2083
        $texto = 'INSCRICAO ESTADUAL';
2084
        $aFont = array(
2085
            'font' => $this->fontePadrao,
2086
            'size' => 6,
2087
            'style' => '');
2088
        $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...
2089
        $texto = $this->getTagValue($this->ferrov, "IE");
2090
        $aFont = array(
2091
            'font' => $this->fontePadrao,
2092
            'size' => 6,
2093
            'style' => 'B');
2094
        $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...
2095
        $x += 50;
2096
        $texto = 'PARTICIPAÇÃO OUTRA FERROVIA';
2097
        $aFont = array(
2098
            'font' => $this->fontePadrao,
2099
            'size' => 6,
2100
            'style' => '');
2101
        $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...
2102
        $texto = '';
2103
        $aFont = array(
2104
            'font' => $this->fontePadrao,
2105
            'size' => 6,
2106
            'style' => 'B');
2107
        $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...
2108
    }
2109
2110
    /**
2111
     * canhoto
2112
     * Monta o campo com os dados do remetente na DACTE.
2113
     *
2114
     * @param  number $x Posição horizontal canto esquerdo
2115
     * @param  number $y Posição vertical canto superior
2116
     * @return number Posição vertical final
2117
     */
2118
    protected function canhoto($x = 0, $y = 0)
2119
    {
2120
        $this->pdf->dashedHLine($x, $y+2, $this->wPrint, 0.1, 80);
2121
        $y = $y + 2;
2122
        $oldX = $x;
2123
        $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...
2124
        if ($this->orientacao == 'P') {
2125
            $maxW = $this->wPrint;
2126
        } else {
2127
            $maxW = $this->wPrint - $this->wCanhoto;
2128
        }
2129
        $w = $maxW - 1;
2130
        $h = 20;
2131
        $y = $y + 1;
2132
        $texto = 'DECLARO QUE RECEBI OS VOLUMES DESTE CONHECIMENTO EM PERFEITO ESTADO ';
2133
        $texto .= 'PELO QUE DOU POR CUMPRIDO O PRESENTE CONTRATO DE TRANSPORTE';
2134
        $aFont = $this->formatPadrao;
2135
        $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...
2136
        $y += 3.4;
2137
        $this->pdf->line($x, $y, $w + 1, $y); // LINHA ABAICO DO TEXTO DECLARO QUE RECEBI...
2138
2139
        $texto = 'NOME';
2140
        $aFont = array(
2141
            'font' => $this->fontePadrao,
2142
            'size' => 6,
2143
            'style' => '');
2144
        $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...
2145
        $x += $w * 0.25;
2146
2147
        $this->pdf->line($x, $y, $x, $y + 16.5);
2148
2149
        $texto = 'ASSINATURA / CARIMBO';
2150
        $aFont = array(
2151
            'font' => $this->fontePadrao,
2152
            'size' => 6,
2153
            'style' => '');
2154
        $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...
2155
        $x += $w * 0.25;
2156
2157
        $this->pdf->line($x, $y, $x, $y + 16.5);
2158
2159
        $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n";
2160
        $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA';
2161
        $aFont = array(
2162
            'font' => $this->fontePadrao,
2163
            'size' => 6,
2164
            'style' => '');
2165
        $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...
2166
        $x = $oldX;
2167
        $y = $y + 5;
2168
2169
        $this->pdf->line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME
2170
2171
        $texto = 'RG';
2172
        $aFont = array(
2173
            'font' => $this->fontePadrao,
2174
            'size' => 6,
2175
            'style' => '');
2176
        $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...
2177
        $x += $w * 0.85;
2178
2179
        $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E
2180
2181
        $texto = "CT-E OS";
2182
        $aFont = $this->formatNegrito;
2183
        $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...
2184
        $texto = "\r\n Nº. DOCUMENTO  " . $this->getTagValue($this->ide, "nCT") . " \n";
2185
        $texto .= "\r\n SÉRIE  " . $this->getTagValue($this->ide, "serie");
2186
        $aFont = array(
2187
            'font' => $this->fontePadrao,
2188
            'size' => 6,
2189
            'style' => '');
2190
        $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...
2191
        $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...
2192
    }
2193
2194
    /**
2195
     * dadosAdic
2196
     * Coloca o grupo de dados adicionais da DACTE.
2197
     *
2198
     * @param  number $x Posição horizontal canto esquerdo
2199
     * @param  number $y Posição vertical canto superior
2200
     * @param  number $h altura do campo
2201
     * @return number Posição vertical final
2202
     */
2203
    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...
2204
    {
2205
        $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...
2206
        //###########################################################################
2207
        //DADOS ADICIONAIS DACTE
2208
        if ($this->orientacao == 'P') {
2209
            $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...
2210
        } else {
2211
            $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...
2212
        }
2213
        //INFORMAÇÕES COMPLEMENTARES
2214
        $texto = "USO EXCLUSIVO DO EMISSOR DO CT-E";
2215
        $y += 3;
2216
        $w = $this->wAdic;
2217
        $h = 20; //mudar
2218
        $aFont = array(
2219
            'font' => $this->fontePadrao,
2220
            'size' => 6,
2221
            'style' => '');
2222
        $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...
2223
        //$this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
2224
        $this->pdf->line($x, $y + 3, $w * 1.385, $y + 3);
2225
        //o texto com os dados adicionais foi obtido na função xxxxxx
2226
        //e carregado em uma propriedade privada da classe
2227
        //$this->wAdic com a largura do campo
2228
        //$this->textoAdic com o texto completo do campo
2229
        $y += 1;
2230
        $aFont = $this->formatPadrao;
2231
        $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...
2232
        //RESERVADO AO FISCO
2233
        $texto = "RESERVADO AO FISCO";
2234
        $x += $w;
2235
        $y -= 1;
2236
        if ($this->orientacao == 'P') {
2237
            $w = $this->wPrint - $w;
2238
        } else {
2239
            $w = $this->wPrint - $w - $this->wCanhoto;
2240
        }
2241
        $aFont = array(
2242
            'font' => $this->fontePadrao,
2243
            'size' => 6,
2244
            'style' => '');
2245
        $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...
2246
        //inserir texto informando caso de contingência
2247
        //1 – Normal – emissão normal;
2248
        //2 – Contingência FS – emissão em contingência com impressão do DACTE em Formulário de Segurança;
2249
        //3 – Contingência SCAN – emissão em contingência  – SCAN;
2250
        //4 – Contingência DPEC - emissão em contingência com envio da Declaração Prévia de
2251
        //Emissão em Contingência – DPEC;
2252
        //5 – Contingência FS-DA - emissão em contingência com impressão do DACTE em Formulário de
2253
        //Segurança para Impressão de Documento Auxiliar de Documento Fiscal Eletrônico (FS-DA).
2254
        $xJust = $this->getTagValue($this->ide, 'xJust', 'Justificativa: ');
2255
        $dhCont = $this->getTagValue($this->ide, 'dhCont', ' Entrada em contingência : ');
2256
        $texto = '';
2257
        switch ($this->tpEmis) {
2258
            case 2:
2259
                $texto = 'CONTINGÊNCIA FS' . $dhCont . $xJust;
2260
                break;
2261
            case 3:
2262
                $texto = 'CONTINGÊNCIA SCAN' . $dhCont . $xJust;
2263
                break;
2264
            case 4:
2265
                $texto = 'CONTINGÊNCIA DPEC' . $dhCont . $xJust;
2266
                break;
2267
            case 5:
2268
                $texto = 'CONTINGÊNCIA FSDA' . $dhCont . $xJust;
2269
                break;
2270
        }
2271
        $y += 2;
2272
        $aFont = $this->formatPadrao;
2273
        $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...
2274
        return $y + $h;
2275
    }
2276
2277
    /**
2278
     * formatCNPJCPF
2279
     * Formata campo CnpjCpf contida na CTe
2280
     *
2281
     * @param  string $field campo cnpjCpf da CT-e
2282
     * @return string
2283
     */
2284
    protected function formatCNPJCPF($field)
2285
    {
2286
        if (!isset($field)) {
2287
            return '';
2288
        }
2289
        $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...
2290
            $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...
2291
        if ($cnpj != "" && $cnpj != "00000000000000") {
2292
            $cnpj = $this->formatField($cnpj, '###.###.###/####-##');
2293
        } else {
2294
            $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...
2295
                $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...
2296
        }
2297
        return $cnpj;
2298
    }
2299
2300
    /**
2301
     * formatFone
2302
     * Formata campo fone contida na CTe
2303
     *
2304
     * @param  string $field campo fone da CT-e
2305
     * @return string
2306
     */
2307
    protected function formatFone($field)
2308
    {
2309
        try {
2310
            $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...
2311
            $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...
2312
            $foneLen = strlen($fone);
2313
            if ($foneLen > 0) {
2314
                $fone2 = substr($fone, 0, $foneLen - 4);
2315
                $fone1 = substr($fone, 0, $foneLen - 8);
2316
                $fone = '(' . $fone1 . ') ' . substr($fone2, -4) . '-' . substr($fone, -4);
2317
            } else {
2318
                $fone = '';
2319
            }
2320
            return $fone;
2321
        } catch (Exception $exc) {
2322
            return '';
2323
        }
2324
    }
2325
2326
    /**
2327
     * unidade
2328
     * Converte a imformação de peso contida na CTe
2329
     *
2330
     * @param  string $c unidade de trafego extraida da CTe
2331
     * @return string
2332
     */
2333
    protected function unidade($c = '')
2334
    {
2335
        switch ($c) {
2336
            case '00':
2337
                $r = 'M3';
2338
                break;
2339
            case '01':
2340
                $r = 'KG';
2341
                break;
2342
            case '02':
2343
                $r = 'TON';
2344
                break;
2345
            case '03':
2346
                $r = 'UN';
2347
                break;
2348
            case '04':
2349
                $r = 'LT';
2350
                break;
2351
            case '05':
2352
                $r = 'MMBTU';
2353
                break;
2354
            default:
2355
                $r = '';
2356
        }
2357
        return $r;
2358
    }
2359
2360
    /**
2361
     * convertUnidTrafego
2362
     * Converte a imformação de peso contida na CTe
2363
     *
2364
     * @param  string $U Informação de trafego extraida da CTe
2365
     * @return string
2366
     */
2367
    protected function convertUnidTrafego($U = '')
2368
    {
2369
        if ($U) {
2370
            switch ($U) {
2371
                case '0':
2372
                    $stringU = 'Próprio';
2373
                    break;
2374
                case '1':
2375
                    $stringU = 'Mútuo';
2376
                    break;
2377
                case '2':
2378
                    $stringU = 'Rodoferroviário';
2379
                    break;
2380
                case '3':
2381
                    $stringU = 'Rodoviário';
2382
                    break;
2383
            }
2384
            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...
2385
        }
2386
    }
2387
2388
    /**
2389
     * multiUniPeso
2390
     * Fornece a imformação multiplicação de peso contida na CTe
2391
     *
2392
     * @param  interger $U Informação de peso extraida da CTe
2393
     * @return interger
2394
     */
2395
    protected function multiUniPeso($U = '')
2396
    {
2397
        if ($U === "01") {
2398
            // tonelada
2399
            //return 1000;
2400
            return 1;
2401
        }
2402
        return 1; // M3, KG, Unidade, litros, mmbtu
2403
    }
2404
2405
    protected function qrCodeDacteOs($y = 0)
2406
    {
2407
        $margemInterna = $this->margemInterna;
2408
        $barcode = new Barcode();
2409
        $bobj = $barcode->getBarcodeObj(
2410
            'QRCODE,M',
2411
            $this->qrCodMDFe,
2412
            -4,
2413
            -4,
2414
            'black',
2415
            array(-1, -1, -1, -1)
2416
        )->setBackgroundColor('white');
2417
        $qrcode = $bobj->getPngData();
2418
        $wQr = 36;
2419
        $hQr = 36;
2420
        $yQr = ($y + $margemInterna);
2421
        if ($this->orientacao == 'P') {
2422
            $xQr = 170;
2423
        } else {
2424
            $xQr = 250;
2425
        }
2426
        // prepare a base64 encoded "data url"
2427
        $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
2428
        $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
2429
    }
2430
2431
    /**
2432
     * Add the credits to the integrator in the footer message
2433
     * @param string $message
2434
     */
2435
    public function creditsIntegratorFooter($message = '')
2436
    {
2437
        $this->creditos = trim($message);
2438
    }
2439
}
2440