I've created an interface called iMapper. And I want all my mappers file to implement that interface.
But each mapper will specify the parameter type.
Example:
interface iMapper
{
public function insert($obj);
public function update($obj);
public function delete($obj);
}
class CarMapper implements iMapper
{
public function insert(Car $obj){}
public function update(Car $obj){}
public function delete(Car $obj){}
}
That code generate the following error:
Declaration of CarMapper::insert() must be compatible with that of iMapper::insert()
Is their a way of making the interface compatible with the CarMapper? (I don't want to change the mapper.)
Thanks