Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -6,7 +6,7 @@
namespace Whoops\Handler;
use Whoops\Exception\Inspector;
use Whoops\Inspector\InspectorInterface;
use Whoops\RunInterface;
/**
@@ -36,7 +36,7 @@ abstract class Handler implements HandlerInterface
private $run;
/**
* @var Inspector $inspector
* @var InspectorInterface $inspector
*/
private $inspector;
@@ -62,15 +62,15 @@ abstract class Handler implements HandlerInterface
}
/**
* @param Inspector $inspector
* @param InspectorInterface $inspector
*/
public function setInspector(Inspector $inspector)
public function setInspector(InspectorInterface $inspector)
{
$this->inspector = $inspector;
}
/**
* @return Inspector
* @return InspectorInterface
*/
protected function getInspector()
{

View File

@@ -6,7 +6,7 @@
namespace Whoops\Handler;
use Whoops\Exception\Inspector;
use Whoops\Inspector\InspectorInterface;
use Whoops\RunInterface;
interface HandlerInterface
@@ -29,8 +29,8 @@ interface HandlerInterface
public function setException($exception);
/**
* @param Inspector $inspector
* @param InspectorInterface $inspector
* @return void
*/
public function setInspector(Inspector $inspector);
public function setInspector(InspectorInterface $inspector);
}

View File

@@ -60,7 +60,8 @@ class JsonResponseHandler extends Handler
'errors' => [
Formatter::formatExceptionAsDataArray(
$this->getInspector(),
$this->addTraceToOutput()
$this->addTraceToOutput(),
$this->getRun()->getFrameFilters()
),
]
];
@@ -68,7 +69,8 @@ class JsonResponseHandler extends Handler
$response = [
'error' => Formatter::formatExceptionAsDataArray(
$this->getInspector(),
$this->addTraceToOutput()
$this->addTraceToOutput(),
$this->getRun()->getFrameFilters()
),
];
}

View File

@@ -282,7 +282,7 @@ class PlainTextHandler extends Handler
return '';
}
$inspector = $this->getInspector();
$frames = $inspector->getFrames();
$frames = $inspector->getFrames($this->getRun()->getFrameFilters());
$response = "\nStack trace:";

View File

@@ -287,6 +287,7 @@ class PrettyPageHandler extends Handler
$vars["tables"] = array_merge($extraTables, $vars["tables"]);
$plainTextHandler = new PlainTextHandler();
$plainTextHandler->setRun($this->getRun());
$plainTextHandler->setException($this->getException());
$plainTextHandler->setInspector($this->getInspector());
$vars["preface"] = "<!--\n\n\n" . $this->templateHelper->escape($plainTextHandler->generateResponse()) . "\n\n\n\n\n\n\n\n\n\n\n-->";
@@ -304,7 +305,7 @@ class PrettyPageHandler extends Handler
*/
protected function getExceptionFrames()
{
$frames = $this->getInspector()->getFrames();
$frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters());
if ($this->getApplicationPaths()) {
foreach ($frames as $frame) {
@@ -353,7 +354,6 @@ class PrettyPageHandler extends Handler
* will be flattened with `print_r`.
*
* @param string $label
* @param array $data
*
* @return static
*/
@@ -383,7 +383,7 @@ class PrettyPageHandler extends Handler
throw new InvalidArgumentException('Expecting callback argument to be callable');
}
$this->extraTables[$label] = function (\Whoops\Exception\Inspector $inspector = null) use ($callback) {
$this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) {
try {
$result = call_user_func($callback, $inspector);
@@ -755,11 +755,9 @@ class PrettyPageHandler extends Handler
/**
* Set the application paths.
*
* @param array $applicationPaths
*
* @return void
*/
public function setApplicationPaths($applicationPaths)
public function setApplicationPaths(array $applicationPaths)
{
$this->applicationPaths = $applicationPaths;
}

View File

@@ -43,7 +43,8 @@ class XmlResponseHandler extends Handler
$response = [
'error' => Formatter::formatExceptionAsDataArray(
$this->getInspector(),
$this->addTraceToOutput()
$this->addTraceToOutput(),
$this->getRun()->getFrameFilters()
),
];