8000 Throw less misleading exception when property access not found · symfony/symfony@ec28da4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec28da4

Browse files
bramtweed
8000
egolfnicolas-grekas
authored andcommitted
Throw less misleading exception when property access not found
1 parent 73099f3 commit ec28da4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ private function writeProperty($zval, $property, $value)
608608
// fatal error.
609609

610610
$object->$property = $value;
611+
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
612+
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s".', $property));
611613
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
612614
$object->{$access[self::ACCESS_NAME]}($value);
613615
} else {

0 commit comments

Comments
 (0)
0