Skip to content

Commit

Permalink
[Performance] Avoid use FilesystemTweaker when no * in filePath in Re…
Browse files Browse the repository at this point in the history
…ctorConfig->import() (#4858)

* [Performance] Avoid use FilesystemTweaker when no * in filePath

* Update RectorConfig.php
  • Loading branch information
samsonasik committed Aug 26, 2023
1 parent cdd0675 commit 059c33d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ public function import(string $filePath): void
{
$paths = [$filePath];

$filesystemTweaker = new FilesystemTweaker();
$paths = $filesystemTweaker->resolveWithFnmatch($paths);
if (str_contains($filePath, '*')) {
$filesystemTweaker = new FilesystemTweaker();
$paths = $filesystemTweaker->resolveWithFnmatch($paths);
}

foreach ($paths as $path) {
$this->importFile($path);
Expand Down

0 comments on commit 059c33d

Please sign in to comment.