Skip to content

Commit

Permalink
Merge pull request #14 from kinglozzer/php7
Browse files Browse the repository at this point in the history
FIX: PHP 7 compatibility
  • Loading branch information
camspiers authored Apr 25, 2018
2 parents 2dd5c1e + bca06b8 commit dfbe511
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"require": {
"composer/installers": "~1.0",
"monolog/monolog": "^1.7",
"filp/whoops": "^2.0"
"filp/whoops": "^2.0",
"silverstripe/framework": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"symfony/class-loader": "~2.3",
"silverstripe/framework": "3.1.*@dev"
"symfony/class-loader": "~2.3"
},
"extra": {
"branch-alias": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interface BacktraceReporter
{
/**
* Returns a backtrace for logging
* @param \Exception $exception
* @param mixed $exception
* @return array
*/
public function getBacktrace(\Exception $exception = null);
public function getBacktrace($exception = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function getBacktraceLimit()

/**
* Returns a basic backtrace
* @param \Exception $exception
* @param mixed $exception
* @return array
*/
public function getBacktrace(\Exception $exception = null)
public function getBacktrace($exception = null)
{
$skipLimit = false;

if ($exception instanceof \Exception) {
if ($exception instanceof \Exception || $exception instanceof \Throwable) {
$backtrace = $exception->getTrace();
foreach ($backtrace as $index => $backtraceCall) {
unset($backtrace[$index]['args']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public function __construct($filteredFunctions)

/**
* Returns a filtered backtrace using regular expressions
* @param \Exception $exception
* @param mixed $exception
* @return array|void
*/
public function getBacktrace(\Exception $exception = null)
public function getBacktrace($exception = null)
{
$backtrace = parent::getBacktrace($exception);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public function __construct(EnvReporter $envReporter)
}

/**
* @param \Exception $exception
* @param mixed $exception
* @param \SS_HTTPRequest $request
*/
public function reportError(\Exception $exception, \SS_HTTPRequest $request = null)
public function reportError($exception, \SS_HTTPRequest $request = null)
{
if (!$this->envReporter->isLive()) {
Debug::showError(
Expand Down
2 changes: 1 addition & 1 deletion src/Camspiers/LoggerBridge/ErrorReporter/ErrorReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
*/
interface ErrorReporter
{
public function reportError(\Exception $exception, \SS_HTTPRequest $request = null);
public function reportError($exception, \SS_HTTPRequest $request = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public function __construct(PrettyPageHandler $prettyHandler, EnvReporter $envRe
}

/**
* @param \Exception $exception
* @param mixed $exception
* @param \SS_HTTPRequest $request
*/
public function reportError(\Exception $exception, \SS_HTTPRequest $request = null)
public function reportError($exception, \SS_HTTPRequest $request = null)
{
if (!$this->envReporter->isLive()) {
$whoops = new Run();
Expand Down
4 changes: 2 additions & 2 deletions src/Camspiers/LoggerBridge/LoggerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ public function errorHandler($errno, $errstr, $errfile, $errline)

/**
* Handles uncaught exceptions
* @param \Exception $exception
* @param mixed $exception
* @return string|void
*/
public function exceptionHandler(\Exception $exception)
public function exceptionHandler($exception)
{
$context = array(
'file' => $exception->getFile(),
Expand Down

0 comments on commit dfbe511

Please sign in to comment.