Answer the question
In order to leave comments, you need to log in
Should I always write implements?
When you need to inherit a class that implements some kind of interface, I don’t know if implements should be added to the heir.
Example:
interface ObserverInterface
{
public function execute();
}
abstract class ParentClass implements ObserverInterface
{
}
class ChildClass extends ParentClass // implements ObserverInterface ?
{
public function execute()
{
}
}
Answer the question
In order to leave comments, you need to log in
It just doesn't make sense, because the child class already has all the protected and public methods.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question