Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / phpspec / prophecy / src / Prophecy / Doubler / ClassPatch / MagicCallPatch.php
index 5f2c607719c5b2e5e9757c8f2b5f968df3b72b28..9ff49cd7770ca6fa61b79977eef31cd92abc6455 100644 (file)
@@ -58,20 +58,25 @@ class MagicCallPatch implements ClassPatchInterface
 
         foreach ($types as $type) {
             $reflectionClass = new \ReflectionClass($type);
-            $tagList = $this->tagRetriever->getTagList($reflectionClass);
 
-            foreach($tagList as $tag) {
-                $methodName = $tag->getMethodName();
+            while ($reflectionClass) {
+                $tagList = $this->tagRetriever->getTagList($reflectionClass);
 
-                if (empty($methodName)) {
-                    continue;
-                }
+                foreach ($tagList as $tag) {
+                    $methodName = $tag->getMethodName();
+
+                    if (empty($methodName)) {
+                        continue;
+                    }
 
-                if (!$reflectionClass->hasMethod($methodName)) {
-                    $methodNode = new MethodNode($methodName);
-                    $methodNode->setStatic($tag->isStatic());
-                    $node->addMethod($methodNode);
+                    if (!$reflectionClass->hasMethod($methodName)) {
+                        $methodNode = new MethodNode($methodName);
+                        $methodNode->setStatic($tag->isStatic());
+                        $node->addMethod($methodNode);
+                    }
                 }
+
+                $reflectionClass = $reflectionClass->getParentClass();
             }
         }
     }