An example of the Factory Method pattern in PHP