Skip to content

Assign to variable to prevent null value #192

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

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

phpfui
Copy link
Contributor

@phpfui phpfui commented Feb 28, 2022

Sorry about this guys. My PHP 8.1 fix for not passing null was derailed by PHP 5.6 backport. I forgot to assign the value! AARRG!! I could have just put the expression into the function call directly, but I tend to do it outside, as I think it makes the code a little less complex and easier to read.

Again, my apologies.

@lyrixx lyrixx merged commit 793ffe5 into gitonomy:1.3 Mar 1, 2022
@lyrixx
Copy link
Member

lyrixx commented Mar 1, 2022

Thanks

@@ -90,8 +90,8 @@ protected function doParse()

$oldName = $oldName === '/dev/null' ? null : substr($oldName, 2);
$newName = $newName === '/dev/null' ? null : substr($newName, 2);
$oldIndex !== null ?: '';
$newIndex !== null ?: '';
$oldIndex = $oldIndex !== null ?: '';
Copy link

Choose a reason for hiding this comment

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

The usage of ?: turns $oldIndex into a boolean when not null. This looks unexpected to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants