Skip to content

Commit e3d4fa1

Browse files
committed
fix: workaround for Faker deprecation errors in PHP 8.2.
1 parent a88ceea commit e3d4fa1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

system/Debug/Exceptions.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@ public function exceptionHandler(Throwable $exception)
152152
public function errorHandler(int $severity, string $message, ?string $file = null, ?int $line = null)
153153
{
154154
if (error_reporting() & $severity) {
155+
// Workaround for Faker deprecation errors in PHP 8.2.
156+
// See https://github.com/FakerPHP/Faker/issues/479
157+
// @TODO Remove if Faker is fixed.
158+
if (
159+
$severity === E_DEPRECATED
160+
&& strpos($file, VENDORPATH . 'fakerphp/faker/') !== false
161+
) {
162+
// Ignore the error.
163+
return true;
164+
}
165+
155166
throw new ErrorException($message, 0, $severity, $file, $line);
156167
}
157168

0 commit comments

Comments
 (0)