Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mzhubail
Copy link
Contributor

re: #12070

@mzhubail
Copy link
Contributor Author

  • For now I'm not sure if this option should be added to all commands that have auditing (similar to how --audit-format is implemented. I'd like input on that. If it won't be included in all commands, I will just move the body of getAuditAbandoned in AuditCommand.

  • In AuditCammand, I removed null coalescing from $auditConfig['abandoned'] because I thought it'd be cleaner to let getAuditAbandoned handle the default values.

    One way to tackle it is to modify Composer/Config.php to make the abandoned key always present, even if null in array{ignore?: mixed, abandoned?: 'fail'|'ignore'|'report'|null}.

@Seldaek Seldaek added this to the 2.8 milestone Aug 22, 2024
@Seldaek
Copy link
Member

Seldaek commented Aug 22, 2024

  • For now I'm not sure if this option should be added to all commands that have auditing (similar to how --audit-format is implemented. I'd like input on that. If it won't be included in all commands, I will just move the body of getAuditAbandoned in AuditCommand.

I think I would just add it to AuditCommand for now to avoid polluting everything with this option which I doubt will see widesrpead use.

  • In AuditCammand, I removed null coalescing from $auditConfig['abandoned'] because I thought it'd be cleaner to let getAuditAbandoned handle the default values.

    One way to tackle it is to modify Composer/Config.php to make the abandoned key always present, even if null in array{ignore?: mixed, abandoned?: 'fail'|'ignore'|'report'|null}.

You can't change that, you'd need to change ConfigReturnTypeExtension to somehow return a non-nullable abandoned key, because Config already ensures that abandoned is always set and not null, it's just that phpstan is not aware of it..

- Use `Auditor::ABANDONEDS` in `Config.php`
- Drop `getAuditAbandoned()` from `BaseCommand.php`
@mzhubail mzhubail force-pushed the feature/abandoned-option branch from 1c320b3 to 109dd4d Compare August 22, 2024 11:57
@mzhubail mzhubail force-pushed the feature/abandoned-option branch from 109dd4d to 15ceb77 Compare August 22, 2024 12:04
Copy link
Member

@Seldaek Seldaek left a comment

Choose a reason for hiding this comment

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

Looks good to me now thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants