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

Return exit code from CLI::run(), rather than exiting #105

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

martin-rueegg
Copy link
Contributor

When using CLI from another script, exiting straight from run() method does not allow custom error handling.

Returning the exit code to the invoking script and exiting there allows custom error handling in an external script, while remaining completely backwards-compatible.

@theseer
Copy link
Owner

theseer commented Sep 18, 2023

Nice idea. Why ever I hadn't done that in the first place...

Thanks!

@theseer theseer merged commit 2684aea into theseer:master Sep 18, 2023
7 checks passed
@martin-rueegg
Copy link
Contributor Author

No worries, and welcome! :-)

However, I just missed two return points! Was just a second to late!

@theseer
Copy link
Owner

theseer commented Sep 18, 2023

Just add a new PR for those.

@martin-rueegg
Copy link
Contributor Author

martin-rueegg commented Sep 18, 2023

Ok, so I'm not creating a new one.

Would you also mind to ad the return type int?

master...metaworx:theseer_autoload:enh/return-exit-code

@theseer
Copy link
Owner

theseer commented Sep 18, 2023

Return type hints of int are not PHP 5.3 compliant.

Yes, this project is that old, and I'd have to cleanup a lot to justify the upgrade. Something I'd certainly like to do, but i won't have time for in any somewhat near future.

@martin-rueegg
Copy link
Contributor Author

I see. Thanks for the heads-up

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