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
F13048382: D21741.diff
Thu, Apr 18, 7:41 PM
Unknown Object (File)
Mon, Apr 8, 4:37 AM
Unknown Object (File)
Fri, Apr 5, 7:02 PM
Unknown Object (File)
Mon, Apr 1, 12:05 AM
Unknown Object (File)
Sat, Mar 30, 10:15 AM
Unknown Object (File)
Mar 4 2024, 7:48 PM
Unknown Object (File)
Feb 25 2024, 7:41 AM
Unknown Object (File)
Feb 4 2024, 1:29 AM
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
Branch
each1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25601
Build 35412: Run Core Tests
Build 35411: arc lint + arc unit

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.