From 2d178b23762bbdfdfeac0d85aaf4e73397427080 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Sun, 14 Jan 2024 14:18:58 +0700 Subject: [PATCH] chore: Ensure exception messages end in a period. --- .../Exception/CannotFindTransformerException.php | 2 +- .../Exception/TransformerReturnsUnexpectedValueException.php | 2 +- src/ObjectCache/Exception/CircularReferenceException.php | 2 +- .../Exception/SourceClassNotInInheritanceMapException.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MainTransformer/Exception/CannotFindTransformerException.php b/src/MainTransformer/Exception/CannotFindTransformerException.php index 24420284..ca24b7bf 100644 --- a/src/MainTransformer/Exception/CannotFindTransformerException.php +++ b/src/MainTransformer/Exception/CannotFindTransformerException.php @@ -31,7 +31,7 @@ public function __construct(array $sourceTypes, array $targetTypes, Context $con $targetTypes = TypeUtil::getDebugType($targetTypes); parent::__construct( - sprintf('Cannot find a matching transformer for mapping the source types "%s" to the target types "%s"', $sourceTypes, $sourceTypes), + sprintf('Cannot find a matching transformer for mapping the source types "%s" to the target types "%s".', $sourceTypes, $sourceTypes), context: $context ); } diff --git a/src/MainTransformer/Exception/TransformerReturnsUnexpectedValueException.php b/src/MainTransformer/Exception/TransformerReturnsUnexpectedValueException.php index 6e3a2071..fe6840c7 100644 --- a/src/MainTransformer/Exception/TransformerReturnsUnexpectedValueException.php +++ b/src/MainTransformer/Exception/TransformerReturnsUnexpectedValueException.php @@ -24,7 +24,7 @@ class TransformerReturnsUnexpectedValueException extends UnexpectedValueExceptio public function __construct(Type|MixedType $type, mixed $target, Context $context) { $message = sprintf( - 'Mapper returns unexpected value. Expected type "%s", but got "%s"', + 'Mapper returns unexpected value. Expected type "%s", but got "%s".', TypeUtil::getTypeString($type), get_debug_type($target), ); diff --git a/src/ObjectCache/Exception/CircularReferenceException.php b/src/ObjectCache/Exception/CircularReferenceException.php index ed1123ce..fa103eed 100644 --- a/src/ObjectCache/Exception/CircularReferenceException.php +++ b/src/ObjectCache/Exception/CircularReferenceException.php @@ -25,7 +25,7 @@ public function __construct(mixed $source, Type $targetType, Context $context = { parent::__construct( sprintf( - 'Circular reference detected when trying to get the object of type "%s" transformed to "%s"', + 'Circular reference detected when trying to get the object of type "%s" transformed to "%s".', \get_debug_type($source), TypeUtil::getDebugType($targetType) ), diff --git a/src/Transformer/Exception/SourceClassNotInInheritanceMapException.php b/src/Transformer/Exception/SourceClassNotInInheritanceMapException.php index f38eba2c..a8e0f771 100644 --- a/src/Transformer/Exception/SourceClassNotInInheritanceMapException.php +++ b/src/Transformer/Exception/SourceClassNotInInheritanceMapException.php @@ -29,7 +29,7 @@ public function __construct( ) { parent::__construct( message: sprintf( - 'Trying to map to a class with an inheritance map, but source class "%s" is not found in the "%s" attribute of the target class "%s"', + 'Trying to map to a class with an inheritance map, but source class "%s" is not found in the "%s" attribute of the target class "%s".', $sourceClass, InheritanceMap::class, $targetClass