The following code creates warnings in PHP 7

use function in_array;
use function is_object;

Comments

paulsheldrake created an issue. See original summary.

paulsheldrake’s picture

StatusFileSize
new298 bytes

This patch removes the 2 lines

jeffschuler’s picture

These are from @Pol's commit #50c8d5b: Update code style. There are more.

What is the warning you're seeing?

@Pol: are you importing these native functions because they could potentially be overridden? We're not doing any namespacing. This seems like overkill.

niels de ruijter’s picture

StatusFileSize
new1.82 KB

These use statements produce a warning since PHP 7:

The use statement with non-compound name 'in_array' has no effect views_geojson.module:8                                                                                                                                                                                                               
The use statement with non-compound name 'is_object' has no effect views_geojson.module:9 

They also seem to have no effect at all in PHP 5. So better just remove them all?
Attached patch removes them all.

niels de ruijter’s picture

Status: Active » Needs review

  • jeffschuler committed 7d72ef7 on 7.x-1.x
    Issue #3133794 by paulsheldrake, Niels de Ruijter: Remove native...
jeffschuler’s picture

Status: Needs review » Fixed

Committed. Thanks folks!
@Pol feel free to come back and make your case... :)

pol’s picture

Hi Jeff,

What do you mean?

jeffschuler’s picture

Make the case for importing these native functions.

pol’s picture

Ooh ! Sorry :-)

I don't remember in which circumstances I added them... since I don't do Drupal, it's hard for me to keep track of those things... sorry :(

jeffschuler’s picture

Ha. Cool. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.