I was wondering if it is possible to use interface parameters in PHP functions / methods.
I'm used to coding in .Net and using .Net this is possible, such as having the following interface:
interface IVehicleDataProvider
{
public void Create(IVehicle Vehicle);
}
Then I could implement this in a class as such:
class CarDataProvider : IVehicleDataProvider
{
public void Create(Car Car)
{
//do something
}
}
or
class TruckDataProvider : IVehicleDataProvider
{
public void Create(Truck Truck)
{
//do something
}
}
as long as Car or Truck implements an IVehicle interface.
Can the same thing be done in PHP?