File tree Expand file tree Collapse file tree 5 files changed +23
-11
lines changed Expand file tree Collapse file tree 5 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,17 @@ jobs:
66
66
- name : PHPCS check
67
67
run : vendor/bin/phpcs
68
68
69
- - name : Psalm static analysis on PHP 7.4
70
- if : matrix.php-version == '7.4'
69
+ - name : Psalm static analysis
71
70
run : vendor/bin/psalm --no-progress
72
71
73
- - name : PHPUnit run on PHP 7.4
72
+ - name : PHPUnit run with coverage on PHP 7.4
74
73
if : matrix.php-version == '7.4'
75
74
run : vendor/bin/phpunit --coverage-clover=coverage.clover
76
75
76
+ - name : PHPUnit run without coverage on PHP 8.0
77
+ if : matrix.php-version == '8.0'
78
+ run : vendor/bin/phpunit
79
+
77
80
- name : Code coverage on PHP 7.4
78
81
if : matrix.php-version == '7.4'
79
82
run : |
Original file line number Diff line number Diff line change 19
19
"docs" : " https://httpsoft.org/docs/error-handler"
20
20
},
21
21
"require" : {
22
- "php" : " ^7.4" ,
22
+ "php" : " ^7.4|^8.0 " ,
23
23
"httpsoft/http-response" : " ^1.0" ,
24
24
"psr/http-message" : " ^1.0" ,
25
25
"psr/http-server-handler" : " ^1.0" ,
26
26
"psr/http-server-middleware" : " ^1.0"
27
27
},
28
28
"require-dev" : {
29
29
"httpsoft/http-request" : " ^1.0" ,
30
- "phpunit/phpunit" : " ^9.1 " ,
30
+ "phpunit/phpunit" : " ^9.3 " ,
31
31
"squizlabs/php_codesniffer" : " ^3.5" ,
32
- "vimeo/psalm" : " ^3.12 "
32
+ "vimeo/psalm" : " ^3.14 "
33
33
},
34
34
"autoload" : {
35
35
"psr-4" : {
Original file line number Diff line number Diff line change 21
21
22
22
use const E_ERROR ;
23
23
use const E_NOTICE ;
24
+ use const E_WARNING ;
24
25
25
26
class ErrorHandlerMiddlewareTest extends TestCase implements ResponseStatusCodeInterface
26
27
{
@@ -116,7 +117,10 @@ public function testWithErrorRequestHandlerAndWithoutCaughtError(): void
116
117
117
118
public function testWithErrorRequestHandlerAndWithCaughtError (): void
118
119
{
119
- $ response = $ this ->errorHandler ->process ($ this ->request , $ this ->createErrorRequestHandler (E_NOTICE ));
120
+ $ response = $ this ->errorHandler ->process (
121
+ $ this ->request ,
122
+ $ this ->createErrorRequestHandler (E_NOTICE | E_WARNING )
123
+ );
120
124
$ this ->assertInstanceOf (ResponseInterface::class, $ response );
121
125
$ this ->assertSame (self ::STATUS_INTERNAL_SERVER_ERROR , $ response ->getStatusCode ());
122
126
$ this ->assertSame (self ::PHRASES [self ::STATUS_INTERNAL_SERVER_ERROR ], $ response ->getReasonPhrase ());
@@ -154,7 +158,10 @@ public function testWithErrorRequestHandlerAndWithAdditionOfListeners(): void
154
158
{
155
159
$ this ->errorHandler ->addListener ($ firstListener = new FirstErrorListener ());
156
160
$ this ->errorHandler ->addListener ($ secondListener = new SecondErrorListener ());
157
- $ response = $ this ->errorHandler ->process ($ this ->request , $ this ->createErrorRequestHandler (E_NOTICE ));
161
+ $ response = $ this ->errorHandler ->process (
162
+ $ this ->request ,
163
+ $ this ->createErrorRequestHandler (E_NOTICE | E_WARNING )
164
+ );
158
165
159
166
$ this ->assertInstanceOf (ResponseInterface::class, $ response );
160
167
$ this ->assertSame (self ::STATUS_INTERNAL_SERVER_ERROR , $ response ->getStatusCode ());
Original file line number Diff line number Diff line change 21
21
22
22
use const E_ERROR ;
23
23
use const E_NOTICE ;
24
+ use const E_WARNING ;
24
25
25
26
class ErrorHandlerTest extends TestCase implements ResponseStatusCodeInterface
26
27
{
@@ -111,7 +112,7 @@ public function testWithErrorRequestHandlerAndWithoutCaughtError(): void
111
112
112
113
public function testWithErrorRequestHandlerAndWithCaughtError (): void
113
114
{
114
- $ errorHandler = $ this ->createWithErrorRequestHandler (E_NOTICE );
115
+ $ errorHandler = $ this ->createWithErrorRequestHandler (E_NOTICE | E_WARNING );
115
116
$ response = $ errorHandler ->handle ($ this ->request );
116
117
$ this ->assertInstanceOf (ResponseInterface::class, $ response );
117
118
$ this ->assertSame (self ::STATUS_INTERNAL_SERVER_ERROR , $ response ->getStatusCode ());
@@ -150,7 +151,7 @@ public function testWithThrowableRequestHandlerAndWithAdditionOfListeners(): voi
150
151
151
152
public function testWithErrorRequestHandlerAndWithAdditionOfListeners (): void
152
153
{
153
- $ errorHandler = $ this ->createWithErrorRequestHandler (E_NOTICE );
154
+ $ errorHandler = $ this ->createWithErrorRequestHandler (E_NOTICE | E_WARNING );
154
155
$ errorHandler ->addListener ($ firstListener = new FirstErrorListener ());
155
156
$ errorHandler ->addListener ($ secondListener = new SecondErrorListener ());
156
157
$ response = $ errorHandler ->handle ($ this ->request );
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ class ErrorRequestHandler implements RequestHandlerInterface
19
19
*/
20
20
public function handle (ServerRequestInterface $ request ): ResponseInterface
21
21
{
22
- $ variable = $ undefined ;
22
+ $ array = [];
23
+ $ array ['undefined ' ];
23
24
return ResponseFactory::create ();
24
25
}
25
26
}
You can’t perform that action at this time.
0 commit comments