-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Performance] Extract PathSkipVoter to dedicated service and call bef…
…ore Filesystem::read() (#5451) * [Performance] Extract PathSkipVoter to dedicated service and call before Filesystem::read() * cache skipped paths * [ci-review] Rector Rectify * Fix phpstan * Final touch: clean up readonly property as already in class --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
e231caa
commit f68d9f8
Showing
7 changed files
with
44 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Skipper\Skipper; | ||
|
||
use Rector\Skipper\Matcher\FileInfoMatcher; | ||
use Rector\Skipper\SkipCriteriaResolver\SkippedPathsResolver; | ||
|
||
final readonly class PathSkipper | ||
{ | ||
public function __construct( | ||
private FileInfoMatcher $fileInfoMatcher, | ||
private SkippedPathsResolver $skippedPathsResolver | ||
) { | ||
} | ||
|
||
public function shouldSkip(string $filePath): bool | ||
{ | ||
$skippedPaths = $this->skippedPathsResolver->resolve(); | ||
return $this->fileInfoMatcher->doesFileInfoMatchPatterns( | ||
$filePath, | ||
$skippedPaths | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters