Skip to content

Commit 549214a

Browse files
authored
Merge pull request #2273 from antograssiot/phpstan-level6-master
Bump PHPStan analysis to level 6
2 parents 60433b3 + 7dd3ccd commit 549214a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ parameters:
2828
# https://github.com/doctrine/doctrine2/pull/7298/files
2929
- '#Strict comparison using === between null and int will always evaluate to false\.#'
3030
- '#Strict comparison using !== between null and null will always evaluate to false\.#'
31-
- '#Class ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\DummyBis not found.#'
3231
- '#Method ApiPlatform\\Core\\(Serializer\\Abstract|JsonApi\\Serializer\\)ItemNormalizer::normalizeRelation\(\) should return array\|string but returns array\|bool\|float\|int\|string\.#'
3332

3433
# Expected, due to deprecations

src/Serializer/AbstractItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
168168
$paramName = $constructorParameter->name;
169169
$key = $this->nameConverter ? $this->nameConverter->normalize($paramName) : $paramName;
170170

171-
$allowed = false === $allowedAttributes || \in_array($paramName, $allowedAttributes, true);
171+
$allowed = false === $allowedAttributes || (\is_array($allowedAttributes) && \in_array($paramName, $allowedAttributes, true));
172172
$ignored = !$this->isAllowedAttribute($class, $paramName, $format, $context);
173173
if ($constructorParameter->isVariadic()) {
174174
if ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) {

tests/EventListener/RespondListenerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public function testSetSunsetHeader()
141141
$listener->onKernelView($event);
142142

143143
$response = $event->getResponse();
144-
$this->assertEquals(new \DateTimeImmutable('tomorrow'), \DateTime::createFromFormat(DATE_RFC1123, $response->headers->get('Sunset')));
144+
/** @var string $value */
145+
$value = $response->headers->get('Sunset');
146+
$this->assertEquals(new \DateTimeImmutable('tomorrow'), \DateTime::createFromFormat(DATE_RFC1123, $value));
145147
}
146148
}

tests/Metadata/Extractor/ExtractorTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ final public function testResourcesParamatersResolution()
175175
'attributes' => null,
176176
'properties' => null,
177177
],
178-
\ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyBis::class => [
178+
'\ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyBis' => [
179179
'shortName' => null,
180180
'description' => null,
181181
'iri' => null,
@@ -301,7 +301,7 @@ final public function testResourcesParamatersResolutionWithTheSymfonyContainer()
301301
'attributes' => null,
302302
'properties' => null,
303303
],
304-
\ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyBis::class => [
304+
'\ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyBis' => [
305305
'shortName' => null,
306306
'description' => null,
307307
'iri' => null,

0 commit comments

Comments
 (0)