Skip to content

Commit ca20b06

Browse files
committed
Code style fixes
Signed-off-by: Jelle Deneweth <jelle.deneweth@gmail.com>
1 parent 5203895 commit ca20b06

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

spec/Exception/ApiProblemExceptionSpec.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace spec\Phpro\ApiProblem\Exception;
66

7+
use Exception;
78
use Phpro\ApiProblem\ApiProblemInterface;
89
use Phpro\ApiProblem\Exception\ApiProblemException;
910
use PhpSpec\ObjectBehavior;
@@ -23,7 +24,7 @@ public function it_is_initializable(): void
2324

2425
public function it_is_an_excpetion(): void
2526
{
26-
$this->shouldHaveType(\Exception::class);
27+
$this->shouldHaveType(Exception::class);
2728
}
2829

2930
public function it_contains_an_api_problem(ApiProblemInterface $apiProblem): void

spec/Http/ExceptionApiProblemSpec.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace spec\Phpro\ApiProblem\Http;
66

77
use Exception;
8+
use InvalidArgumentException;
89
use Phpro\ApiProblem\DebuggableApiProblemInterface;
910
use Phpro\ApiProblem\Http\ExceptionApiProblem;
1011
use Phpro\ApiProblem\Http\HttpApiProblem;
@@ -148,7 +149,7 @@ public function it_should_deal_with_string_exception_codes(): void
148149
public function it_should_use_code_as_status_code_when_valid_http_status_code_error(): void
149150
{
150151
$message = 'an honest error';
151-
$this->beConstructedWith(new \InvalidArgumentException($message, 400));
152+
$this->beConstructedWith(new InvalidArgumentException($message, 400));
152153

153154
$this->toArray()->shouldBe([
154155
'status' => 400,

src/Exception/ApiProblemException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace Phpro\ApiProblem\Exception;
66

7+
use Exception;
78
use Phpro\ApiProblem\ApiProblemInterface;
89

9-
class ApiProblemException extends \Exception
10+
class ApiProblemException extends Exception
1011
{
1112
/**
1213
* @var ApiProblemInterface

src/Http/ExceptionApiProblem.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Phpro\ApiProblem\Http;
66

7+
use function get_class;
78
use Phpro\ApiProblem\DebuggableApiProblemInterface;
89
use Throwable;
910

@@ -23,7 +24,7 @@ public function __construct(Throwable $exception)
2324
: 500;
2425

2526
parent::__construct($statusCode, [
26-
'detail' => $exception->getMessage() ?: \get_class($exception),
27+
'detail' => $exception->getMessage() ?: get_class($exception),
2728
]);
2829
}
2930

@@ -51,7 +52,7 @@ public function toDebuggableArray(): array
5152
private function serializeException(Throwable $throwable): array
5253
{
5354
return [
54-
'type' => \get_class($throwable),
55+
'type' => get_class($throwable),
5556
'message' => $throwable->getMessage(),
5657
'code' => $throwable->getCode(),
5758
'line' => $throwable->getLine(),

0 commit comments

Comments
 (0)