Passed
Push — master ( d65fb2...07d9b9 )
by Roberto
05:56 queued 03:13
created

TraitBlocoII   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 94
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 94
ccs 0
cts 85
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B blocoII() 0 91 2
1
<?php
2
3
namespace NFePHP\DA\NFe\Traits;
4
5
/**
6
 * Bloco sub cabecalho com a identificação e logo do emitente
7
 */
8
trait TraitBlocoII
9
{
10
    protected function blocoII($y)
11
    {
12
        $this->bloco2H = 12;
0 ignored issues
show
Bug introduced by
The property bloco2H 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...
13
        
14
        //$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
15
        //$this->pdf->textBox($this->margem, $y, $this->wPrint, $this->bloco2H, '', $aFont, 'T', 'C', true, '', false);
16
        
17
        if ($this->tpEmis == 9) {
0 ignored issues
show
Bug introduced by
The property tpEmis 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...
18
            $texto = "Documento Auxiliar da Nota Fiscal de Consumidor Eletronica";
19
            $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
0 ignored issues
show
Bug introduced by
The property fontePadrao 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...
20
            $y1 = $this->pdf->textBox(
0 ignored issues
show
Bug introduced by
The property pdf 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...
21
                $this->margem,
0 ignored issues
show
Bug introduced by
The property margem 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...
22
                $y,
23
                $this->wPrint,
0 ignored issues
show
Bug introduced by
The property wPrint 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...
24
                $this->bloco2H,
25
                $texto,
26
                $aFont,
27
                'T',
28
                'C',
29
                false,
30
                '',
31
                true
32
            );
33
            $texto = "Não permite aproveitamento de crédito de ICMS";
34
            $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
35
            $y1 += $this->pdf->textBox(
36
                $this->margem,
37
                $y+$y1,
38
                $this->wPrint,
39
                2,
40
                $texto,
41
                $aFont,
42
                'T',
43
                'C',
44
                false,
45
                '',
46
                true
47
            );
48
            //contingencia offline
49
            $texto = "EMITIDA EM CONTINGÊNCIA";
50
            $aFont = ['font'=> $this->fontePadrao, 'size' => 10, 'style' => 'B'];
51
            $y2 = $this->pdf->textBox(
52
                $this->margem,
53
                $y+$y1,
54
                $this->wPrint,
55
                4,
56
                $texto,
57
                $aFont,
58
                'B',
59
                'C',
60
                false,
61
                '',
62
                true
63
            );
64
            
65
            $texto = "Pendente de autorização";
66
            $aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'I'];
67
            $this->pdf->textBox(
68
                $this->margem,
69
                $y+$y1+$y2,
70
                $this->wPrint,
71
                3,
72
                $texto,
73
                $aFont,
74
                'B',
75
                'C',
76
                false,
77
                '',
78
                true
79
            );
80
        } else {
81
            $texto = "Documento Auxiliar da Nota Fiscal de Consumidor Eletronica\n"
82
                . "Não permite aproveitamento de crédito de ICMS";
83
            $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
84
            $y1 = $this->pdf->textBox(
0 ignored issues
show
Unused Code introduced by
$y1 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...
85
                $this->margem,
86
                $this->bloco1H-2,
0 ignored issues
show
Bug introduced by
The property bloco1H 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...
87
                $this->wPrint,
88
                $this->bloco2H,
89
                $texto,
90
                $aFont,
91
                'C',
92
                'C',
93
                false,
94
                '',
95
                true
96
            );
97
        }
98
        $this->pdf->dashedHLine($this->margem, $this->bloco2H+$y, $this->wPrint, 0.1, 30);
99
        return $this->bloco2H + $y;
100
    }
101
}
102