Closed ezzatron closed 11 years ago
And when I say ignore, I mean truly ignore, not just expect static call - because throwing in a destructor is not valid.
So thinking about this some more, a destructor being called by PHP internals is NEVER going to pass parameters, and hence it will never throw and everything is OK. It's possible that someone will explicitly call __destruct inside another class's destructor, but this case is no different to calling any other method that may throw. That said, it still feels dirty being forced to add code that is especially designed to throw to a destructor!
Anyway, I think if you decide that the check should ignore them, it should probably go so far as to warn against it.
Yeah, mkay.
You'll also need to ignore the call on
__destruct
if you're not already, because if the constructor args are invalid$this->typeCheck
will never get assigned.