This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -1,5 +1,18 @@
# CHANGELOG
## v2.18.0
* Line numbers are now clickable.
## v2.17.0
* Support cursor IDE.
## v2.16.0
* Support PHP `8.4`.
* Drop support for PHP older than `7.1`.
## v2.15.4
* Improve link color in comments.

View File

@@ -15,13 +15,13 @@
"test": "phpunit --testdox tests"
},
"require": {
"php": "^5.5.9 || ^7.0 || ^8.0",
"php": "^7.1 || ^8.0",
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3",
"mockery/mockery": "^0.9 || ^1.0",
"symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0"
"phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3",
"mockery/mockery": "^1.0",
"symfony/var-dumper": "^4.0 || ^5.0"
},
"suggest": {
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",

View File

@@ -28,6 +28,7 @@ class PrettyPageHandler extends Handler
const EDITOR_ESPRESSO = "espresso";
const EDITOR_XDEBUG = "xdebug";
const EDITOR_NETBEANS = "netbeans";
const EDITOR_CURSOR = "cursor";
/**
* Search paths to be scanned for resources.
@@ -122,6 +123,7 @@ class PrettyPageHandler extends Handler
"atom" => "atom://core/open/file?filename=%file&line=%line",
"espresso" => "x-espresso://open?filepath=%file&lines=%line",
"netbeans" => "netbeans://open/?f=%file:%line",
"cursor" => "cursor://file/%file:%line",
];
/**
@@ -383,7 +385,7 @@ class PrettyPageHandler extends Handler
throw new InvalidArgumentException('Expecting callback argument to be callable');
}
$this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) {
$this->extraTables[$label] = function (?\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) {
try {
$result = call_user_func($callback, $inspector);

View File

@@ -558,3 +558,11 @@ pre.sf-dump {
.search-for-help li a svg path {
background-size: contain;
}
.line-numbers-rows span {
pointer-events: auto;
cursor: pointer;
}
.line-numbers-rows span:hover {
text-decoration: underline;
}

View File

@@ -183,6 +183,30 @@ Zepto(function($) {
setActiveFramesTab($(this));
});
// Open editor from code block rows number
$(document).delegate('.line-numbers-rows > span', 'click', function(e) {
var linkTag = $(this).closest('.frame-code').find('.editor-link');
if (!linkTag) return;
var editorUrl = linkTag.attr('href');
var requiresAjax = linkTag.data('ajax');
var lineOffset = $(this).closest('[data-line-offset]').data('line-offset');
var lineNumber = lineOffset + $(this).index();
var realLine = $(this).closest('[data-line]').data('line');
if (!realLine) return;
var fileUrl = editorUrl.replace(
new RegExp('([:=])' + realLine),
'$1' + lineNumber
);
if (requiresAjax) {
$.get(fileUrl);
} else {
$('<a>').attr('href', fileUrl).trigger('click');
}
});
// Render late enough for highlightCurrentLine to be ready
renderCurrentCodeblock();
});

View File

@@ -81,7 +81,7 @@ final class Run implements RunInterface
*/
private $frameFilters = [];
public function __construct(SystemFacade $system = null)
public function __construct(?SystemFacade $system = null)
{
$this->system = $system ?: new SystemFacade;
$this->inspectorFactory = new InspectorFactory();

View File

@@ -233,7 +233,7 @@ class TemplateHelper
*
* @param string $template
*/
public function render($template, array $additionalVariables = null)
public function render($template, ?array $additionalVariables = null)
{
$variables = $this->getVariables();