Primo Committ
This commit is contained in:
29
vendor/facade/ignition/src/Exceptions/InvalidConfig.php
vendored
Normal file
29
vendor/facade/ignition/src/Exceptions/InvalidConfig.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\Ignition\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Facade\IgnitionContracts\BaseSolution;
|
||||
use Facade\IgnitionContracts\ProvidesSolution;
|
||||
use Facade\IgnitionContracts\Solution;
|
||||
use Monolog\Logger;
|
||||
|
||||
class InvalidConfig extends Exception implements ProvidesSolution
|
||||
{
|
||||
public static function invalidLogLevel(string $logLevel)
|
||||
{
|
||||
return new static("Invalid log level `{$logLevel}` specified.");
|
||||
}
|
||||
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
$validLogLevels = array_map(function (string $level) {
|
||||
return strtolower($level);
|
||||
}, array_keys(Logger::getLevels()));
|
||||
|
||||
$validLogLevelsString = implode(',', $validLogLevels);
|
||||
|
||||
return BaseSolution::create('You provided an invalid log level')
|
||||
->setSolutionDescription("Please change the log level in your `config/logging.php` file. Valid log levels are {$validLogLevelsString}.");
|
||||
}
|
||||
}
|
||||
9
vendor/facade/ignition/src/Exceptions/UnableToShareErrorException.php
vendored
Normal file
9
vendor/facade/ignition/src/Exceptions/UnableToShareErrorException.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\Ignition\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class UnableToShareErrorException extends Exception
|
||||
{
|
||||
}
|
||||
51
vendor/facade/ignition/src/Exceptions/ViewException.php
vendored
Normal file
51
vendor/facade/ignition/src/Exceptions/ViewException.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\Ignition\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
use Facade\FlareClient\Contracts\ProvidesFlareContext;
|
||||
use Facade\Ignition\DumpRecorder\HtmlDumper;
|
||||
|
||||
class ViewException extends ErrorException implements ProvidesFlareContext
|
||||
{
|
||||
/** @var array */
|
||||
protected $viewData = [];
|
||||
|
||||
/** @var string */
|
||||
protected $view = '';
|
||||
|
||||
public function setViewData(array $data)
|
||||
{
|
||||
$this->viewData = $data;
|
||||
}
|
||||
|
||||
public function getViewData(): array
|
||||
{
|
||||
return $this->viewData;
|
||||
}
|
||||
|
||||
public function setView(string $path)
|
||||
{
|
||||
$this->view = $path;
|
||||
}
|
||||
|
||||
protected function dumpViewData($variable): string
|
||||
{
|
||||
return (new HtmlDumper())->dumpVariable($variable);
|
||||
}
|
||||
|
||||
public function context(): array
|
||||
{
|
||||
$context = [
|
||||
'view' => [
|
||||
'view' => $this->view,
|
||||
],
|
||||
];
|
||||
|
||||
if (config('flare.reporting.report_view_data')) {
|
||||
$context['view']['data'] = array_map([$this, 'dumpViewData'], $this->viewData);
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
}
|
||||
22
vendor/facade/ignition/src/Exceptions/ViewExceptionWithSolution.php
vendored
Normal file
22
vendor/facade/ignition/src/Exceptions/ViewExceptionWithSolution.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\Ignition\Exceptions;
|
||||
|
||||
use Facade\IgnitionContracts\ProvidesSolution;
|
||||
use Facade\IgnitionContracts\Solution;
|
||||
|
||||
class ViewExceptionWithSolution extends ViewException implements ProvidesSolution
|
||||
{
|
||||
/** @var Solution */
|
||||
protected $solution;
|
||||
|
||||
public function setSolution(Solution $solution)
|
||||
{
|
||||
$this->solution = $solution;
|
||||
}
|
||||
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
return $this->solution;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user