[BUGFIX] PHP 7 Reflection error for default value 72/56972/5
authorDaniel Siepmann <noreply@example.com>
Tue, 15 May 2018 12:46:55 +0000 (14:46 +0200)
committerJan Helke <typo3@helke.de>
Fri, 1 Jun 2018 15:00:56 +0000 (17:00 +0200)
In PHP 7, under some circumstances the exception is not caught
as expected.
Therefore we use a check (as already done in ReflectionService.php).

Releases: 8.7, 7.6
Resolves: #85011
Change-Id: I41d58c3dbb508a7b17b4534ebd1c5ca79914af94
Reviewed-on: https://review.typo3.org/56972
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Daniel Siepmann <daniel.siepmann@typo3.org>
Tested-by: Daniel Siepmann <daniel.siepmann@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php

index e457061..887743f 100644 (file)
@@ -65,9 +65,8 @@ class ClassInfoFactory
                 $info['dependency'] = $reflectionParameter->getClass()->getName();
             }
 
-            try {
+            if ($reflectionParameter->isDefaultValueAvailable()) {
                 $info['defaultValue'] = $reflectionParameter->getDefaultValue();
-            } catch (\ReflectionException $e) {
             }
 
             $result[] = $info;