1.2.1394. Useless Final¶
When a class is declared final, all of its methods are also final by default.
There is no need to declare them individually final.
<?php
final class foo {
// Useless final, as the whole class is final
final function method() { }
}
class bar {
// Useful final, as the whole class is not final
final function method() { }
}
?>
See also Final Keyword and When to declare final.
1.2.1394.1. Connex PHP features¶
1.2.1394.1.1. Specs¶
Short name |
Classes/UselessFinal |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
ClearPHP |
|
Available in |