Merge pull request #352 from flaviocopes/patch-1

Fix for PHP7
This commit is contained in:
Denis Sokolov
2015-12-14 18:14:38 +02:00
2 changed files with 19 additions and 2 deletions
+2 -2
View File
@@ -157,10 +157,10 @@ class Inspector
*
* If xdebug is installed
*
* @param Exception $e
* @param \Throwable $exception
* @return array
*/
protected function getTrace(\Exception $e)
protected function getTrace($e)
{
$traces = $e->getTrace();
+17
View File
@@ -44,6 +44,23 @@ class InspectorTest extends TestCase
$this->assertSame($outer->getLine(), $frames[0]->getLine());
}
/**
* @covers Whoops\Exception\Inspector::getFrames
*/
public function testDoesNotFailOnPHP7ErrorObject()
{
if (!class_exists('Error')) {
$this->markTestSkipped(
'PHP 5.x, the Error class is not available.'
);
}
$inner = new \Error('inner');
$outer = $this->getException('outer', 0, $inner);
$inspector = $this->getInspectorInstance($outer);
$frames = $inspector->getFrames();
$this->assertSame($outer->getLine(), $frames[0]->getLine());
}
/**
* @covers Whoops\Exception\Inspector::getExceptionName
*/