Skip to content

Commit d204102

Browse files
committed
php-cs-fixer fix
1 parent 9cbf8a3 commit d204102

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

src/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function denormalize(mixed $data, string $class, ?string $format = null,
7474
// scenario it will not be present in parent::getAllowedAttributes
7575
if (isset($data['id'], $context['resource_class'])) {
7676
$parentAllowedAttributes = parent::getAllowedAttributes($class, $context, true);
77-
if (is_array($parentAllowedAttributes) && !in_array('id', $parentAllowedAttributes)) {
77+
if (\is_array($parentAllowedAttributes) && !\in_array('id', $parentAllowedAttributes, true)) {
7878
unset($data['id']);
7979
}
8080
}

tests/Fixtures/TestBundle/Entity/Issue6225/Bar6225.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
namespace ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue6225;
1515

1616
use ApiPlatform\Metadata\ApiResource;
17-
use ApiPlatform\Metadata\Get;
18-
use ApiPlatform\Metadata\GetCollection;
19-
use ApiPlatform\Metadata\Link;
20-
use ApiPlatform\Metadata\Post;
21-
use ApiPlatform\Metadata\Put;
2217
use Doctrine\ORM\Mapping as ORM;
23-
use Symfony\Bridge\Doctrine\Types\UuidType;
2418
use Symfony\Component\Serializer\Annotation\Groups;
2519
use Symfony\Component\Uid\Uuid;
2620

@@ -56,7 +50,8 @@ public function getFoo(): Foo6225
5650
return $this->foo;
5751
}
5852

59-
public function setFoo(Foo6225 $foo): static {
53+
public function setFoo(Foo6225 $foo): static
54+
{
6055
$this->foo = $foo;
6156

6257
return $this;
@@ -67,7 +62,8 @@ public function getSomeProperty(): string
6762
return $this->someProperty;
6863
}
6964

70-
public function setSomeProperty(string $someProperty): static {
65+
public function setSomeProperty(string $someProperty): static
66+
{
7167
$this->someProperty = $someProperty;
7268

7369
return $this;

tests/Fixtures/TestBundle/Entity/Issue6225/Foo6225.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
namespace ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue6225;
1515

1616
use ApiPlatform\Metadata\ApiResource;
17-
use ApiPlatform\Metadata\Get;
1817
use ApiPlatform\Metadata\Patch;
1918
use ApiPlatform\Metadata\Post;
20-
use ApiPlatform\Metadata\Put;
2119
use Doctrine\ORM\Mapping as ORM;
22-
use Symfony\Bridge\Doctrine\Types\UuidType;
2320
use Symfony\Component\Serializer\Annotation\Groups;
2421
use Symfony\Component\Uid\Uuid;
2522

tests/Functional/NestedPatchTest.php

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
314
namespace ApiPlatform\Tests\Functional;
415

516
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
@@ -15,7 +26,8 @@ class NestedPatchTest extends ApiTestCase
1526

1627
protected static ?bool $alwaysBootKernel = false;
1728

18-
public static function getResources(): array {
29+
public static function getResources(): array
30+
{
1931
return [Foo6225::class, Bar6225::class];
2032
}
2133

@@ -30,12 +42,12 @@ public function testIssue6225(): void
3042
$response = self::createClient()->request('POST', '/foo6225s', [
3143
'json' => [
3244
'bar' => [
33-
'someProperty' => 'abc'
34-
]
45+
'someProperty' => 'abc',
46+
],
3547
],
3648
'headers' => [
37-
'accept' => 'application/json'
38-
]
49+
'accept' => 'application/json',
50+
],
3951
]);
4052
static::assertResponseIsSuccessful();
4153
$responseContent = json_decode($response->getContent(), true);
@@ -46,21 +58,21 @@ public function testIssue6225(): void
4658
'json' => [
4759
'bar' => [
4860
'id' => $createdBarId,
49-
'someProperty' => 'def'
50-
]
61+
'someProperty' => 'def',
62+
],
5163
],
5264
'headers' => [
5365
'accept' => 'application/json',
54-
'content-type' => 'application/merge-patch+json'
55-
]
66+
'content-type' => 'application/merge-patch+json',
67+
],
5668
]);
5769
static::assertResponseIsSuccessful();
5870
static::assertEquals([
5971
'id' => $createdFooId,
6072
'bar' => [
6173
'id' => $createdBarId,
62-
'someProperty' => 'def'
63-
]
74+
'someProperty' => 'def',
75+
],
6476
], json_decode($patchResponse->getContent(), true));
6577
}
6678
}

0 commit comments

Comments
 (0)