[BUGFIX] Omit constructor injection for optional parameters
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Object / Container / ClassInfoFactory.php
index cb51ebb..530b271 100644 (file)
@@ -77,9 +77,11 @@ class ClassInfoFactory {
                        if ($reflectionParameter->getClass()) {
                                $info['dependency'] = $reflectionParameter->getClass()->getName();
                        }
-                       if ($reflectionParameter->isOptional()) {
+
+                       try {
                                $info['defaultValue'] = $reflectionParameter->getDefaultValue();
-                       }
+                       } catch (\ReflectionException $e) {}
+
                        $result[] = $info;
                }
                return $result;