8000 remove unneeded sprintf() call · symfony/symfony@a8252a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a8252a4

Browse files
committed
remove unneeded sprintf() call
1 parent 04c67e6 commit a8252a4

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 num 72C5 berDiff 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