Skip to content

Commit 82c6db3

Browse files
Merge branch '4.4' into 5.2
* 4.4: Leverage str_contains/str_starts_with Leverage str_ends_with
2 parents a579736 + 9fcb3ac commit 82c6db3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PropertyAccessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private static function throwInvalidArgumentException(string $message, array $tr
212212
}
213213

214214
if (\PHP_VERSION_ID < 80000) {
215-
if (0 !== strpos($message, 'Argument ')) {
215+
if (!str_starts_with($message, 'Argument ')) {
216216
return;
217217
}
218218

@@ -429,7 +429,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
429429
&& $object instanceof $trace['class']
430430
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)
431431
) {
432-
throw new UninitializedPropertyException(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) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e);
432+
throw new UninitializedPropertyException(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"?', !str_contains(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e);
433433
}
434434

435435
throw $e;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/deprecation-contracts": "^2.1",
21-
"symfony/polyfill-php80": "^1.15",
21+
"symfony/polyfill-php80": "^1.16",
2222
"symfony/property-info": "^5.2"
2323
},
2424
"require-dev": {

0 commit comments

Comments
 (0)