Skip to content

Commit 1b22e0b

Browse files
committed
phpcs
1 parent 58ddcc8 commit 1b22e0b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/LiveComponent/src/LiveComponentHydrator.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private function hydrateValue(mixed $data, array $types, array $context, string
409409
}
410410

411411
/**
412-
* Modeled after AbstractObjectNormalizer::validateAndDenormalize()
412+
* Modeled after AbstractObjectNormalizer::validateAndDenormalize().
413413
*
414414
* @param Type[] $types
415415
*/
@@ -554,8 +554,6 @@ private function doHydrateValue(mixed $data, array $types, array $context, strin
554554
throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $fullPathForErrors, $currentClass, implode('", "', array_keys($expectedTypes)), get_debug_type($data)), $data, array_keys($expectedTypes), $context['deserialization_path'] ?? $fullPathForErrors);
555555
/* END DUPLICATION */
556556

557-
558-
559557
if (\is_string($value) && \in_array($typeString, ['int', 'float', 'bool'], true)) {
560558
return self::coerceScalarValue($value, $typeString, $allowsNull);
561559
}
@@ -716,7 +714,7 @@ private function getNormalizationContext(object $component, string $propertyName
716714
$attributeMetadata = $this->getSerializationAttributeMetadata($component, $propertyName);
717715
// passing [] for groups - not sure if we need to be smarter
718716

719-
$context = $attributeMetadata ? $attributeMetadata->getNormalizationContextForGroups([]) : [];
717+
$context = $attributeMetadata ? $attributeMetadata->getNormalizationContextForGroups([]) : [];
720718

721719
return array_merge([
722720
self::LIVE_CONTEXT => true,

src/LiveComponent/src/Normalizer/DoctrineObjectNormalizer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Doctrine\Persistence\ManagerRegistry;
1616
use Doctrine\Persistence\ObjectManager;
1717
use Psr\Container\ContainerInterface;
18-
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
1918
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
2019
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2120
use Symfony\Contracts\Service\ServiceSubscriberInterface;

src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ public function provideDehydrationHydrationTests(): iterable
697697
$prod1->name = 'item1';
698698
$prod2 = new ProductFixtureEntity();
699699
$prod2->name = 'item2';
700+
700701
return HydrationTest::create(new class() {
701702
#[LiveProp()]
702703
/** @var \Symfony\UX\LiveComponent\Tests\Fixtures\Entity\ProductFixtureEntity[] */
@@ -1232,7 +1233,7 @@ public function provideInvalidHydrationTests(): iterable
12321233
$todoList = create(TodoListFixtureEntity::class, [
12331234
'listTitle' => 'My Todo List',
12341235
])->object();
1235-
assert($todoList instanceof TodoListFixtureEntity);
1236+
\assert($todoList instanceof TodoListFixtureEntity);
12361237
// make an item with a null "name"
12371238
// but, the setName() method does not allow null
12381239
$todoItem = new TodoItemFixtureEntity();

0 commit comments

Comments
 (0)