I have an abstract class with this method:
abstract class X {
abstract public function method( $param );
}
In the implementation I do:
class Y extends X {
public function method( ClassName1 $param )
{
...
}
}
class W extends X {
public function method( ClassName2 $param )
{
...
}
}
I need to put the ClassName1
and the ClassName2
in both methods, but I get this error:
Declaration of Y::method()
must be compatible with X::method($param)
in ...
What I need to declare the abstract method in class X to solve the problem?
The real question maybe: What be the class name in X::method( _____ $param )
to solve the problem?
Thanks.