File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/Magento/FunctionalTestingFramework Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class ClassReader implements ClassReaderInterface
1313 * @param string $className
1414 * @return array|null
1515 * @throws \ReflectionException
16+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
1617 */
1718 public function getConstructor ($ className )
1819 {
@@ -24,8 +25,9 @@ public function getConstructor($className)
2425 /** @var $parameter \ReflectionParameter */
2526 foreach ($ constructor ->getParameters () as $ parameter ) {
2627 try {
27- $ name = $ parameter ->getType () && !$ parameter ->getType ()->isBuiltin ()
28- ? new \ReflectionClass ($ parameter ->getType ()->getName ())
28+ $ paramType = $ parameter ->getType ();
29+ $ name = ($ paramType && method_exists ($ paramType , 'isBuiltin ' ) && !$ paramType ->isBuiltin ())
30+ ? new \ReflectionClass ($ paramType ->getName ())
2931 : null ;
3032 $ result [] = [
3133 $ parameter ->getName (),
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class ClassReader
2020 * @param string $method
2121 * @return array|null
2222 * @throws \ReflectionException
23+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
2324 */
2425 public function getParameters ($ className , $ method )
2526 {
@@ -31,8 +32,9 @@ public function getParameters($className, $method)
3132 /** @var $parameter \ReflectionParameter */
3233 foreach ($ method ->getParameters () as $ parameter ) {
3334 try {
34- $ name = $ parameter ->getType () && !$ parameter ->getType ()->isBuiltin ()
35- ? new \ReflectionClass ($ parameter ->getType ()->getName ())
35+ $ paramType = $ parameter ->getType ();
36+ $ name = ($ paramType && method_exists ($ paramType , 'isBuiltin ' ) && !$ paramType ->isBuiltin ())
37+ ? new \ReflectionClass ($ paramType ->getName ())
3638 : null ;
3739 $ result [$ parameter ->getName ()] = [
3840 $ parameter ->getName (),
You can’t perform that action at this time.
0 commit comments