PHP implementation of Command chain pattern