CRITICAL
Rule Definition
Final modifiers prevent child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended and the modifier is useless.
Remediation
Review the source code in order to reduce the number Methods of final classes containing unnecessary final modifiers.
Violation Code Sample
final class CastTest
{
public final function test()
{
}
}
Fixed Code Sample
<?php
final class CastTest
{
public function Test() // Violation removed
{
}
}
?>
Reference
Code Sniffer - http://pear.php.net/package/PHP_CodeSniffer/docs/1.5.2/PHP_CodeSniffer/Generic_Sniffs_CodeAnalysis_UnnecessaryFinalModifierSniff.html
Related Technologies
Technical Criterion
Dead code (static)
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.