update inbox list

This commit is contained in:
manhlab
2021-04-07 19:25:18 -04:00
parent fda7245f7c
commit 436de2efd6
8576 changed files with 1013325 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
use Facade\Ignition\DumpRecorder\DumpRecorder;
class AddDumps
{
/** @var \Facade\Ignition\DumpRecorder\DumpRecorder */
protected $dumpRecorder;
public function __construct(DumpRecorder $dumpRecorder)
{
$this->dumpRecorder = $dumpRecorder;
}
public function handle(Report $report, $next)
{
$report->group('dumps', $this->dumpRecorder->getDumps());
return $next($report);
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
class AddEnvironmentInformation
{
public function handle(Report $report, $next)
{
$report->frameworkVersion(app()->version());
$report->group('env', [
'laravel_version' => app()->version(),
'laravel_locale' => app()->getLocale(),
'laravel_config_cached' => app()->configurationIsCached(),
'php_version' => phpversion(),
]);
return $next($report);
}
}

View File

@@ -0,0 +1,58 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
use Symfony\Component\Process\Process;
class AddGitInformation
{
public function handle(Report $report, $next)
{
$report->group('git', [
'hash' => $this->hash(),
'message' => $this->message(),
'tag' => $this->tag(),
'remote' => $this->remote(),
'isDirty' => ! $this->isClean(),
]);
return $next($report);
}
public function hash(): ?string
{
return $this->command("git log --pretty=format:'%H' -n 1");
}
public function message(): ?string
{
return $this->command("git log --pretty=format:'%s' -n 1");
}
public function tag(): ?string
{
return $this->command('git describe --tags --abbrev=0');
}
public function remote(): ?string
{
return $this->command('git config --get remote.origin.url');
}
public function isClean(): bool
{
return empty($this->command('git status -s'));
}
protected function command($command)
{
$process = (new \ReflectionClass(Process::class))->hasMethod('fromShellCommandline')
? Process::fromShellCommandline($command, base_path())
: new Process($command, base_path());
$process->run();
return trim($process->getOutput());
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
use Facade\Ignition\LogRecorder\LogRecorder;
class AddLogs
{
/** @var \Facade\Ignition\LogRecorder\LogRecorder */
protected $logRecorder;
public function __construct(LogRecorder $logRecorder)
{
$this->logRecorder = $logRecorder;
}
public function handle(Report $report, $next)
{
$report->group('logs', $this->logRecorder->getLogMessages());
return $next($report);
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
use Facade\Ignition\QueryRecorder\QueryRecorder;
class AddQueries
{
/** @var \Facade\Ignition\QueryRecorder\QueryRecorder */
protected $queryRecorder;
public function __construct(QueryRecorder $queryRecorder)
{
$this->queryRecorder = $queryRecorder;
}
public function handle(Report $report, $next)
{
$report->group('queries', $this->queryRecorder->getQueries());
return $next($report);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
use Facade\IgnitionContracts\SolutionProviderRepository;
class AddSolutions
{
/** @var \Facade\IgnitionContracts\SolutionProviderRepository */
protected $solutionProviderRepository;
public function __construct(SolutionProviderRepository $solutionProviderRepository)
{
$this->solutionProviderRepository = $solutionProviderRepository;
}
public function handle(Report $report, $next)
{
if ($throwable = $report->getThrowable()) {
$solutions = $this->solutionProviderRepository->getSolutionsForThrowable($throwable);
foreach ($solutions as $solution) {
$report->addSolution($solution);
}
}
return $next($report);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Enums\GroupingTypes;
use Facade\FlareClient\Report;
class CustomizeGrouping
{
protected $groupingType;
public function __construct($groupingType)
{
$this->groupingType = $groupingType;
}
public function handle(Report $report, $next)
{
$report->groupByTopFrame();
if ($this->groupingType === GroupingTypes::EXCEPTION) {
$report->groupByException();
}
return $next($report);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace Facade\Ignition\Middleware;
use Facade\FlareClient\Report;
class SetNotifierName
{
const NOTIFIER_NAME = 'Laravel Client';
public function handle(Report $report, $next)
{
$report->notifierName(static::NOTIFIER_NAME);
return $next($report);
}
}