1.2.248. 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.248.1. Suggestions

  • Add the abstract keyword

1.2.248.2. Specs

Short name

Classes/CouldBeAbstractMethod

Rulesets

All, Suggestions

Exakat since

2.4.9

PHP Version

All

Severity

Minor

Time To Fix

Slow (1 hour)

Precision

High

Features

abstract

Available in

Entreprise Edition, Exakat Cloud