Once we depend on Drupal 8.7, we can also finally depend on PHP 7 and use all the great new language features available there.
In this issue, to be committed once we increase the minimum core version to 8.7 (shortly after the release of 8.8, I think?), we should not only only add the PHP requirement explicitly to search_api.info.yml, but we can already go through the module and change some syntax – especially !empty($a['foo']) ? $a['foo'] : $b, which probably occurs a lot.

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

especially !empty($a['foo']) ? $a['foo'] : $b, which probably occurs a lot.

Note to self that this is not the same as $a['foo'] ?? $b, as ?? only checks for NULL, not falsey values.

drunken monkey’s picture

Issue tags: +Amsterdam2019
stefvanlooveren’s picture

Assigned: Unassigned » stefvanlooveren
stefvanlooveren’s picture

StatusFileSize
new720 bytes
borisson_’s picture

That looks like it should do the job, I can't set to needs review because our testbots run by default on 5.6 - this gets a +1 though.

stefvanlooveren’s picture

Assigned: stefvanlooveren » Unassigned
Status: Postponed » Needs review
drunken monkey’s picture

StatusFileSize
new348 bytes

Patch applies fine for me when copy-pasting from the browser, but fails if downloaded. Might be WIndows line endings?
In any case, thanks a lot for the patch!

Re-roll with UNIX line endings.

@ Joris: I’m pretty sure the default has been PHP 7 for ages now, and a few months ago I switched over the last of our three test environments to 7 as well.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Ok, in that case this could be moved to rtbc

drunken monkey’s picture

Status: Reviewed & tested by the community » Postponed

Ok, in that case this could be moved to rtbc

No, since even though we don’t test against PHP 5 anymore, we should still support it as long as Core supports it – i.e., until 8.6 hits EOL in a few weeks. I’d still wait until then, just to be on the safe side.

Also, adding a @todo comment so that we remember this in the follow-up. (Moved over from #3023170: Test for compatibility with Drupal 9.)

drunken monkey’s picture

StatusFileSize
new577 bytes
new925 bytes
drunken monkey’s picture

Status: Postponed » Needs review
StatusFileSize
new41.03 KB

And here is a patch also updating what can be updated.
It’s … extensive. But as long as the test bot agrees, it shouldn’t really break anything (except, potentially, a patch or two).
In any case, Drupal 8.6 is dead, so we can finally commit this.

drunken monkey’s picture

StatusFileSize
new1.17 KB
new41.12 KB

Huh. Why wasn’t this marked “Needs work” by the test bot.
Anyways, should be fixed with the attached revision.

  • drunken monkey committed 199464a on 8.x-1.x
    Issue #3044782 by drunken monkey, stefvanlooveren: Increased PHP version...
drunken monkey’s picture

Status: Needs review » Fixed

Huh, seems I missed this, it has been lying around now for quite long enough.
Committed.
Thanks again, everyone!

Status: Fixed » Closed (fixed)

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