From 5482f56bf54c4d53fb96ae3259302875e2995791 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 17 Dec 2022 17:42:13 +0900 Subject: [PATCH] refactor: remove Workaround for Faker deprecation errors in PHP 8.2 --- system/Debug/Exceptions.php | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index 1449a8ab632b..2670732d19d0 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -159,11 +159,6 @@ public function exceptionHandler(Throwable $exception) public function errorHandler(int $severity, string $message, ?string $file = null, ?int $line = null) { if ($this->isDeprecationError($severity)) { - // @TODO Remove if Faker is fixed. - if ($this->isFakerDeprecationError($message, $file, $line)) { - return true; - } - if (! $this->config->logDeprecations || (bool) env('CODEIGNITER_SCREAM_DEPRECATIONS')) { throw new ErrorException($message, 0, $severity, $file, $line); } @@ -178,34 +173,6 @@ public function errorHandler(int $severity, string $message, ?string $file = nul return false; // return false to propagate the error to PHP standard error handler } - /** - * Workaround for Faker deprecation errors in PHP 8.2. - * - * @see https://github.com/FakerPHP/Faker/issues/479 - */ - private function isFakerDeprecationError(string $message, ?string $file = null, ?int $line = null) - { - if ( - defined('VENDORPATH') - && strpos($file, VENDORPATH . 'fakerphp/faker/') !== false - && $message === 'Use of "static" in callables is deprecated' - ) { - log_message( - LogLevel::WARNING, - '[DEPRECATED] {message} in {errFile} on line {errLine}.', - [ - 'message' => $message, - 'errFile' => clean_path($file ?? ''), - 'errLine' => $line ?? 0, - ] - ); - - return true; - } - - return false; - } - /** * Checks to see if any errors have happened during shutdown that * need to be caught and handle them.