when I look through GitHub most projects define methods in the interface this way:
interface ExampleInterface
{
function getId();
}
my question now is why it is bad style to define the method visability in the Interface:
interface ExampleInterface
{
public function getId();
}
It makes the interface more strict but isn’t that whats an interface used for?
what is the point of a private function in an interface? declaring
publicis redundant.from TFM:
All methods declared in an interface must be public, this is the nature of an interface.http://php.net/manual/en/language.oop5.interfaces.php