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
Unknown Object (File)
Thu, Nov 28, 6:47 AM
Unknown Object (File)
Mon, Nov 18, 4:15 AM
Unknown Object (File)
Wed, Nov 13, 9:08 PM
Unknown Object (File)
Tue, Nov 12, 11:38 AM
Unknown Object (File)
Sun, Nov 10, 3:28 PM
Unknown Object (File)
Sat, Nov 9, 4:50 PM
Unknown Object (File)
Fri, Nov 8, 3:19 AM
Unknown Object (File)
Thu, Nov 7, 3:42 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
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.