@@ -3,7 +3,20 @@ declare(strict_types=1);
33
44namespace SetBased\Stratum\Test\Application;
55
6+ use Plaisio\Exception\BadRequestException;
7+ use Plaisio\Exception\InvalidUrlException;
8+ use Plaisio\Exception\NotAuthorizedException;
9+ use Plaisio\Exception\NotPreferredUrlException;
10+ use Plaisio\ExceptionHandler\BadRequestExceptionAgent;
11+ use Plaisio\ExceptionHandler\DecodeExceptionAgent;
612use Plaisio\ExceptionHandler\ExceptionHandler;
13+ use Plaisio\ExceptionHandler\InvalidUrlExceptionAgent;
14+ use Plaisio\ExceptionHandler\NotAuthorizedExceptionAgent;
15+ use Plaisio\ExceptionHandler\NotPreferredUrlExceptionAgent;
16+ use Plaisio\ExceptionHandler\ResultExceptionAgent;
17+ use Plaisio\ExceptionHandler\ThrowableAgent;
18+ use Plaisio\Obfuscator\Exception\DecodeException;
19+ use SetBased\Stratum\Middle\Exception\ResultException;
720
821/**
922 * Concrete implementation of the exception handler.
@@ -18,27 +31,27 @@ class Foo implements ExceptionHandler
1831 {
1932 switch (true)
2033 {
21- case is_a($exception, 'Plaisio\Exception\ BadRequestException' ):
22- /** @var \Plaisio\Exception\ BadRequestException $exception */
23- $handler = new \Plaisio\ExceptionHandler\ BadRequestExceptionAgent();
34+ case is_a($exception, BadRequestException::class ):
35+ /** @var BadRequestException $exception */
36+ $handler = new BadRequestExceptionAgent();
2437 $handler->handlePrepareException($exception);
2538 break;
2639
27- case is_a($exception, 'Plaisio\Exception\ InvalidUrlException' ):
28- /** @var \Plaisio\Exception\ InvalidUrlException $exception */
29- $handler = new \Plaisio\ExceptionHandler\ InvalidUrlExceptionAgent();
40+ case is_a($exception, InvalidUrlException::class ):
41+ /** @var InvalidUrlException $exception */
42+ $handler = new InvalidUrlExceptionAgent();
3043 $handler->handlePrepareException($exception);
3144 break;
3245
33- case is_a($exception, 'Plaisio\Exception\ NotAuthorizedException' ):
34- /** @var \Plaisio\Exception\ NotAuthorizedException $exception */
35- $handler = new \Plaisio\ExceptionHandler\ NotAuthorizedExceptionAgent();
46+ case is_a($exception, NotAuthorizedException::class ):
47+ /** @var NotAuthorizedException $exception */
48+ $handler = new NotAuthorizedExceptionAgent();
3649 $handler->handlePrepareException($exception);
3750 break;
3851
39- case is_a($exception, ' Throwable' ):
52+ case is_a($exception, \ Throwable::class ):
4053 /** @var \Throwable $exception */
41- $handler = new \Plaisio\ExceptionHandler\ ThrowableAgent();
54+ $handler = new ThrowableAgent();
4255 $handler->handlePrepareException($exception);
4356 break;
4457 }
@@ -52,39 +65,39 @@ class Foo implements ExceptionHandler
5265 {
5366 switch (true)
5467 {
55- case is_a($exception, 'Plaisio\Exception\ BadRequestException' ):
56- /** @var \Plaisio\Exception\ BadRequestException $exception */
57- $handler = new \Plaisio\ExceptionHandler\ BadRequestExceptionAgent();
68+ case is_a($exception, BadRequestException::class ):
69+ /** @var BadRequestException $exception */
70+ $handler = new BadRequestExceptionAgent();
5871 $handler->handleConstructException($exception);
5972 break;
6073
61- case is_a($exception, 'Plaisio\Obfuscator\Exception\ DecodeException' ):
62- /** @var \Plaisio\Obfuscator\Exception\ DecodeException $exception */
63- $handler = new \Plaisio\ExceptionHandler\ DecodeExceptionAgent();
74+ case is_a($exception, DecodeException::class ):
75+ /** @var DecodeException $exception */
76+ $handler = new DecodeExceptionAgent();
6477 $handler->handleConstructException($exception);
6578 break;
6679
67- case is_a($exception, 'Plaisio\Exception\ InvalidUrlException' ):
68- /** @var \Plaisio\Exception\ InvalidUrlException $exception */
69- $handler = new \Plaisio\ExceptionHandler\ InvalidUrlExceptionAgent();
80+ case is_a($exception, InvalidUrlException::class ):
81+ /** @var InvalidUrlException $exception */
82+ $handler = new InvalidUrlExceptionAgent();
7083 $handler->handleConstructException($exception);
7184 break;
7285
73- case is_a($exception, 'Plaisio\Exception\ NotAuthorizedException' ):
74- /** @var \Plaisio\Exception\ NotAuthorizedException $exception */
75- $handler = new \Plaisio\ExceptionHandler\ NotAuthorizedExceptionAgent();
86+ case is_a($exception, NotAuthorizedException::class ):
87+ /** @var NotAuthorizedException $exception */
88+ $handler = new NotAuthorizedExceptionAgent();
7689 $handler->handleConstructException($exception);
7790 break;
7891
79- case is_a($exception, 'SetBased\Stratum\Middle\Exception\ ResultException' ):
80- /** @var \SetBased\Stratum\Middle\Exception\ ResultException $exception */
81- $handler = new \Plaisio\ExceptionHandler\ ResultExceptionAgent();
92+ case is_a($exception, ResultException::class ):
93+ /** @var ResultException $exception */
94+ $handler = new ResultExceptionAgent();
8295 $handler->handleConstructException($exception);
8396 break;
8497
85- case is_a($exception, ' Throwable' ):
98+ case is_a($exception, \ Throwable::class ):
8699 /** @var \Throwable $exception */
87- $handler = new \Plaisio\ExceptionHandler\ ThrowableAgent();
100+ $handler = new ThrowableAgent();
88101 $handler->handleConstructException($exception);
89102 break;
90103 }
@@ -98,39 +111,39 @@ class Foo implements ExceptionHandler
98111 {
99112 switch (true)
100113 {
101- case is_a($exception, 'Plaisio\Exception\ BadRequestException' ):
102- /** @var \Plaisio\Exception\ BadRequestException $exception */
103- $handler = new \Plaisio\ExceptionHandler\ BadRequestExceptionAgent();
114+ case is_a($exception, BadRequestException::class ):
115+ /** @var BadRequestException $exception */
116+ $handler = new BadRequestExceptionAgent();
104117 $handler->handleResponseException($exception);
105118 break;
106119
107- case is_a($exception, 'Plaisio\Obfuscator\Exception\ DecodeException' ):
108- /** @var \Plaisio\Obfuscator\Exception\ DecodeException $exception */
109- $handler = new \Plaisio\ExceptionHandler\ DecodeExceptionAgent();
120+ case is_a($exception, DecodeException::class ):
121+ /** @var DecodeException $exception */
122+ $handler = new DecodeExceptionAgent();
110123 $handler->handleResponseException($exception);
111124 break;
112125
113- case is_a($exception, 'Plaisio\Exception\ InvalidUrlException' ):
114- /** @var \Plaisio\Exception\ InvalidUrlException $exception */
115- $handler = new \Plaisio\ExceptionHandler\ InvalidUrlExceptionAgent();
126+ case is_a($exception, InvalidUrlException::class ):
127+ /** @var InvalidUrlException $exception */
128+ $handler = new InvalidUrlExceptionAgent();
116129 $handler->handleResponseException($exception);
117130 break;
118131
119- case is_a($exception, 'Plaisio\Exception\ NotAuthorizedException' ):
120- /** @var \Plaisio\Exception\ NotAuthorizedException $exception */
121- $handler = new \Plaisio\ExceptionHandler\ NotAuthorizedExceptionAgent();
132+ case is_a($exception, NotAuthorizedException::class ):
133+ /** @var NotAuthorizedException $exception */
134+ $handler = new NotAuthorizedExceptionAgent();
122135 $handler->handleResponseException($exception);
123136 break;
124137
125- case is_a($exception, 'Plaisio\Exception\ NotPreferredUrlException' ):
126- /** @var \Plaisio\Exception\ NotPreferredUrlException $exception */
127- $handler = new \Plaisio\ExceptionHandler\ NotPreferredUrlExceptionAgent();
138+ case is_a($exception, NotPreferredUrlException::class ):
139+ /** @var NotPreferredUrlException $exception */
140+ $handler = new NotPreferredUrlExceptionAgent();
128141 $handler->handleResponseException($exception);
129142 break;
130143
131- case is_a($exception, ' Throwable' ):
144+ case is_a($exception, \ Throwable::class ):
132145 /** @var \Throwable $exception */
133- $handler = new \Plaisio\ExceptionHandler\ ThrowableAgent();
146+ $handler = new ThrowableAgent();
134147 $handler->handleResponseException($exception);
135148 break;
136149 }
@@ -144,9 +157,9 @@ class Foo implements ExceptionHandler
144157 {
145158 switch (true)
146159 {
147- case is_a($exception, ' Throwable' ):
160+ case is_a($exception, \ Throwable::class ):
148161 /** @var \Throwable $exception */
149- $handler = new \Plaisio\ExceptionHandler\ ThrowableAgent();
162+ $handler = new ThrowableAgent();
150163 $handler->handleFinalizeException($exception);
151164 break;
152165 }
0 commit comments