From 608b869a20c1848c51e2325ad82fa4a96391336e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 7 Dec 2024 17:46:25 +0700 Subject: [PATCH] refactor: enable level 31: ThrowWithPreviousExceptionRector --- rector.php | 4 +--- system/Security/Security.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rector.php b/rector.php index 6dd90292df7f..4613f89fbe3c 100644 --- a/rector.php +++ b/rector.php @@ -12,7 +12,6 @@ */ use Rector\Caching\ValueObject\Storage\FileCacheStorage; -use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector; use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector; use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector; @@ -199,7 +198,6 @@ EmptyOnNullableObjectToInstanceOfRector::class, DisallowedEmptyRuleFixerRector::class, PrivatizeFinalClassPropertyRector::class, - CompleteDynamicPropertiesRector::class, BooleanInIfConditionRuleFixerRector::class, VersionCompareFuncCallToConstantRector::class, AddClosureVoidReturnTypeWhereNoReturnRector::class, @@ -213,4 +211,4 @@ // keep '\\' prefix string on string '\Foo\Bar' StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true, ]) - ->withCodeQualityLevel(27); + ->withCodeQualityLevel(31); diff --git a/system/Security/Security.php b/system/Security/Security.php index 0b51062e4cdb..4d4d856cc1d8 100644 --- a/system/Security/Security.php +++ b/system/Security/Security.php @@ -377,7 +377,7 @@ protected function derandomize(string $token): string return bin2hex(hex2bin($value) ^ hex2bin($key)); } catch (ErrorException $e) { // "hex2bin(): Hexadecimal input string must have an even length" - throw new InvalidArgumentException($e->getMessage()); + throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } }