Separate multi-block comments; update README

This commit is contained in:
2024-12-24 15:01:55 +01:00
parent 623b939df1
commit 109ae71059
5 changed files with 65 additions and 9 deletions

View File

@@ -28,6 +28,8 @@ class FitsHeader
*
* From the spec: each keyword record, including
* any comments, is at most 80 bytes long
* @todo Comments and keyword values could span more
than one 80-bytes block...
* @return Keyword[]
*/
private function readKeywords(): array
@@ -50,6 +52,11 @@ class FitsHeader
$name = $keyVal[0];
$value = $keyVal[1] ?? '';
if (str_starts_with($name, 'COMMENT')) {
$value = explode('COMMENT', $name)[1];
$name = 'COMMENT';
}
$keywords[] = new Keyword(
name : $name,
value : $value,