Skip to content

Commit a1162d3

Browse files
committed
Add missing dots at the end of exception messages
1 parent f8b9983 commit a1162d3

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

Encoder/XmlEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ private function buildXml(\DOMNode $parentNode, $data, $xmlRootNodeName = null)
431431
return $this->appendNode($parentNode, $data, 'data');
432432
}
433433

434-
throw new NotEncodableValueException(sprintf('An unexpected value could not be serialized: %s', !\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));
434+
throw new NotEncodableValueException(sprintf('An unexpected value could not be serialized: %s.', !\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));
435435
}
436436

437437
/**

Mapping/Factory/ClassResolverTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function getClass($value)
4242
}
4343

4444
if (!\is_object($value)) {
45-
throw new InvalidArgumentException(sprintf('Cannot create metadata for non-objects. Got: "%s"', \gettype($value)));
45+
throw new InvalidArgumentException(sprintf('Cannot create metadata for non-objects. Got: "%s".', \gettype($value)));
4646
}
4747

4848
return \get_class($value);

Mapping/Loader/FileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ abstract class FileLoader implements LoaderInterface
3030
public function __construct($file)
3131
{
3232
if (!is_file($file)) {
33-
throw new MappingException(sprintf('The mapping file %s does not exist', $file));
33+
throw new MappingException(sprintf('The mapping file %s does not exist.', $file));
3434
}
3535

3636
if (!is_readable($file)) {
37-
throw new MappingException(sprintf('The mapping file %s is not readable', $file));
37+
throw new MappingException(sprintf('The mapping file %s is not readable.', $file));
3838
}
3939

4040
$this->file = $file;

Mapping/Loader/LoaderChain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(array $loaders)
4040
{
4141
foreach ($loaders as $loader) {
4242
if (!$loader instanceof LoaderInterface) {
43-
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', \get_class($loader)));
43+
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface.', \get_class($loader)));
4444
}
4545
}
4646

Normalizer/AbstractNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function handleCircularReference($object)
185185
return \call_user_func($this->circularReferenceHandler, $object);
186186
}
187187

188-
throw new CircularReferenceException(sprintf('A circular reference has been detected when serializing the object of class "%s" (configured limit: %d)', \get_class($object), $this->circularReferenceLimit));
188+
throw new CircularReferenceException(sprintf('A circular reference has been detected when serializing the object of class "%s" (configured limit: %d).', \get_class($object), $this->circularReferenceLimit));
189189
}
190190

191191
/**
@@ -388,7 +388,7 @@ protected function denormalizeParameter(\ReflectionClass $class, \ReflectionPara
388388
try {
389389
if (null !== $parameter->getClass()) {
390390
if (!$this->serializer instanceof DenormalizerInterface) {
391-
throw new LogicException(sprintf('Cannot create an instance of %s from serialized data because the serializer inject in "%s" is not a denormalizer', $parameter->getClass(), static::class));
391+
throw new LogicException(sprintf('Cannot create an instance of %s from serialized data because the serializer inject in "%s" is not a denormalizer.', $parameter->getClass(), static::class));
392392
}
393393
$parameterClass = $parameter->getClass()->getName();
394394

Normalizer/AbstractObjectNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function normalize($object, $format = null, array $context = [])
9191

9292
foreach ($stack as $attribute => $attributeValue) {
9393
if (!$this->serializer instanceof NormalizerInterface) {
94-
throw new LogicException(sprintf('Cannot normalize attribute "%s" because the injected serializer is not a normalizer', $attribute));
94+
throw new LogicException(sprintf('Cannot normalize attribute "%s" because the injected serializer is not a normalizer.', $attribute));
9595
}
9696

9797
$data = $this->updateData($data, $attribute, $this->serializer->normalize($attributeValue, $format, $this->createChildContext($context, $attribute, $format)));
@@ -268,7 +268,7 @@ private function validateAndDenormalize($currentClass, $attribute, $data, $forma
268268

269269
if (Type::BUILTIN_TYPE_OBJECT === $builtinType) {
270270
if (!$this->serializer instanceof DenormalizerInterface) {
271-
throw new LogicException(sprintf('Cannot denormalize attribute "%s" for class "%s" because injected serializer is not a denormalizer', $attribute, $class));
271+
throw new LogicException(sprintf('Cannot denormalize attribute "%s" for class "%s" because injected serializer is not a denormalizer.', $attribute, $class));
272272
}
273273

274274
$childContext = $this->createChildContext($context, $attribute, $format);

Normalizer/DateTimeNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
101101

102102
$dateTimeErrors = \DateTime::class === $type ? \DateTime::getLastErrors() : \DateTimeImmutable::getLastErrors();
103103

104-
throw new NotNormalizableValueException(sprintf('Parsing datetime string "%s" using format "%s" resulted in %d errors:'."\n".'%s', $data, $dateTimeFormat, $dateTimeErrors['error_count'], implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))));
104+
throw new NotNormalizableValueException(sprintf('Parsing datetime string "%s" using format "%s" resulted in %d errors:.'."\n".'%s', $data, $dateTimeFormat, $dateTimeErrors['error_count'], implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))));
105105
}
106106

107107
try {

Normalizer/JsonSerializableNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function normalize($object, $format = null, array $context = [])
3535
}
3636

3737
if (!$this->serializer instanceof NormalizerInterface) {
38-
throw new LogicException('Cannot normalize object because injected serializer is not a normalizer');
38+
throw new LogicException('Cannot normalize object because injected serializer is not a normalizer.');
3939
}
4040

4141
return $this->serializer->normalize($object->jsonSerialize(), $format, $context);

Serializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function __construct(array $normalizers = [], array $encoders = [])
109109
final public function serialize($data, $format, array $context = [])
110110
{
111111
if (!$this->supportsEncoding($format, $context)) {
112-
throw new NotEncodableValueException(sprintf('Serialization for the format %s is not supported', $format));
112+
throw new NotEncodableValueException(sprintf('Serialization for the format %s is not supported.', $format));
113113
}
114114

115115
if ($this->encoder->needsNormalization($format, $context)) {
@@ -125,7 +125,7 @@ final public function serialize($data, $format, array $context = [])
125125
final public function deserialize($data, $type, $format, array $context = [])
126126
{
127127
if (!$this->supportsDecoding($format, $context)) {
128-
throw new NotEncodableValueException(sprintf('Deserialization for the format %s is not supported', $format));
128+
throw new NotEncodableValueException(sprintf('Deserialization for the format %s is not supported.', $format));
129129
}
130130

131131
$data = $this->decode($data, $format, $context);
@@ -164,7 +164,7 @@ public function normalize($data, $format = null, array $context = [])
164164
throw new NotNormalizableValueException(sprintf('Could not normalize object of type %s, no supporting normalizer found.', \get_class($data)));
165165
}
166166

167-
throw new NotNormalizableValueException(sprintf('An unexpected value could not be normalized: %s', !\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));
167+
throw new NotNormalizableValueException(sprintf('An unexpected value could not be normalized: %s.', !\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));
168168
}
169169

170170
/**

0 commit comments

Comments
 (0)