1 | <?php |
||
9 | class StreamTokeniser implements TokeniserInterface |
||
10 | { |
||
11 | use TypeBuilder; |
||
12 | |||
13 | /** @var int[] */ |
||
14 | private $types; |
||
15 | /** @var int */ |
||
16 | private $maxTypeLength; |
||
17 | /** @var StreamInterface */ |
||
18 | private $stream; |
||
19 | |||
20 | /** |
||
21 | * Tokeniser constructor. |
||
22 | * |
||
23 | * @param CsvConfigurationInterface $config |
||
24 | * @param StreamInterface $stream |
||
25 | */ |
||
26 | 16 | public function __construct(CsvConfigurationInterface $config, StreamInterface $stream) |
|
37 | |||
38 | /** |
||
39 | * Loop through the stream, pulling maximum type length each time, find the largest type that matches and create a |
||
40 | * token, then move on length characters |
||
41 | * |
||
42 | * @return Iterator |
||
43 | */ |
||
44 | 15 | public function getTokens() |
|
78 | |||
79 | /** |
||
80 | * @param int $position |
||
81 | * @param string $buffer |
||
82 | * |
||
83 | * @return Token |
||
84 | */ |
||
85 | 13 | private function match($position, $buffer) |
|
95 | } |
||
96 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.