A friend of mine sent me this question and we had different views on how to approach/solve it. So, I am hoping that some of the PHP Gurus here might be able to throw some light on this:
So here it Goes: Class Diagram
Car ----Station Wagon
Basically what needs to achieved is:
Define the Vehicle interface with an abstract ‘addLuggage’ function that takes a Container as argument.
Define the Car class that initialises an array of luggage upon instantiation.
Define the Sports class with an implementation of the ‘addLuggage’ function that throws an exception if a Suitcase is passed as argument.