2016-06-05 20:25:16 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace CodeInspector;
|
|
|
|
|
|
|
|
class ExceptionHandler
|
|
|
|
{
|
2016-06-09 18:08:25 -04:00
|
|
|
public static function accepts(Issue\CodeIssue $e)
|
2016-06-05 20:25:16 -04:00
|
|
|
{
|
2016-06-09 18:08:25 -04:00
|
|
|
$config = Config::getInstance();
|
|
|
|
|
|
|
|
if ($config->excludeIssueInFile(get_class($e), $e->getFileName())) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-06-10 14:47:44 -04:00
|
|
|
if ($config->stop_on_error) {
|
|
|
|
throw new CodeException($e->getMessage());
|
|
|
|
}
|
|
|
|
|
2016-06-16 18:52:12 -04:00
|
|
|
echo get_class($e) . PHP_EOL;
|
2016-06-10 17:20:04 -04:00
|
|
|
echo $e->getMessage() . PHP_EOL;
|
2016-06-05 20:25:16 -04:00
|
|
|
}
|
|
|
|
}
|