Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 23, 2018
1 parent 283d84f commit bce5026
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/Framework/ExceptionWrapper.php
Expand Up @@ -121,15 +121,17 @@ public function getOriginalException(): ?Throwable
* Approach works both for var_dump() and var_export() and print_r()
*
* @param null|Throwable $exceptionToStore
*
* @return null|Throwable
*/
private function originalException(Throwable $exceptionToStore = null): ?Throwable
{
static $originalExceptions;
$instanceId = spl_object_hash($this);
$instanceId = \spl_object_hash($this);
if ($exceptionToStore) {
$originalExceptions[$instanceId] = $exceptionToStore;
}

return $originalExceptions[$instanceId] ?? null;
}
}
6 changes: 3 additions & 3 deletions tests/Framework/ExceptionWrapperTest.php
Expand Up @@ -17,7 +17,7 @@ class ExceptionWrapperTest extends TestCase
*/
public function testGetOriginalException(): void
{
$e = new \BadFunctionCallException('custom class exception');
$e = new \BadFunctionCallException('custom class exception');
$wrapper = new ExceptionWrapper($e);

$this->assertInstanceOf(\BadFunctionCallException::class, $wrapper->getOriginalException());
Expand All @@ -28,7 +28,7 @@ public function testGetOriginalException(): void
*/
public function testGetOriginalExceptionWithPrevious(): void
{
$e = new \BadFunctionCallException('custom class exception', 0, new \Exception('previous'));
$e = new \BadFunctionCallException('custom class exception', 0, new \Exception('previous'));
$wrapper = new ExceptionWrapper($e);

$this->assertInstanceOf(\BadFunctionCallException::class, $wrapper->getOriginalException());
Expand All @@ -39,7 +39,7 @@ public function testGetOriginalExceptionWithPrevious(): void
*/
public function testNoOriginalExceptionInStacktrace(): void
{
$e = new \BadFunctionCallException('custom class exception');
$e = new \BadFunctionCallException('custom class exception');
$wrapper = new ExceptionWrapper($e);

// Replace the only mention of "BadFunctionCallException" in wrapper
Expand Down

0 comments on commit bce5026

Please sign in to comment.