Skip to content

Commit 77f16b5

Browse files
soyukateohhanhui
authored andcommitted
fix cs
1 parent ca9a551 commit 77f16b5

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

phpstan.neon.dist

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ parameters:
8989
path: %currentWorkingDirectory%/src/Bridge/Symfony/Bundle/Test/ApiTestAssertionsTrait.php
9090
-
9191
message: '#Service "api_platform.iri_converter" is private\.#'
92-
path: %currentWorkingDirectory%/src/Bridge/Symfony/Bundle/Test/ApiTestCase.php
92+
path: %currentWorkingDirectory%/src/Bridge/Symfony/Bundle/Test/ApiTestCase.php
9393

9494
# Expected, due to optional interfaces
9595
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryCollectionExtensionInterface::applyToCollection\(\) invoked with 5 parameters, 3-4 required\.#'
@@ -113,15 +113,22 @@ parameters:
113113
-
114114
message: '#Class Symfony\\Component\\ErrorHandler\\ErrorRenderer\\ErrorRendererInterface not found\.#'
115115
path: %currentWorkingDirectory%/tests/Fixtures/app/AppKernel.php
116+
- '#Class Symfony\\Component\\ErrorHandler\\Exception\\FlattenException not found\.#'
117+
-
118+
message: '#Class Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener not found\.#'
119+
path: %currentWorkingDirectory%/src/EventListener/ExceptionListener.php
120+
-
121+
message: '#Instantiated class Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener not found\.#'
122+
path: %currentWorkingDirectory%/src/EventListener/ExceptionListener.php
116123
-
117124
message: '#Parameter \$exception of method ApiPlatform\\Core\\Action\\ExceptionAction::__invoke\(\) has invalid typehint type Symfony\\Component\\ErrorHandler\\Exception\\FlattenException\.#'
118125
path: %currentWorkingDirectory%/src/Action/ExceptionAction.php
119-
120126
- '#Call to method get(Class|Headers|StatusCode)\(\) on an unknown class Symfony\\Component\\ErrorHandler\\Exception\\FlattenException\.#'
121-
- '#Class Symfony\\Component\\ErrorHandler\\Exception\\FlattenException not found\.#'
127+
-
128+
message: "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component.+' and 'getException' will always evaluate to false\\.#"
129+
path: %currentWorkingDirectory%/tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php
122130
-
123131
message: '#Instanceof between bool\|float\|int|null and ArrayObject will always evaluate to false\.#'
124132
paths:
125133
- %currentWorkingDirectory%/src/JsonApi/Serializer/ItemNormalizer.php
126134
- %currentWorkingDirectory%/src/Serializer/AbstractItemNormalizer.php
127-
- '#Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener#'

tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class ValidationExceptionListenerTest extends TestCase
3131
public function testNotValidationException()
3232
{
3333
$eventProphecy = $this->prophesize(ExceptionEvent::class);
34-
if(method_exists(ExceptionEvent::class, 'getException')){
34+
if (method_exists(ExceptionEvent::class, 'getException')) {
3535
$eventProphecy->getException()->willReturn(new \Exception())->shouldBeCalled();
36-
}else {
36+
} else {
3737
$eventProphecy->getThrowable()->willReturn(new \Exception())->shouldBeCalled();
3838
}
3939
$eventProphecy->setResponse()->shouldNotBeCalled();
@@ -50,9 +50,9 @@ public function testValidationException()
5050
$list = new ConstraintViolationList([]);
5151

5252
$eventProphecy = $this->prophesize(ExceptionEvent::class);
53-
if(method_exists(ExceptionEvent::class, 'getException')){
53+
if (method_exists(ExceptionEvent::class, 'getException')) {
5454
$eventProphecy->getException()->willReturn(new ValidationException($list))->shouldBeCalled();
55-
}else {
55+
} else {
5656
$eventProphecy->getThrowable()->willReturn(new ValidationException($list))->shouldBeCalled();
5757
}
5858
$eventProphecy->getRequest()->willReturn(new Request())->shouldBeCalled();

0 commit comments

Comments
 (0)