From 3cccd0b16e45be1f8188722d9a3d92ff029623df Mon Sep 17 00:00:00 2001 From: fd6130 Date: Fri, 12 Nov 2021 20:17:43 +0800 Subject: [PATCH] fix relative path finding issue --- src/Configuration/DefaultConfiguration.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Configuration/DefaultConfiguration.php b/src/Configuration/DefaultConfiguration.php index 1abe5ac..5ea53b0 100644 --- a/src/Configuration/DefaultConfiguration.php +++ b/src/Configuration/DefaultConfiguration.php @@ -275,6 +275,10 @@ public function controllersToRemove(array $paths): self $localRelativePaths = array_map(function ($absolutePath) { $relativePath = str_replace($this->localProjectDir, '', $absolutePath); + if (Str::startsWith($absolutePath, $this->localProjectDir)) { + $relativePath = mb_substr($absolutePath, mb_strlen($this->localProjectDir)); + } + $this->validatePathIsRelativeToProject($relativePath, 'controllersToRemove'); return trim($relativePath, DIRECTORY_SEPARATOR);