You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 4.4:
[HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
[PropertyAccess] Fix handling of uninitialized property of anonymous class
[DependencyInjection] fix test
ResolveBindingsPass remove loading of class iterable
[FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
[DependencyInjection] Fix nested env var with resolve processor
Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
allow a zero time-limit
[DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
[Validators] Add translations for Slovak #43735
if (\PHP_VERSION_ID >= 70400 && preg_match('/^Typed property ([\w\\\]+)::\$(\w+) must not be accessed before initialization$/', $e->getMessage(), $matches)) {
486
-
$r = new \ReflectionProperty($matches[1], $matches[2]);
485
+
if (\PHP_VERSION_ID >= 70400 && preg_match('/^Typed property ('.preg_quote(get_debug_type($object), '/').')::\$(\w+) must not be accessed before initialization$/', $e->getMessage(), $matches)) {
486
+
$r = new \ReflectionProperty($class, $matches[2]);
thrownewUninitializedPropertyException(sprintf('The property "%s::$%s" is not readable because it is typed "%s". You should initialize it or declare a default value instead.', $r->getDeclaringClass()->getName(), $r->getName(), $type), 0, $e);
489
+
thrownewUninitializedPropertyException(sprintf('The property "%s::$%s" is not readable because it is typed "%s". You should initialize it or declare a default value instead.', $matches[1], $r->getName(), $type), 0, $e);
$this->expectExceptionMessage('The method "class@anonymous::getUninitialized()" returned "null", but expected type "array". Did you forget to initialize a property or to make the return type nullable using "?array"?');
196
195
197
196
$object = eval('return new class() {
@@ -206,9 +205,44 @@ public function getUninitialized(): array
$this->expectExceptionMessage('The property "class@anonymous::$uninitialized" is not readable because it is typed "string". You should initialize it or declare a default value instead.');
$this->expectExceptionMessage('The property "class@anonymous::$uninitialized" is not readable because it is typed "string". You should initialize it or declare a default value instead.');
$this->expectExceptionMessage('The method "stdClass@anonymous::getUninitialized()" returned "null", but expected type "array". Did you forget to initialize a property or to make the return type nullable using "?array"?');
213
247
214
248
$object = eval('return new class() extends \stdClass {
@@ -225,7 +259,7 @@ public function getUninitialized(): array
$this->expectExceptionMessage('The method "Symfony\Component\PropertyAccess\Tests\Fixtures\UninitializedPrivateProperty@anonymous::getUninitialized()" returned "null", but expected type "array". Did you forget to initialize a property or to make the return type nullable using "?array"?');
230
264
231
265
$object = eval('return new class() extends \Symfony\Component\PropertyAccess\Tests\Fixtures\UninitializedPrivateProperty {};');
0 commit comments