1.2.249. Could Be Abstract Method¶
A method can be made abstract, when all the class’s children implement it.
Since the method will also loose its body, it should not be refered in any calls.
<?php
class a {
function foo() {}
function bar() {}
}
// * for several distinct names
class a* extends a {
function foo() {}
}
// a0 only creates foo(), not bar.
class a0 extends a {
function foo() {}
}
?>
1.2.249.1. Connex PHP features¶
1.2.249.1.1. Suggestions¶
Add the abstract keyword
1.2.249.1.2. Specs¶
Short name |
Classes/CouldBeAbstractMethod |
Rulesets |
|
Exakat since |
2.4.9 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Slow (1 hour) |
Precision |
High |
Available in |