![]() 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/old/vendor/rector/rector/src/Exception/ |
<?php declare (strict_types=1); namespace Rector\Core\Exception; use Exception; use Throwable; final class ShouldNotHappenException extends Exception { /** * @param string $message * @param int $code */ public function __construct($message = '', $code = 0, ?Throwable $throwable = null) { if ($message === '') { $message = $this->createDefaultMessageWithLocation(); } parent::__construct($message, $code, $throwable); } private function createDefaultMessageWithLocation() : string { $debugBacktrace = \debug_backtrace(); $class = $debugBacktrace[2]['class'] ?? null; $function = $debugBacktrace[2]['function']; $line = $debugBacktrace[1]['line'] ?? 0; $method = $class !== null ? $class . '::' . $function : $function; /** @var string $method */ /** @var int $line */ return \sprintf('Look at "%s()" on line %d', $method, $line); } }