diff --git a/src/Plugin.php b/src/Plugin.php index 7a14510..5500930 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -213,6 +213,11 @@ public function mutateNamespaces() $namespaces = array_merge($namespaces, $this->discover($package)); } + // Bail early if nothing needs to be replaced. + if (empty($namespaces)) { + return; + } + // Make sure we get all the interim namespaces too foreach ($namespaces as $ns => $null) { while (strlen($ns) > 0) {