Skip to content

Commit b597c4f

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Validator] Fix auto-mapping constraints should not be validated [Debug] Updated the README to deprecate the component [Cache] fix memory leak when using PhpFilesAdapter [Yaml] Implement multiline string as scalar block for tagged values [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given [FrameworkBundle] Use UserInterface to @return in getUser method [CI] Replace php7.4snapshot with php7.4 in Travis configuration [ExpressionLanguage][Node][BinaryNode] Process division by zero Fixing bad order of operations with null coalescing operator forward caught exception [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime add tags before processing them [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared [Process] change the syntax of portable prepared command lines [MonologBridge] Fix debug processor datetime type
2 parents 542a4f0 + 055fe31 commit b597c4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PropertyAccessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ public function setValue(&$objectOrArray, $propertyPath, $value)
174174
$value = $zval[self::VALUE];
175175
}
176176
} catch (\TypeError $e) {
177-
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0, $propertyPath);
177+
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0, $propertyPath, $e);
178178

179179
// It wasn't thrown in this class so rethrow it
180180
throw $e;
181181
}
182182
}
183183

184-
private static function throwInvalidArgumentException(string $message, array $trace, int $i, string $propertyPath): void
184+
private static function throwInvalidArgumentException(string $message, array $trace, int $i, string $propertyPath, \Throwable $previous = null): void
185185
{
186186
// the type mismatch is not caused by invalid arguments (but e.g. by an incompatible return type hint of the writer method)
187187
if (0 !== strpos($message, 'Argument ')) {
@@ -195,7 +195,7 @@ private static function throwInvalidArgumentException(string $message, array $tr
195195
$type = substr($message, 2 + $j, strpos($message, ' given', $j) - $j - 2);
196196
$message = substr($message, $pos, $j - $pos);
197197

198-
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given at property path "%s".', $message, 'NULL' === $type ? 'null' : $type, $propertyPath));
198+
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given at property path "%s".', $message, 'NULL' === $type ? 'null' : $type, $propertyPath), 0, $previous);
199199
}
200200
}
201201

0 commit comments

Comments
 (0)