From ed03fdc8c8a91547ba293ef2c43cb55cef559e53 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Sun, 3 Mar 2019 14:41:34 +0200 Subject: [PATCH] Bail early if nothing to do --- src/Plugin.php | 5 +++++ 1 file changed, 5 insertions(+) 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) {