Testing for a get method though is too generic IMO.  Since this method is publicly available and not type hinted, I could pass an object into this method in which that get method returns an object or something other than the string code being expected here, which would still cause unexpected results if not another error.  So, we have to rely on the method's doc block to guide us some, and the `$error` object is expected to be an Exception based object.  Before introducing handling for PHP's native exceptions, this would always refer to `JError` or `JException`.

IMO, it's unnecessary to test for anything more than whether the `$error` object is an instance of `Exception` here.  Simply put, the test for get is too easily error prone.  The other option here, you could just use `$error->getCode()` always and be done with it; that same call is used a few lines up from this issue.