mirror of
https://github.com/filp/whoops.git
synced 2026-09-16 12:46:19 +00:00
Merge branch 'php7'
BC: typehint Conflicts: src/Whoops/Exception/Inspector.php
This commit is contained in:
@@ -6,13 +6,12 @@
|
||||
|
||||
namespace Whoops\Exception;
|
||||
|
||||
use Exception;
|
||||
use Whoops\Util\Misc;
|
||||
|
||||
class Inspector
|
||||
{
|
||||
/**
|
||||
* @var Exception
|
||||
* @var \Throwable
|
||||
*/
|
||||
private $exception;
|
||||
|
||||
@@ -27,15 +26,15 @@ class Inspector
|
||||
private $previousExceptionInspector;
|
||||
|
||||
/**
|
||||
* @param Exception $exception The exception to inspect
|
||||
* @param \Throwable $exception The exception to inspect
|
||||
*/
|
||||
public function __construct(Exception $exception)
|
||||
public function __construct($exception)
|
||||
{
|
||||
$this->exception = $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Exception
|
||||
* @return \Throwable
|
||||
*/
|
||||
public function getException()
|
||||
{
|
||||
@@ -189,10 +188,10 @@ class Inspector
|
||||
/**
|
||||
* Given an exception, generates an array in the format
|
||||
* generated by Exception::getTrace()
|
||||
* @param Exception $exception
|
||||
* @param \Throwable $exception
|
||||
* @return array
|
||||
*/
|
||||
protected function getFrameFromException(Exception $exception)
|
||||
protected function getFrameFromException($exception)
|
||||
{
|
||||
return array(
|
||||
'file' => $exception->getFile(),
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace Whoops\Handler;
|
||||
|
||||
use Exception;
|
||||
use Whoops\Exception\Inspector;
|
||||
use Whoops\Run;
|
||||
|
||||
@@ -35,7 +34,7 @@ abstract class Handler implements HandlerInterface
|
||||
private $inspector;
|
||||
|
||||
/**
|
||||
* @var Exception $exception
|
||||
* @var \Throwable $exception
|
||||
*/
|
||||
private $exception;
|
||||
|
||||
@@ -72,15 +71,15 @@ abstract class Handler implements HandlerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Exception $exception
|
||||
* @param \Throwable $exception
|
||||
*/
|
||||
public function setException(Exception $exception)
|
||||
public function setException($exception)
|
||||
{
|
||||
$this->exception = $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Exception
|
||||
* @return \Throwable
|
||||
*/
|
||||
protected function getException()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace Whoops\Handler;
|
||||
|
||||
use Exception;
|
||||
use Whoops\Exception\Inspector;
|
||||
use Whoops\Run;
|
||||
|
||||
@@ -24,10 +23,10 @@ interface HandlerInterface
|
||||
public function setRun(Run $run);
|
||||
|
||||
/**
|
||||
* @param Exception $exception
|
||||
* @param \Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function setException(Exception $exception);
|
||||
public function setException($exception);
|
||||
|
||||
/**
|
||||
* @param Inspector $inspector
|
||||
|
||||
+5
-6
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace Whoops;
|
||||
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
use Whoops\Exception\ErrorException;
|
||||
use Whoops\Exception\Inspector;
|
||||
@@ -93,10 +92,10 @@ class Run
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Exception $exception
|
||||
* @param \Throwable $exception
|
||||
* @return Inspector
|
||||
*/
|
||||
protected function getInspector(Exception $exception)
|
||||
protected function getInspector($exception)
|
||||
{
|
||||
return new Inspector($exception);
|
||||
}
|
||||
@@ -228,10 +227,10 @@ class Run
|
||||
* Handles an exception, ultimately generating a Whoops error
|
||||
* page.
|
||||
*
|
||||
* @param Exception $exception
|
||||
* @return string Output generated by handlers
|
||||
* @param \Throwable $exception
|
||||
* @return string Output generated by handlers
|
||||
*/
|
||||
public function handleException(Exception $exception)
|
||||
public function handleException($exception)
|
||||
{
|
||||
// Walk the registered handlers in the reverse order
|
||||
// they were registered, and pass off the exception
|
||||
|
||||
@@ -12,12 +12,12 @@ use Whoops\TestCase;
|
||||
class InspectorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Exception $previous
|
||||
* @return Exception
|
||||
*/
|
||||
protected function getException($message = null, $code = 0, Exception $previous = null)
|
||||
protected function getException($message = null, $code = 0, $previous = null)
|
||||
{
|
||||
return new Exception($message, $code, $previous);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class InspectorTest extends TestCase
|
||||
* @param Exception $exception|null
|
||||
* @return Whoops\Exception\Inspector
|
||||
*/
|
||||
protected function getInspectorInstance(Exception $exception = null)
|
||||
protected function getInspectorInstance($exception = null)
|
||||
{
|
||||
return new Inspector($exception);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user