/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/error_handler.php
42 строки
1 KB
Bhavin Parmar
AC-13346:: Deprecation of E_STRICT constant in PHP 8.4
25 ноя 2024, 14:01
25 ноя 2024, 14:01
af4556d
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ /** * Set custom error handler. */ function setCustomErrorHandler() { set_error_handler( function ($errNo, $errStr, $errFile, $errLine) { $errLevel = error_reporting(); if (($errLevel & $errNo) !== 0) { $errorNames = [ E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parse', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_RECOVERABLE_ERROR => 'Recoverable Error', E_DEPRECATED => 'Deprecated', E_USER_DEPRECATED => 'User Deprecated', ]; $errName = isset($errorNames[$errNo]) ? $errorNames[$errNo] : ""; throw new \PHPUnit\Framework\Exception( sprintf("%s: %s in %s:%s.", $errName, $errStr, $errFile, $errLine), $errNo ); } } ); }