Page MenuHomePhabricator

Add a lint rule forbidding use of "each()"
ClosedPublic

Authored by epriestley on Dec 9 2021, 9:55 PM.
Tags
None
Referenced Files
F13232025: D21741.diff
Tue, May 21, 12:57 AM
F13214810: D21741.id51813.diff
Fri, May 17, 1:04 PM
F13210903: D21741.diff
Fri, May 17, 5:19 AM
F13210075: D21741.id51813.diff
Fri, May 17, 3:48 AM
F13194816: D21741.diff
Sun, May 12, 9:54 PM
F13179290: D21741.diff
Wed, May 8, 9:05 PM
Unknown Object (File)
Mon, May 6, 5:24 PM
Unknown Object (File)
Sat, May 4, 6:31 PM
Subscribers

Details

Summary

Ref T13588. "each()" has been a bad idea for a long time, and was formally deprecated in PHP 7.2 and removed in PHP 8.0.

Catch use of "each()" in lint and reject it.

Test Plan

Added and ran unit tests.

Screen Shot 2021-12-09 at 1.53.30 PM.png (201×586 px, 62 KB)

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

... and was formally deprecated in PHP 7.4 and removed in PHP 8.0.

The lint emitted says 7.2 (which appears to be correct), a minor inconsistency in the revision description

Ah, yep, should be 7.2 -- thanks!

This revision was not accepted when it landed; it landed in state Needs Review.Dec 9 2021, 11:59 PM
This revision was automatically updated to reflect the committed changes.