/CarCompany

PHP project that demonstrates the usage of namespaces and traits by modeling different types of cars.

Primary LanguagePHP

Car Company

PHP project that demonstrates the usage of namespaces and traits by modeling different types of cars.

Description

You're working for a car company that is interested in building a new, universal computer module to power all types of vehicles they make. We're not going to make you do that. Instead, we're interested in modeling just types of cars, using PHP 5.5+ features like namespaces and traits, in an object oriented hierarchy with inheritance. Consider the following:

  • Motorcycles, trucks, and cars, are all types of vehicles.
  • Doors are attributes. Loading gates are attributes.
  • Acceleration/Deceleration are methods, as are headlights and windshield wipers.

As a brief example: class Car extends Vehicle {}

Your Task:

  • Your goal is to model an object hierarchy that represents most common types of vehicles, while reusing as much code as possible.
  • The depth to which you choose the model the hierarchy is up to you; it's only goal is to outline a strong hierarchy and demonstrate the potential for code re-use.

Recommendations:

  • Lots of console output to demonstrate what's going on.