Skip to content

Commit

Permalink
Conditional truncating for method name
Browse files Browse the repository at this point in the history
Prevent base class truncation when not appropriate
  • Loading branch information
glafarge committed Jan 28, 2015
1 parent e236933 commit 8af4839
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Error/ExceptionRenderer.php
Expand Up @@ -198,7 +198,11 @@ protected function _customMethod($method, $exception)
protected function _method(\Exception $exception)
{
list(, $baseClass) = namespaceSplit(get_class($exception));
$baseClass = substr($baseClass, 0, -9);

if(strpos($baseClass, 'Exception')!==false) {
$baseClass = substr($baseClass, 0, -9);
}

$method = Inflector::variable($baseClass) ?: 'error500';
return $this->method = $method;
}
Expand Down

0 comments on commit 8af4839

Please sign in to comment.