From eb630158426ff5ea40820f72012230d622528eaf Mon Sep 17 00:00:00 2001 From: alvar0hurtad0 Date: Tue, 25 Jul 2023 08:14:38 +0200 Subject: [PATCH] 302 Null plugin interface --- Task/Collect/MethodCollector.php | 4 ++++ Task/Collect/PluginTypesCollector.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Task/Collect/MethodCollector.php b/Task/Collect/MethodCollector.php index f91a9620..1603bf4a 100644 --- a/Task/Collect/MethodCollector.php +++ b/Task/Collect/MethodCollector.php @@ -26,6 +26,10 @@ class MethodCollector { * - 'description': The description from the method's docblock first line. */ public function collectMethods($name) { + if (!$name) { + return []; + } + // Get a reflection class for the interface. $reflection = new \ReflectionClass($name); $methods = $reflection->getMethods(); diff --git a/Task/Collect/PluginTypesCollector.php b/Task/Collect/PluginTypesCollector.php index 36d7d9ff..8bfe10ae 100644 --- a/Task/Collect/PluginTypesCollector.php +++ b/Task/Collect/PluginTypesCollector.php @@ -614,7 +614,7 @@ protected function addPluginBaseClass(&$data) { */ protected function analysePluginTypeBaseClassFromDefiningModule($data) { // Bail if the interface doesn't have an 'Interface' suffix. - if (!preg_match('@Interface$@', $data['plugin_interface'])) { + if (!$data['plugin_interface'] || !preg_match('@Interface$@', $data['plugin_interface'])) { return; }