Skip to content

Commit 1d70a6e

Browse files
Merge branch '3.4' into 4.3
* 3.4: [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 forward caught exception [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime add tags before processing them [MonologBridge] Fix debug processor datetime type
2 parents 2abd699 + fd08a32 commit 1d70a6e

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($message, $trace, $i, $propertyPath)
184+
private static function throwInvalidArgumentException($message, $trace, $i, $propertyPath, \Throwable $previous = null)
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($message, $trace, $i, $pro
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)