diff --git a/src/TokensList.php b/src/TokensList.php index dd90bb991..ea41d2b86 100644 --- a/src/TokensList.php +++ b/src/TokensList.php @@ -21,17 +21,13 @@ class TokensList implements ArrayAccess { /** * The count of tokens. - * - * @var int */ - public $count = 0; + public int $count = 0; /** * The index of the next token to be returned. - * - * @var int */ - public $idx = 0; + public int $idx = 0; /** @param Token[] $tokens The array of tokens. */ public function __construct(public array $tokens = []) diff --git a/src/UtfString.php b/src/UtfString.php index 843416223..1c23d5722 100644 --- a/src/UtfString.php +++ b/src/UtfString.php @@ -33,43 +33,33 @@ class UtfString implements ArrayAccess, Stringable { /** * The raw, multi-byte string. - * - * @var string */ - public $str = ''; + public string $str = ''; /** * The index of current byte. * * For ASCII strings, the byte index is equal to the character index. - * - * @var int */ - public $byteIdx = 0; + public int $byteIdx = 0; /** * The index of current character. * * For non-ASCII strings, some characters occupy more than one byte and * the character index will have a lower value than the byte index. - * - * @var int */ - public $charIdx = 0; + public int $charIdx = 0; /** * The length of the string (in bytes). - * - * @var int */ - public $byteLen = 0; + public int $byteLen = 0; /** * The length of the string (in characters). - * - * @var int */ - public $charLen = 0; + public int $charLen = 0; /** @param string $str the string */ public function __construct(string $str) diff --git a/tests/Lexer/TokensListTest.php b/tests/Lexer/TokensListTest.php index 0fa6627a0..8df560c41 100644 --- a/tests/Lexer/TokensListTest.php +++ b/tests/Lexer/TokensListTest.php @@ -18,7 +18,7 @@ class TokensListTest extends TestCase * * @var Token[] */ - public $tokens; + public array $tokens; /** * Test setup. diff --git a/tests/benchmarks/UtfStringBench.php b/tests/benchmarks/UtfStringBench.php index f1b8b6ef2..f5af47647 100644 --- a/tests/benchmarks/UtfStringBench.php +++ b/tests/benchmarks/UtfStringBench.php @@ -10,8 +10,7 @@ class UtfStringBench { - /** @var string */ - private $testContents; + private string $testContents; /** * @BeforeMethods("setUp")