8000 minor #39694 [PropertyAccess] remove unneeded sprintf() call (xabbuh) · symfony/symfony@04671ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 04671ee

Browse files
committed
minor #39694 [PropertyAccess] remove unneeded sprintf() call (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- [PropertyAccess] remove unneeded sprintf() call | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- a8252a4 remove unneeded sprintf() call
2 parents a902dd8 + a8252a4 commit 04671ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
398398
if (__FILE__ === $trace['file']
399399
&& $access[self::ACCESS_NAME] === $trace['function']
400400
&& $object instanceof $trace['class']
401-
&& preg_match((sprintf('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/')), $e->getMessage(), $matches)
401+
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)
402402
) {
403403
throw new AccessException(sprintf('The method "%s::%s()" returned "null", but expected type "%3$s". Did you forget to initialize a property or to make the return type nullable using "?%3$s"?', false === strpos(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: 'class').'@anonymous', $access[self::ACCESS_NAME], $matches[1]), 0, $e);
404404
}

0 commit comments

Comments
 (0)
0