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

Refactor methods to have nullable return types #95

Merged
merged 7 commits into from
Jun 25, 2019

Conversation

sirbrillig
Copy link
Owner

This shouldn't have any functional change, but it refactors a bunch of methods which currently return a value or false to return a value or null. Since PHP 7.1 supports nullable return types, this pattern has been shown to be more standard than the ... "falsable" 🤔 return type that I had been using to signal failure.

*
* @return string
*/
protected function getScopeKey($currScope) {
if ($currScope === false) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

I'd like to review the history of this and make sure that it's no longer necessary.

Copy link
Owner Author

@sirbrillig sirbrillig Jun 25, 2019

Choose a reason for hiding this comment

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

Ok, this guard is extremely old (from this change) and I think is just no longer necessary.

@sirbrillig sirbrillig merged commit c91ed28 into master Jun 25, 2019
@sirbrillig sirbrillig deleted the refactor-bool-to-nullable branch June 25, 2019 19: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.

1 participant