File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace spec \Phpro \ApiProblem \Exception ;
66
7+ use Exception ;
78use Phpro \ApiProblem \ApiProblemInterface ;
89use Phpro \ApiProblem \Exception \ApiProblemException ;
910use 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
Original file line number Diff line number Diff line change 55namespace spec \Phpro \ApiProblem \Http ;
66
77use Exception ;
8+ use InvalidArgumentException ;
89use Phpro \ApiProblem \DebuggableApiProblemInterface ;
910use Phpro \ApiProblem \Http \ExceptionApiProblem ;
1011use 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 ,
Original file line number Diff line number Diff line change 44
55namespace Phpro \ApiProblem \Exception ;
66
7+ use Exception ;
78use Phpro \ApiProblem \ApiProblemInterface ;
89
9- class ApiProblemException extends \ Exception
10+ class ApiProblemException extends Exception
1011{
1112 /**
1213 * @var ApiProblemInterface
Original file line number Diff line number Diff line change 44
55namespace Phpro \ApiProblem \Http ;
66
7+ use function get_class ;
78use Phpro \ApiProblem \DebuggableApiProblemInterface ;
89use 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 (),
You can’t perform that action at this time.
0 commit comments