Skip to content

Commit d974f6f

Browse files
committed
Add missing dots at the end of exception messages
1 parent 5449740 commit d974f6f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

PropertyAccessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private static function throwInvalidArgumentException($message, $trace, $i, $pre
267267
$type = substr($message, 2 + $j, strpos($message, ' given', $j) - $j - 2);
268268
$message = substr($message, $pos, $j - $pos);
269269

270-
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given', $message, 'NULL' === $type ? 'null' : $type), 0, $previous);
270+
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given.', $message, 'NULL' === $type ? 'null' : $type), 0, $previous);
271271
}
272272
}
273273

@@ -591,7 +591,7 @@ private function getReadAccessInfo($class, $property)
591591
private function writeIndex($zval, $index, $value)
592592
{
593593
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
594-
throw new NoSuchIndexException(sprintf('Cannot modify index "%s" in object of type "%s" because it doesn\'t implement \ArrayAccess', $index, \get_class($zval[self::VALUE])));
594+
throw new NoSuchIndexException(sprintf('Cannot modify index "%s" in object of type "%s" because it doesn\'t implement \ArrayAccess.', $index, \get_class($zval[self::VALUE])));
595595
}
596596

597597
$zval[self::REF][$index] = $value;

PropertyPath.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct($propertyPath)
7777
return;
7878
}
7979
if (!\is_string($propertyPath)) {
80-
throw new InvalidArgumentException(sprintf('The property path constructor needs a string or an instance of "Symfony\Component\PropertyAccess\PropertyPath". Got: "%s"', \is_object($propertyPath) ? \get_class($propertyPath) : \gettype($propertyPath)));
80+
throw new InvalidArgumentException(sprintf('The property path constructor needs a string or an instance of "Symfony\Component\PropertyAccess\PropertyPath". Got: "%s".', \is_object($propertyPath) ? \get_class($propertyPath) : \gettype($propertyPath)));
8181
}
8282

8383
if ('' === $propertyPath) {
@@ -108,7 +108,7 @@ public function __construct($propertyPath)
108108
}
109109

110110
if ('' !== $remaining) {
111-
throw new InvalidPropertyPathException(sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d', $propertyPath, $remaining[0], $position));
111+
throw new InvalidPropertyPathException(sprintf('Could not parse property path "%s". Unexpected token "%s" at position %d.', $propertyPath, $remaining[0], $position));
112112
}
113113

114114
$this->length = \count($this->elements);
@@ -173,7 +173,7 @@ public function getElements()
173173
public function getElement($index)
174174
{
175175
if (!isset($this->elements[$index])) {
176-
throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
176+
throw new OutOfBoundsException(sprintf('The index %s is not within the property path.', $index));
177177
}
178178

179179
return $this->elements[$index];
@@ -185,7 +185,7 @@ public function getElement($index)
185185
public function isProperty($index)
186186
{
187187
if (!isset($this->isIndex[$index])) {
188-
throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
188+
throw new OutOfBoundsException(sprintf('The index %s is not within the property path.', $index));
189189
}
190190

191191
return !$this->isIndex[$index];
@@ -197,7 +197,7 @@ public function isProperty($index)
197197
public function isIndex($index)
198198
{
199199
if (!isset($this->isIndex[$index])) {
200-
throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
200+
throw new OutOfBoundsException(sprintf('The index %s is not within the property path.', $index));
201201
}
202202

203203
return $this->isIndex[$index];

PropertyPathBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function appendProperty($name)
9494
public function remove($offset, $length = 1)
9595
{
9696
if (!isset($this->elements[$offset])) {
97-
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
97+
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path.', $offset));
9898
}
9999

100100
$this->resize($offset, $length, 0);
@@ -149,7 +149,7 @@ public function replace($offset, $length, $path, $pathOffset = 0, $pathLength =
149149
public function replaceByIndex($offset, $name = null)
150150
{
151151
if (!isset($this->elements[$offset])) {
152-
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
152+
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path.', $offset));
153153
}
154154

155155
if (null !== $name) {
@@ -170,7 +170,7 @@ public function replaceByIndex($offset, $name = null)
170170
public function replaceByProperty($offset, $name = null)
171171
{
172172
if (!isset($this->elements[$offset])) {
173-
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
173+
throw new OutOfBoundsException(sprintf('The offset %s is not within the property path.', $offset));
174174
}
175175

176176
if (null !== $name) {

0 commit comments

Comments
 (0)