I am writing helper classes for a large project in PHP and I have written a class called Command
. It is essentially an OOP wrapper around running system commands from PHP in a controlled way. It has methods like addOption()
to add -a type options and addArgument()
to add other arguments.
I will need to do a lot of scp'ing of files around so I will be using the Command class a lot. The calls to scp are very specific in that I need certain options used every time.
Does it make sense to extend this class and create a ScpCommand
class? It seems to have an 'is a' relationship, but it is really just the same thing as the Command
class with specific options every time. I don't really think I would need to override any methods with the exception of the constructor. I probably would add just class variables. It would really just be a convenience.
What makes the most sense here?