⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.247
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
452945
/
root
/
usr
/
share
/
php
/
Composer
/
Util
/
View File Name :
ErrorHandler.php
* Jordi Boggiano
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Util; use Composer\IO\IOInterface; use Composer\Pcre\Preg; /** * Convert PHP errors into exceptions * * @author Artem Lopata
*/ class ErrorHandler { /** @var ?IOInterface */ private static $io; /** * Error handler * * @param int $level Level of the error raised * @param string $message Error message * @param string $file Filename that the error was raised in * @param int $line Line number the error was raised at * * @static * @throws \ErrorException * @return bool */ public static function handle($level, $message, $file, $line) { // error code is not included in error_reporting if (!(error_reporting() & $level)) { return true; } if (filter_var(ini_get('xdebug.scream'), FILTER_VALIDATE_BOOLEAN)) { $message .= "\n\nWarning: You have xdebug.scream enabled, the warning above may be". "\na legitimately suppressed error that you were not supposed to see."; } if ($level !== E_DEPRECATED && $level !== E_USER_DEPRECATED) { throw new \ErrorException($message, 0, $level, $file, $line); } if (self::$io) { // ignore symfony/* deprecation warnings // TODO remove in 2.3 if (Preg::isMatch('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) { return true; } if (strpos(strtr($file, '\\', '/'), 'vendor/symfony/') !== false) { return true; } self::$io->writeError('
Deprecation Notice: '.$message.' in '.$file.':'.$line.'
'); if (self::$io->isVerbose()) { self::$io->writeError('
Stack trace:
'); self::$io->writeError(array_filter(array_map(function ($a) { if (isset($a['line'], $a['file'])) { return '
'.$a['file'].':'.$a['line'].'
'; } return null; }, array_slice(debug_backtrace(), 2)))); } } return true; } /** * Register error handler. * * @param IOInterface|null $io * * @return void */ public static function register(IOInterface $io = null) { set_error_handler(array(__CLASS__, 'handle')); error_reporting(E_ALL | E_STRICT); self::$io = $io; } }