Skip to content

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.

2 participants