Is it possible to make a method on a child class of an abstract parent required, yet still allow the method signature to be optional or different from the defined parent method signature?
abstract class Parent
{
abstract public function foo();
}
class Child extends Parent
{
public function foo(Request $request) {
// do something with request
}
}
I need to be able to enforce that specific methods exist on the child, yet allow the user to pass in whatever they want to that class.
It seems you can't do this with either abstract methods or interfaces, how does one go about getting this done?