Closed bayleedev closed 11 years ago
I think we should rename.
The $code
property is part of PHP's Exception
interface.
But we could still do public instead of protected?
Yeah, we can make it public and everything will work. Or check out the class name for 'exception' in it.
I guess I'm fine with making them public, assuming that doesn't break anything.
Most of our exceptions have a
protected $code
.When extending exceptions you have a
protected $code
however the name goes against our current coding standards.We could make them public, since in PHP we can always make the visibility of members and methods more visible. This opens up our exceptions to be 'leaky' and edited at runtime.
Or we could make an exception, but this is the tricky part. We could do it for
$code
with obvious repercussions, or possibly check for "/Exception$/" in class name, but this doesn't ensure that it extends exception. We could open up the file and use Reflection orin_a
to determine if it's an exception, but then our static code analyzer becomes a hybrid static/dynamic code analyzer.Thoughts?