Skip to content

fix: used finder->exclude instead of notPath for excludedDirs #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Command/ExtractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function getConfiguredFinder(Configuration $config): Finder
$finder->in($config->getDirs());

foreach ($config->getExcludedDirs() as $exclude) {
$finder->notPath($exclude);
$finder->exclude($exclude);
Copy link
Member

Choose a reason for hiding this comment

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

Hm interesting... I see notPath() could be used for excluding directories as well: https://github.com/symfony/finder/blob/231313534dded84c7ecaa79d14bc5da4ccb69b7d/Finder.php#L274-L275

I don't understand completely why it does not work 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

notPath does apply to files AND directories, while exclude only excludes directories.
So basically notPath should be used if you want to exclude EVERYTHING with a specific name.
Though, I have to say, I don't find "notPath" to be a very intuitive or self-explanatory name...

}

foreach ($config->getExcludedNames() as $exclude) {
Expand Down
2 changes: 1 addition & 1 deletion Controller/SymfonyProfilerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function editAction(Request $request, string $token): Response
return new Response($content);
}

//Assert: This is a POST request
// Assert: This is a POST request
$message->setTranslation((string) $request->request->get('translation'));
$this->storage->update($message->convertToMessage());

Expand Down