Page MenuHomePhabricator

Remove final from private functions for PHP 8 compatibility
ClosedPublic

Authored by jrtc27 on Jan 10 2021, 9:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 5:28 PM
Unknown Object (File)
Thu, Apr 18, 6:17 PM
Unknown Object (File)
Thu, Apr 11, 9:16 AM
Unknown Object (File)
Mon, Apr 8, 2:40 PM
Unknown Object (File)
Sun, Apr 7, 9:29 PM
Unknown Object (File)
Sat, Mar 30, 9:40 AM
Unknown Object (File)
Feb 22 2024, 8:44 PM
Unknown Object (File)
Feb 15 2024, 6:28 AM
Subscribers

Details

Summary

This combination does not make sense and PHP 8 errors with:

Private methods cannot be final as they are never overridden by other classes

Thus remove the redundant final from all such functions.

Test Plan

Used to create this revision with PHP 8 on macOS

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Unknown Object (Owners Package).Jan 10 2021, 9:54 PM
epriestley removed a reviewer: Unknown Object (Owners Package).Jan 10 2021, 9:55 PM

Thanks! There are some similar linters already (e.g., for final in a final class, or final on an abstract method) but this particular combination (private + final) slipped through. I'll add a linter so these don't get re-introduced and apply an equivalent change to Phabricator.

This revision is now accepted and ready to land.Jan 10 2021, 10:00 PM

I added you to Blessed Committers, so you should be able to arc land this yourself. See the description of that project for more detailed instructions, or let me know if you run into issues. "Land Revision" here in the web UI should also work, or I can just pull it for you if that's easier.