Skip to content

Commit 0986812

Browse files
Merge branch '5.2' into 5.3
* 5.2: Leverage str_contains/str_starts_with Leverage str_ends_with
2 parents 625ae53 + 82c6db3 commit 0986812

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
@@ -249,7 +249,7 @@ private static function throwInvalidArgumentException(string $message, array $tr
249249
}
250250

251251
if (\PHP_VERSION_ID < 80000) {
252-
if (0 !== strpos($message, 'Argument ')) {
252+
if (!str_starts_with($message, 'Argument ')) {
253253
return;
254254
}
255255

@@ -466,7 +466,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
466466
&& $object instanceof $trace['class']
467467
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)
468468
) {
469-
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);
469+
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);
470470
}
471471

472472
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)