mirror of
https://github.com/filp/whoops.git
synced 2026-08-30 20:17:11 +00:00
editor callback: allow to return empty value
This commit is contained in:
@@ -507,6 +507,10 @@ class PrettyPageHandler extends Handler
|
||||
$callback = call_user_func($this->editors[$this->editor], $filePath, $line);
|
||||
}
|
||||
|
||||
if (empty($callback)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (is_string($callback)) {
|
||||
return [
|
||||
'ajax' => false,
|
||||
|
||||
@@ -288,6 +288,14 @@ class PrettyPageHandlerTest extends TestCase
|
||||
false
|
||||
);
|
||||
|
||||
$handler->setEditor(function ($file, $line) {
|
||||
return false;
|
||||
});
|
||||
|
||||
$this->assertEquals(
|
||||
$handler->getEditorHref('/foo/bar.php', 10),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user