1 | <?php |
||
26 | class Database |
||
27 | { |
||
28 | /** |
||
29 | * @var Repository |
||
30 | */ |
||
31 | private $sourceRepository; |
||
32 | |||
33 | /** |
||
34 | * @param Repository $sourceRepository |
||
35 | */ |
||
36 | public function __construct(Repository $sourceRepository) |
||
40 | |||
41 | /** |
||
42 | * @return static |
||
43 | */ |
||
44 | public static function fromDisk() |
||
50 | |||
51 | /** |
||
52 | * @param Codepoint $codepoint |
||
53 | * @return CodepointAssigned |
||
54 | * @throws CharacterNotFoundException |
||
55 | * @throws InvalidArgumentException |
||
56 | * @throws OutOfRangeException |
||
57 | */ |
||
58 | public function getByCodepoint(Codepoint $codepoint) |
||
62 | |||
63 | /** |
||
64 | * @param Codepoint\Collection $codepoints |
||
65 | * @return Character\Collection|CodepointAssigned[] |
||
66 | */ |
||
67 | public function getByCodepoints(Codepoint\Collection $codepoints) |
||
71 | |||
72 | /** |
||
73 | * @param Codepoint $codepoint |
||
74 | * @return Character |
||
75 | * @throws CharacterNotFoundException |
||
76 | */ |
||
77 | public function getCharacterByCodepoint(Codepoint $codepoint) |
||
87 | |||
88 | /** |
||
89 | * @return Collection |
||
90 | */ |
||
91 | public function all() |
||
95 | |||
96 | /** |
||
97 | * @return Collection |
||
98 | */ |
||
99 | public function onlyCharacters() |
||
105 | |||
106 | /** |
||
107 | * @return Collection |
||
108 | */ |
||
109 | public function onlyNonCharacters() |
||
115 | |||
116 | /** |
||
117 | * @return Collection |
||
118 | */ |
||
119 | public function onlySurrogates() |
||
125 | |||
126 | /** |
||
127 | * @param callable $filter |
||
128 | * @return Collection |
||
129 | */ |
||
130 | private function filterWith(callable $filter) |
||
135 | |||
136 | /** |
||
137 | * @param Block $block |
||
138 | * @throws Repository\BlockNotFoundException |
||
139 | * @return Codepoint\Range\Collection |
||
140 | */ |
||
141 | public function getCodepointsByBlock(Block $block) |
||
145 | |||
146 | /** |
||
147 | * @return int |
||
148 | */ |
||
149 | public function getSize() |
||
153 | |||
154 | /** |
||
155 | * @return Repository |
||
156 | */ |
||
157 | private static function createFileRepository() |
||
170 | } |