-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Right now we're getting things like $this->arguments without using proper methods like getArguments.
This is, AFAIK, violating the OOP structure and makes it more difficult to fix bugs.
Consider the following (not a real situation):
A security flaw is found in the way commands handle arguments. This is because arguments are passed without any verification.
Without proper methods: fix every command one by one and hope third party commands will follow sooner or later.
With proper methods: modify getArguments and fix all included and third party commands in one go.
It may seem like a lot of work and at first it is, but I think in the end it will pay off with easier maintenance of the codebase.
Things like $this->bot don't really need this, but couldn't really hurt either.
Interesting read: http://php.net/manual/en/language.oop5.overloading.php
Though I'd personally prefer having a method for each variable.