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

Fix exit after WP_CLI::error #152

Merged
merged 5 commits into from
Jul 25, 2024
Merged

Fix exit after WP_CLI::error #152

merged 5 commits into from
Jul 25, 2024

Conversation

szepeviktor
Copy link
Contributor

@szepeviktor szepeviktor commented Jul 17, 2024

WP_CLI::error already exits.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Jul 22, 2024

Oh no! PHPCS goes berserk, does not know that WP_CLI::error exits.

Copy link
Contributor

@roborourke roborourke left a comment

Choose a reason for hiding this comment

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

I think this looks good but it seems to have confused the coding standards check a bit. Maybe that’s why it was implemented this way originally. I’ll see there’s an updated standard version.

@szepeviktor
Copy link
Contributor Author

Exiting in a function is very-very-very bad design.
We could add an exit; after each one.

@roborourke
Copy link
Contributor

It does make things clearer for sure, I agree on the design of WP_CLI::error(), it's too easy to forget when it's the default behaviour as well.

@szepeviktor
Copy link
Contributor Author

Done 🍏

@szepeviktor szepeviktor changed the title Remove exit after WP_CLI::error Fix exit after WP_CLI::error Jul 22, 2024
Copy link
Contributor

@roborourke roborourke left a comment

Choose a reason for hiding this comment

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

One minor change still sorry - I left suggestions inline

Copy link
Contributor

@roborourke roborourke left a comment

Choose a reason for hiding this comment

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

Thanks again!

@roborourke roborourke merged commit c8040c5 into humanmade:develop Jul 25, 2024
4 checks passed
@szepeviktor
Copy link
Contributor Author

Glad to contribute.

@szepeviktor szepeviktor deleted the patch-2 branch July 25, 2024 13:38
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.

2 participants