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

Use Throwable instead of XxxExceptions classes #319

Merged
merged 4 commits into from
Feb 10, 2020

Conversation

dayallnash
Copy link

Use Throwable instead of handling multiple types of Exception classes repeatedly

Use Throwable instead of handling multiple types of Exception classes repeatedly
Copy link
Owner

@srmklive srmklive left a comment

Choose a reason for hiding this comment

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

Can you add the same in file src/Traits/PayPalHttpClient.php?

@dayallnash
Copy link
Author

Can you add the same in file src/Traits/PayPalHttpClient.php?

No problem, all done.

I can look at potentially replacing all Catches with Throwable in case of PHP update which causes more Errors/Exceptions if you fancy it?

@srmklive
Copy link
Owner

Sure go ahead

- Catch Throwable where possible
- Convert all thrown Exceptions to RuntimeExceptions
- Convert anonymous functions to static anonymous functions (speed improvement in some cases)
- Split some complex workflows into separate chunks to return early
- Use 'use' statements where possible to avoid having \Unnecessary\Qualifiers\Everywhere
- Use strict type checking where possible
- Remove some unnecessary brackets from some clauses
- No longer use !is_null() function just use !== null instead
@dayallnash
Copy link
Author

I'm afraid that I'm not sure what styleci is complaining about.

@srmklive srmklive merged commit 403f2ca into srmklive:master Feb 10, 2020
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