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
F14398906: D21496.diff
Sun, Dec 22, 3:17 PM
Unknown Object (File)
Tue, Dec 17, 3:19 AM
Unknown Object (File)
Nov 22 2024, 9:23 AM
Unknown Object (File)
Nov 22 2024, 9:23 AM
Unknown Object (File)
Nov 22 2024, 8:35 AM
Unknown Object (File)
Nov 20 2024, 7:05 AM
Unknown Object (File)
Nov 9 2024, 9:06 PM
Unknown Object (File)
Oct 26 2024, 9:17 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.