1 | <?php |
||
13 | class Header |
||
14 | { |
||
15 | /** |
||
16 | * Line length |
||
17 | * |
||
18 | * @const int |
||
19 | */ |
||
20 | const LENGTH = 1006; |
||
21 | |||
22 | /** |
||
23 | * Type of register |
||
24 | * |
||
25 | * @const string |
||
26 | */ |
||
27 | const TYPE = 'A'; |
||
28 | |||
29 | /** |
||
30 | * Shippment code |
||
31 | * |
||
32 | * @const int |
||
33 | */ |
||
34 | const SHIPPING = 1; |
||
35 | |||
36 | /** |
||
37 | * Layout version |
||
38 | * |
||
39 | * @const int |
||
40 | */ |
||
41 | const VERSION = '00000013'; |
||
42 | |||
43 | /** |
||
44 | * Sequencial line |
||
45 | * |
||
46 | * @const int |
||
47 | */ |
||
48 | const LINE = 1; |
||
49 | |||
50 | /** |
||
51 | * Customer Code |
||
52 | * |
||
53 | * @var Customer |
||
54 | */ |
||
55 | private $customer; |
||
56 | |||
57 | /** |
||
58 | * File date creation |
||
59 | * |
||
60 | * @var DateTime |
||
61 | */ |
||
62 | private $created; |
||
63 | |||
64 | /** |
||
65 | * Sequencial number of file |
||
66 | * |
||
67 | * @var Sequence |
||
68 | */ |
||
69 | private $sequence; |
||
70 | |||
71 | /** |
||
72 | * @var string |
||
73 | */ |
||
74 | private $passed; |
||
75 | |||
76 | /** |
||
77 | * Constructor |
||
78 | * @param string $row |
||
79 | */ |
||
80 | 9 | public function __construct($row) |
|
90 | |||
91 | /** |
||
92 | * @return Customer |
||
93 | */ |
||
94 | 1 | public function getCustomer() |
|
98 | |||
99 | /** |
||
100 | * @param Customer $customer |
||
101 | */ |
||
102 | 1 | public function setCustomer(Customer $customer) |
|
106 | |||
107 | /** |
||
108 | * @return DateTime |
||
109 | */ |
||
110 | 1 | public function getCreated() |
|
114 | |||
115 | /** |
||
116 | * @param DateTime $created |
||
117 | */ |
||
118 | 1 | public function setCreated(DateTime $created) |
|
122 | |||
123 | /** |
||
124 | * @return Sequence |
||
125 | */ |
||
126 | 1 | public function getSequence() |
|
130 | |||
131 | /** |
||
132 | * @param Sequence $sequence |
||
133 | */ |
||
134 | 1 | public function setSequence(Sequence $sequence) |
|
138 | |||
139 | /** |
||
140 | * @return string |
||
141 | */ |
||
142 | 1 | public function getPassed() |
|
146 | |||
147 | /** |
||
148 | * @param string $passed |
||
149 | */ |
||
150 | 1 | public function setPassed($passed) |
|
154 | } |
||
155 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.