Footer   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 68
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRows() 0 4 1
A setRows() 0 4 1
A getSequence() 0 4 1
A setSequence() 0 4 1
1
<?php
2
namespace MrPrompt\Centercob\Received\Partial;
3
4
use MrPrompt\ShipmentCommon\Base\Sequence;
5
6
/**
7
 * File footer
8
 *
9
 * @author Thiago Paes <[email protected]>
10
 */
11
class Footer
12
{
13
    /**
14
     * Line lenght
15
     *
16
     * @const int
17
     */
18
    const LENGTH = 1006;
19
20
    /**
21
     * Type of register
22
     *
23
     * @var string
24
     */
25
    const TYPE = 'Z';
26
27
    /**
28
     * @var int
29
     */
30
    private $rows;
31
32
    /**
33
     * @var Sequence
34
     */
35
    private $sequence;
36
37
    /**
38
     * Constructor
39
     * @param string $row
40
     */
41 5
    public function __construct($row)
42
    {
43 5
        $this->rows = substr($row, 1, 6);
0 ignored issues
show
Documentation Bug introduced by
The property $rows was declared of type integer, but substr($row, 1, 6) is of type string. 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...
44 5
        $this->sequence = new Sequence((substr($row, 500, 6)));
45 5
    }
46
47
    /**
48
     * @return int
49
     */
50 1
    public function getRows()
51
    {
52 1
        return $this->rows;
53
    }
54
55
    /**
56
     * @param int $rows
57
     */
58 1
    public function setRows($rows = 0)
59
    {
60 1
        $this->rows = $rows;
61 1
    }
62
63
    /**
64
     * @return Sequence
65
     */
66 1
    public function getSequence()
67
    {
68 1
        return $this->sequence;
69
    }
70
71
    /**
72
     * @param Sequence $sequence
73
     */
74 1
    public function setSequence(Sequence $sequence)
75
    {
76 1
        $this->sequence = $sequence;
77 1
    }
78
}
79