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

Avoid calling get_class on null in UnknownElement. #972

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

elyobo
Copy link
Contributor

@elyobo elyobo commented Oct 17, 2018

Explicitly passing NULL to get_class triggers E_WARNING as of PHP 7.2[1].

[1] https://secure.php.net/get_class

@codecov
Copy link

codecov bot commented Oct 17, 2018

Codecov Report

Merging #972 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #972   +/-   ##
========================================
  Coverage      44.9%   44.9%           
- Complexity     9924    9925    +1     
========================================
  Files           499     499           
  Lines         24053   24053           
========================================
  Hits          10800   10800           
  Misses        13253   13253
Impacted Files Coverage Δ Complexity Δ
classes/phing/UnknownElement.php 94.2% <100%> (ø) 28 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 317ac90...8202982. Read the comment docs.

Copy link
Member

@siad007 siad007 left a comment

Choose a reason for hiding this comment

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

Would you mind to format your code according to PSR-2 please.

@siad007 siad007 added the defect label Oct 20, 2018
@siad007 siad007 added this to the 3.0.0-alpha2 milestone Oct 20, 2018
@elyobo
Copy link
Contributor Author

elyobo commented Oct 20, 2018

@siad007 I'd be happy to, but you'll have to be more clear - as far as I can see it's already compliant with the requirements for ternaries, was there something else you were referring to?

Explicitly passing NULL to get_class triggers E_WARNING as of PHP
7.2[1].

[1] https://secure.php.net/get_class
@elyobo elyobo force-pushed the php-7.2-get-class branch from bcd4be3 to 8202982 Compare October 20, 2018 22:44
@elyobo
Copy link
Contributor Author

elyobo commented Oct 20, 2018

Thanks, fixed and squashed.

If you're inclined to merge this, can we also merge it back as a fix on to the 2.x series?

@elyobo elyobo changed the title Avoid calling get_class on NULL in UnknownElement. Avoid calling get_class on null in UnknownElement. Oct 20, 2018
@siad007
Copy link
Member

siad007 commented Oct 20, 2018

@elyobo

If you're inclined to merge this, can we also merge it back as a fix on to the 2.x series?

it does not make sence for the 2.x branch as well - exept @mrook is willing to make it happen.
For php > 7 the actual 3.x is the way to go in my opinion.

thx for contributing.

@siad007 siad007 merged commit dc8b466 into phingofficial:master Oct 20, 2018
@elyobo
Copy link
Contributor Author

elyobo commented Oct 21, 2018 via email

@elyobo elyobo deleted the php-7.2-get-class branch September 9, 2019 22:01
@elyobo
Copy link
Contributor Author

elyobo commented Sep 9, 2019

Coming up on a year later, v3 is still alpha, and this still bites me periodically. Any interest in applying this trivial fix to improve PHP7 compatibility @mrook @siad007?

@mrook
Copy link
Member

mrook commented Sep 10, 2019

I think I missed this. I'll take a look at rolling a 2.16.x patch fix with this applied. We don't have any definitive plans for the v3 release roadmap.

@elyobo
Copy link
Contributor Author

elyobo commented Sep 10, 2019

👍 Thanks

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

Successfully merging this pull request may close these issues.

3 participants