![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/demo.cartinsight.co/vendor/orchestra/testbench-core/src/Bootstrap/ |
<?php namespace Orchestra\Testbench\Bootstrap; use Illuminate\Log\LogManager; use Illuminate\Support\Env; use Orchestra\Testbench\Exceptions\DeprecatedException; /** * @internal */ final class HandleExceptions extends \Illuminate\Foundation\Bootstrap\HandleExceptions { /** * Testbench Class. * * @var \PHPUnit\Framework\TestCase|null */ protected $testbench; /** * Create a new exception handler instance. * * @param \PHPUnit\Framework\TestCase|null $testbench */ public function __construct($testbench = null) { $this->testbench = $testbench; } /** * Reports a deprecation to the "deprecations" logger. * * @param string $message * @param string $file * @param int $line * @param int $level * @return void * * @throws \Orchestra\Testbench\Exceptions\DeprecatedException */ public function handleDeprecationError($message, $file, $line, $level = E_DEPRECATED) { parent::handleDeprecationError($message, $file, $line, $level); $testbenchConvertDeprecationsToExceptions = Env::get('TESTBENCH_CONVERT_DEPRECATIONS_TO_EXCEPTIONS', false); if ($testbenchConvertDeprecationsToExceptions === true) { throw new DeprecatedException($message, $level, $file, $line); } } /** * Ensure the "deprecations" logger is configured. * * @return void */ protected function ensureDeprecationLoggerIsConfigured() { with(self::$app->make('config'), function ($config) { /** @var \Illuminate\Contracts\Config\Repository $config */ if ($config->get('logging.channels.deprecations')) { return; } /** @var array{channel?: string, trace?: bool}|string|null $options */ $options = $config->get('logging.deprecations'); if (\is_array($options)) { $driver = $options['channel'] ?? 'null'; } else { $driver = $options ?? 'null'; } if ($driver === 'single') { $config->set('logging.channels.deprecations', array_merge($config->get('logging.channels.single'), [ 'path' => static::$app->storagePath('logs/deprecations.log'), ])); } else { $config->set('logging.channels.deprecations', $config->get("logging.channels.{$driver}")); } $config->set('logging.deprecations', [ 'channel' => 'deprecations', 'trace' => true, ]); }); } /** * Determine if deprecation error should be ignored. * * @return bool */ protected function shouldIgnoreDeprecationErrors() { return ! class_exists(LogManager::class) || ! self::$app->hasBeenBootstrapped(); } }