Skip to content
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

feature/ignore-interface-in-privatize-constants-command #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexndlm
Copy link

No description provided.

$excludedPaths,
static fn (SplFileInfo $splFileInfo): bool => ! str_ends_with(
$splFileInfo->getFilenameWithoutExtension(),
'Interface'
Copy link
Member

Choose a reason for hiding this comment

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

What about interface that do not have such suffix?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, do not get your idea.

Copy link
Member

Choose a reason for hiding this comment

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

This interface should be skipped too, but the there is no "Interface" suffix:

interface NotSuffixed
{
}

Copy link
Author

Choose a reason for hiding this comment

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

Parse file content for this check will be ok?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, that's the way.

Somewhere here maybe:

foreach ($phpstanResult['files'] as $fileDetail) {

Copy link
Author

Choose a reason for hiding this comment

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

I have done it another way. It does not cover all edge cases, but it should work for 99% of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants