Merge pull request #582 from gharlan/editor-callable-allow-empty

editor callback: allow to return empty value
This commit is contained in:
Denis Sokolov
2018-06-30 16:14:06 +03:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -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
);
}
/**