1 | <?php |
||
7 | class Cell |
||
8 | { |
||
9 | /** |
||
10 | * Numeric cell type (whole numbers, fractional numbers, dates) |
||
11 | */ |
||
12 | const TYPE_NUMERIC = 0; |
||
13 | |||
14 | /** |
||
15 | * String (text) cell type |
||
16 | */ |
||
17 | const TYPE_STRING = 1; |
||
18 | |||
19 | /** |
||
20 | * Formula cell type |
||
21 | */ |
||
22 | const TYPE_FORMULA = 2; |
||
23 | |||
24 | /** |
||
25 | * Blank cell type |
||
26 | */ |
||
27 | const TYPE_BLANK = 3; |
||
28 | |||
29 | /** |
||
30 | * Boolean cell type |
||
31 | */ |
||
32 | const TYPE_BOOLEAN = 4; |
||
33 | |||
34 | /** |
||
35 | * Error cell type |
||
36 | */ |
||
37 | const TYPE_ERROR = 5; |
||
38 | |||
39 | /** |
||
40 | * The value of this cell |
||
41 | * @var null | mixed |
||
42 | */ |
||
43 | protected $value = null; |
||
44 | |||
45 | /** |
||
46 | * The cell type |
||
47 | * @var null |
||
48 | */ |
||
49 | protected $type = null; |
||
50 | |||
51 | /** |
||
52 | * Cell constructor. |
||
53 | * @param $value mixed |
||
54 | * @param $comment string |
||
55 | */ |
||
56 | 192 | public function __construct($value) |
|
60 | |||
61 | /** |
||
62 | * @param $value mixed |
||
63 | */ |
||
64 | 192 | public function setValue($value) |
|
69 | |||
70 | /** |
||
71 | * @return mixed|null |
||
72 | */ |
||
73 | 189 | public function getValue() |
|
77 | |||
78 | /** |
||
79 | * @return mixed|null |
||
80 | */ |
||
81 | public function getType() |
||
85 | |||
86 | /** |
||
87 | * Get the current value type |
||
88 | * @return int |
||
89 | */ |
||
90 | 192 | protected function detectType($value) |
|
104 | |||
105 | /** |
||
106 | * @return bool |
||
107 | */ |
||
108 | 36 | public function isBoolean() |
|
112 | |||
113 | /** |
||
114 | * @return bool |
||
115 | */ |
||
116 | 24 | public function isBlank() |
|
120 | |||
121 | /** |
||
122 | * @return bool |
||
123 | */ |
||
124 | public function isFormula() |
||
128 | |||
129 | /** |
||
130 | * @return bool |
||
131 | */ |
||
132 | 33 | public function isNumeric() |
|
136 | |||
137 | /** |
||
138 | * @return bool |
||
139 | */ |
||
140 | 189 | public function isString() |
|
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function isError() |
||
152 | |||
153 | /** |
||
154 | * @return string |
||
155 | */ |
||
156 | 3 | public function __toString() |
|
160 | } |
||
161 |
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..