From d75b8f5535ee4db6ac72bfb3ad00e22c436284e9 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sun, 22 Oct 2023 00:32:51 +0200 Subject: [PATCH] Made Decoder::castInteger() final The method never needs to be overridden and it allows the optimizer to skip some type checking --- src/Decoder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Decoder.php b/src/Decoder.php index b7cc0e9..2e90ecf 100644 --- a/src/Decoder.php +++ b/src/Decoder.php @@ -66,7 +66,7 @@ final protected function __construct(protected readonly string $bencoded) /** * Cast given string as an integer and check for clamping */ - protected function castInteger(string $string, int $clamp): int + final protected function castInteger(string $string, int $clamp): int { $value = (int) $string; if ($value === $clamp && !is_int(+$string))