1 | <?php |
||
19 | class File extends FileAbstract implements SourceInterface |
||
20 | { |
||
21 | use ParseHeaderSectionTrait; |
||
22 | use DataSetsFromContentTrait { getContent as private getContentIgnore; } |
||
23 | |||
24 | const HEADER_PATTERN = 'GJK_Browscap_Version'; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $releaseTime; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $version; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $type; |
||
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | * |
||
44 | * @throws ParserRuntimeException |
||
45 | * @throws SourceUnavailableException |
||
46 | */ |
||
47 | public function getReleaseTime() : int |
||
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | * |
||
59 | * @throws ParserRuntimeException |
||
60 | * @throws SourceUnavailableException |
||
61 | */ |
||
62 | public function getVersion() : int |
||
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | * |
||
74 | * @throws ParserRuntimeException |
||
75 | * @throws SourceUnavailableException |
||
76 | */ |
||
77 | public function getType() : int |
||
85 | |||
86 | /** |
||
87 | * Extracts the header data from the file. This is typically the first block in the file |
||
88 | * ofter some lines of comments, with a special section name (defined in self::HEADER_PATTERN). |
||
89 | * |
||
90 | * @throws ParserRuntimeException |
||
91 | * @throws SourceUnavailableException |
||
92 | */ |
||
93 | protected function extractHeaderData() |
||
111 | |||
112 | /** |
||
113 | * Needs to be defined again, because the trait used here replaces |
||
114 | * the method of the parent class. |
||
115 | * |
||
116 | * @inheritdoc |
||
117 | */ |
||
118 | public function getContent() : \Generator |
||
122 | } |
||
123 |