1 | <?php |
||
13 | class Collection extends TraversableBackedCollection |
||
14 | { |
||
15 | /** |
||
16 | * @return Codepoint\Collection|Codepoint[] |
||
17 | */ |
||
18 | public function extractCodepoints() |
||
19 | { |
||
20 | return new Codepoint\Collection( |
||
21 | $this->yieldCodepoints() |
||
22 | ); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return \Generator |
||
27 | */ |
||
28 | private function yieldCodepoints() |
||
29 | { |
||
30 | /** @var CodepointAssigned $character */ |
||
31 | foreach ($this as $character) { |
||
32 | yield $character->getCodepoint(); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return static|Character[] |
||
38 | */ |
||
39 | public function getCharacters() |
||
45 | |||
46 | /** |
||
47 | * @return static|NonCharacter[] |
||
48 | */ |
||
49 | public function getNonCharacters() |
||
55 | |||
56 | /** |
||
57 | * @return static|Surrogate[] |
||
58 | */ |
||
59 | public function getSurrogates() |
||
65 | } |