Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Configuration/DefaultConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ public function controllersToRemove(array $paths) : self

$localRelativePaths = array_map(function ($absolutePath) {
$relativePath = str_replace($this->localProjectDir, '', $absolutePath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i wonder why don't we just replace this line to $relativePath = mb_substr($absolutePath, mb_strlen($this->localProjectDir)); instead?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i get it now. Your solution indeed fix the issue you mentioned.

if (Str::startsWith($absolutePath, $this->localProjectDir)) {
$relativePath = mb_substr($absolutePath, mb_strlen($this->localProjectDir));
}

$this->validatePathIsRelativeToProject($relativePath, 'controllersToRemove');

return trim($relativePath, DIRECTORY_SEPARATOR);
Expand Down