As always, it all depends on context. This would likely not apply to everyone's case.
If the object on which you call the doSomething() method now aggregates a FileTool object instead of the static call you could just pass another object implementing the same interface to the tested object and an alternative implementation would be used. In case of unit tests you could use PHPUnit's mocking features to automatically generate a mock object for you, which then is passed to the object. (There are also various other mock object libraries out there.)
In other words, only if you involve yourself in something like the above mentioned example should you be concerned.
If you're using static classes for one-off things, as in Kohana's modules (Date::WEEK, for ex), then you're fine, but if you're doing examples as shown in the blog post, then yes, static isn't the way to go.
Using statics is pretty much just namespaced function calls. No problem if you're happy following a procedural paradigm overall, but mixing it with OO code tends to be nasty.
5 comments
As always, it all depends on context. This would likely not apply to everyone's case.
In other words, only if you involve yourself in something like the above mentioned example should you be concerned.
If you're using static classes for one-off things, as in Kohana's modules (Date::WEEK, for ex), then you're fine, but if you're doing examples as shown in the blog post, then yes, static isn't the way to go.
Deleted before we saved it.
Using statics is pretty much just namespaced function calls. No problem if you're happy following a procedural paradigm overall, but mixing it with OO code tends to be nasty.
Deleted before we saved it.