1 | <?php |
||
12 | class FloatParser implements ParserInterface |
||
13 | { |
||
14 | /** |
||
15 | * parse given `$source` as PHP serialized float number |
||
16 | * |
||
17 | * @param Source $source parser input |
||
18 | * @return array |
||
19 | * @throws UnserializeFailedException |
||
20 | */ |
||
21 | 29 | public function parse(Source $source) |
|
43 | |||
44 | /** |
||
45 | * parse given `$source` as NAN |
||
46 | * |
||
47 | * @param Source $source input |
||
48 | * @return array |
||
49 | * @throws UnserializeFailedException |
||
50 | */ |
||
51 | 1 | private function parseNan($source) |
|
59 | |||
60 | /** |
||
61 | * parse given `$source` as INF / -INF |
||
62 | * |
||
63 | * @param Source $source input |
||
64 | * @param string $sign '-', '+' or '' |
||
65 | * @return array |
||
|
|||
66 | * @throws UnserializeFailedException |
||
67 | */ |
||
68 | 3 | private function parseInf($source, $sign) |
|
84 | |||
85 | /** |
||
86 | * parse given `$source` as sequence of DIGIT |
||
87 | * |
||
88 | * @param Source $source input |
||
89 | * @return array |
||
90 | * @throws UnserializeFailedException |
||
91 | */ |
||
92 | 22 | private function parseDigits($source) |
|
101 | |||
102 | /** |
||
103 | * parse integer part and fraction part |
||
104 | * |
||
105 | * @param Source $source input |
||
106 | * @return array |
||
107 | * @throws UnserializeFailedException |
||
108 | */ |
||
109 | 22 | private function parseDnum($source) |
|
129 | |||
130 | /** |
||
131 | * parse given `$source` as exponentail part |
||
132 | * |
||
133 | * @param Source $source input |
||
134 | * @return array |
||
135 | * @throws UnserializeFailedException |
||
136 | */ |
||
137 | 14 | private function parseExponentialPart($source) |
|
150 | } |
||
151 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.