Skip to content

Commit 92518df

Browse files
committed
remove unused function and change on errors messages
1 parent 6d35c2d commit 92518df

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/LiveComponent/src/LiveComponentHydrator.php

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ private function dehydrateValue(mixed $value, LivePropMetadata $propMetadata, ob
355355

356356
if ($propMetadata->useSerializerForHydration()) {
357357
if (!interface_exists(NormalizerInterface::class)) {
358-
throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" is using the serializer to hydrate, but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
358+
throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" has "useSerializerForHydration: true", but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
359359
}
360360

361361
return $this->normalizer->normalize($value, 'json', $propMetadata->serializationContext());
@@ -436,7 +436,7 @@ private function hydrateValue(mixed $value, LivePropMetadata $propMetadata, obje
436436

437437
if ($propMetadata->useSerializerForHydration()) {
438438
if (!interface_exists(DenormalizerInterface::class)) {
439-
throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" is using the serializer to hydrate, but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
439+
throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" has "useSerializerForHydration: true", but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
440440
}
441441

442442
return $this->normalizer->denormalize($value, $propMetadata->getType(), 'json', $propMetadata->serializationContext());
@@ -538,23 +538,6 @@ private function isValueValidDehydratedValue(mixed $value): bool
538538
return true;
539539
}
540540

541-
private function getNonScalarKeys(array $value, string $path = ''): array
542-
{
543-
$nonScalarKeys = [];
544-
foreach ($value as $k => $v) {
545-
if (\is_array($v)) {
546-
$nonScalarKeys = array_merge($nonScalarKeys, $this->getNonScalarKeys($v, sprintf('%s.%s', $path, $k)));
547-
continue;
548-
}
549-
550-
if (!$this->isValueValidDehydratedValue($v)) {
551-
$nonScalarKeys[sprintf('%s.%s', $path, $k)] = get_debug_type($v);
552-
}
553-
}
554-
555-
return $nonScalarKeys;
556-
}
557-
558541
/**
559542
* Allows for specific keys to be written to a "fully-writable" array.
560543
*

0 commit comments

Comments
 (0)