From 26ea12883adbae477e4860561ce40fbf0686e98e Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 18 Nov 2022 13:38:18 -0500 Subject: [PATCH] Minor code cleanup --- README.md | 2 +- src/Enum/Highlight.php | 3 --- src/Row.php | 6 +++--- src/Tokens/PHP8.php | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fb17350..28170b3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A reimplementation of the [Kilo](https://viewsourcecode.org/snaptoken/kilo/index.html) tutorial in PHP. Also has some inspiration from the [Hecto](https://www.philippflenker.com/hecto/) text editor tutorial. Requires PHP 8 and FFI. ## Requirements -* PHP 8 +* PHP 8.1 * FFI enabled ## Implementation notes: diff --git a/src/Enum/Highlight.php b/src/Enum/Highlight.php index c612700..98f9ad6 100644 --- a/src/Enum/Highlight.php +++ b/src/Enum/Highlight.php @@ -186,9 +186,6 @@ enum Highlight implements JsonSerializable { T_STRING_CAST, T_UNSET_CAST => Highlight::Keyword2, - // Invalid syntax - T_BAD_CHARACTER => Highlight::Invalid, - // Comments T_DOC_COMMENT => Highlight::MultiLineComment, diff --git a/src/Row.php b/src/Row.php index 520975e..b8425eb 100644 --- a/src/Row.php +++ b/src/Row.php @@ -61,15 +61,15 @@ class Row { /** * The document that this row belongs to */ - private Document $parent, + private readonly Document $parent, /** - * @var string The raw characters in the row + * The raw characters in the row */ private string $chars, /** - * @var int The line number of the current row + * The line number of the current row */ public int $idx, ) {} diff --git a/src/Tokens/PHP8.php b/src/Tokens/PHP8.php index 782f0e3..6361ee9 100644 --- a/src/Tokens/PHP8.php +++ b/src/Tokens/PHP8.php @@ -66,7 +66,7 @@ class PHP8 extends PhpToken { return $this->tokens; } - protected function processObjectToken(\PhpToken $token): void + protected function processObjectToken(PhpToken $token): void { $currentLine = $token->line; $char = tabs_to_spaces($token->text);