diff -ru src/LiveComponent/src/LiveComponentHydrator.php src/LiveComponent/src/LiveComponentHydrator.php --- src/LiveComponent/src/LiveComponentHydrator.php 2024-06-09 22:31:32.737914059 +0000 +++ src/LiveComponent/src/LiveComponentHydrator.php 2024-06-09 22:31:46.499399006 +0000 @@ -101,7 +101,7 @@ } catch (NoSuchPropertyException $e) { throw new \LogicException(sprintf('The writable path "%s" does not exist on the "%s" property of the "%s" component.', $path, $propertyName, $component::class), 0, $e); } catch (PropertyAccessExceptionInterface $e) { - throw new \LogicException(sprintf('The writable path "%s" on the "%s" property of the "%s" component could not be read: %s', $path, $propertyName, $component::class, $e->getMessage()), 0, $e); + throw new \LogicException(sprintf('The writable path "%s" on the "%s" property of the "%s" component could not be read: "%s".', $path, $propertyName, $component::class, $e->getMessage()), 0, $e); } // TODO: maybe we allow support the same types as LiveProps later @@ -182,7 +182,7 @@ */ if ($dehydratedUpdatedProps->hasPropValue($frontendName)) { if (!$propMetadata->isIdentityWritable()) { - throw new HydrationException(sprintf('The model "%s" was sent for update, but it is not writable. Try adding "writable: true" to the $%s property in %s.', $frontendName, $propMetadata->getName(), $component::class)); + throw new HydrationException(sprintf('The model "%s" was sent for update, but it is not writable. Try adding "writable: true" to the $%s property in "%s".', $frontendName, $propMetadata->getName(), $component::class)); } try { $propertyValue = $this->hydrateValue( @@ -321,7 +321,7 @@ 'int' => (int) $value, 'float' => (float) $value, 'bool' => self::coerceStringToBoolean($value), - default => throw new \LogicException(sprintf('Cannot coerce value "%s" to type "%s"', $value, $type)), + default => throw new \LogicException(sprintf('Cannot coerce value "%s" to type "%s".', $value, $type)), }; } @@ -348,7 +348,7 @@ private function verifyChecksum(array $identifierPops, string $error = 'Invalid checksum sent when updating the live component.'): void { if (!\array_key_exists(self::CHECKSUM_KEY, $identifierPops)) { - throw new HydrationException(sprintf('Missing %s. key', self::CHECKSUM_KEY)); + throw new HydrationException(sprintf('Missing "%s". key.', self::CHECKSUM_KEY)); } $sentChecksum = $identifierPops[self::CHECKSUM_KEY]; unset($identifierPops[self::CHECKSUM_KEY]); @@ -452,7 +452,7 @@ $collectionClass = $propMetadata->collectionValueType()->getClassName(); foreach ($value as $key => $objectItem) { if (!$objectItem instanceof $collectionClass) { - throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of %s objects, but at least on key had a different value of %s', $propMetadata->getName(), $parentObject::class, $collectionClass, get_debug_type($objectItem))); + throw new \LogicException(sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of "%s" objects, but at least on key had a different value of "%s".', $propMetadata->getName(), $parentObject::class, $collectionClass, get_debug_type($objectItem))); } $value[$key] = $this->dehydrateObjectValue($objectItem, $collectionClass, $propMetadata->getFormat(), $parentObject); @@ -605,7 +605,7 @@ if (\count($extraSentWritablePaths) > 0) { // we could show multiple fields here in the message - throw new HydrationException(sprintf('The model "%s.%s" was sent for update, but it is not writable. Try adding "writable: [\'%s\']" to the $%s property in %s.', $frontendPropName, $extraSentWritablePaths[0], $extraSentWritablePaths[0], $propMetadata->getName(), $componentClass)); + throw new HydrationException(sprintf('The model "%s.%s" was sent for update, but it is not writable. Try adding "writable: [\'%s\']" to the $%s property in "%s".', $frontendPropName, $extraSentWritablePaths[0], $extraSentWritablePaths[0], $propMetadata->getName(), $componentClass)); } return $writablePaths;