1 | <?php |
||
9 | class Range |
||
10 | { |
||
11 | /** |
||
12 | * @var Codepoint |
||
13 | */ |
||
14 | private $start; |
||
15 | |||
16 | /** |
||
17 | * @var Codepoint |
||
18 | */ |
||
19 | private $end; |
||
20 | |||
21 | /** |
||
22 | * @param Codepoint $start |
||
23 | * @param Codepoint $end |
||
24 | * @throws InvalidRangeException |
||
25 | */ |
||
26 | protected function __construct(Codepoint $start, Codepoint $end) |
||
35 | |||
36 | /** |
||
37 | * @param Codepoint $start |
||
38 | * @param Codepoint $end |
||
39 | * @return self |
||
40 | */ |
||
41 | public static function between(Codepoint $start, Codepoint $end) |
||
45 | |||
46 | /** |
||
47 | * @param string $start |
||
48 | * @param string $end |
||
49 | * @param TransformationFormat $encoding |
||
50 | * @return self |
||
51 | */ |
||
52 | public static function betweenEncodedCharacters($start, $end, TransformationFormat $encoding) |
||
59 | |||
60 | /** |
||
61 | * @return Codepoint |
||
62 | */ |
||
63 | public function getStart() |
||
67 | |||
68 | /** |
||
69 | * @return Codepoint |
||
70 | */ |
||
71 | public function getEnd() |
||
75 | |||
76 | /** |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function representsSingleCodepoint() |
||
83 | |||
84 | /** |
||
85 | * @return Codepoint[]|Collection |
||
86 | */ |
||
87 | public function expand() |
||
93 | |||
94 | /** |
||
95 | * @return \Generator |
||
96 | */ |
||
97 | private function yieldCodepoints() |
||
106 | } |