upgraded dependencies
This commit is contained in:
50
vendor/facade/ignition/src/Commands/SolutionProviderMakeCommand.php
vendored
Normal file
50
vendor/facade/ignition/src/Commands/SolutionProviderMakeCommand.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\Ignition\Commands;
|
||||
|
||||
use Illuminate\Console\GeneratorCommand;
|
||||
|
||||
class SolutionProviderMakeCommand extends GeneratorCommand
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'ignition:make-solution-provider';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create a new custom Ignition solution provider class';
|
||||
|
||||
/**
|
||||
* The type of class being generated.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Solution Provider';
|
||||
|
||||
/**
|
||||
* Get the stub file for the generator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getStub()
|
||||
{
|
||||
return __DIR__.'/stubs/solution-provider.stub';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default namespace for the class.
|
||||
*
|
||||
* @param string $rootNamespace
|
||||
* @return string
|
||||
*/
|
||||
protected function getDefaultNamespace($rootNamespace)
|
||||
{
|
||||
return $rootNamespace.'\SolutionProviders';
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace Facade\Ignition\Commands;
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use Exception;
|
||||
use Facade\FlareClient\Flare;
|
||||
use Facade\FlareClient\Http\Exceptions\BadResponseCode;
|
||||
use Illuminate\Config\Repository;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Log\LogManager;
|
||||
@@ -72,10 +75,47 @@ class TestCommand extends Command
|
||||
$testException = new Exception('This is an exception to test if the integration with Flare works.');
|
||||
|
||||
try {
|
||||
app('flare.client')->sendTestReport($testException);
|
||||
$this->info(PHP_EOL);
|
||||
app(Flare::class)->sendTestReport($testException);
|
||||
$this->info('');
|
||||
} catch (Exception $exception) {
|
||||
$this->warn('❌ We were unable to send an exception to Flare. Make sure that your key is correct and that you have a valid subscription. '.PHP_EOL.PHP_EOL.'For more info visit the docs on installing Flare in a Laravel project: https://flareapp.io/docs/ignition-for-laravel/introduction');
|
||||
$this->warn('❌ We were unable to send an exception to Flare. ');
|
||||
|
||||
if ($exception instanceof BadResponseCode) {
|
||||
$this->info('');
|
||||
$message = 'Unknown error';
|
||||
|
||||
$body = $exception->response->getBody();
|
||||
|
||||
if (is_array($body) && isset($body['message'])) {
|
||||
$message = $body['message'];
|
||||
}
|
||||
|
||||
$this->warn("{$exception->response->getHttpResponseCode()} - {$message}");
|
||||
} else {
|
||||
$this->warn($exception->getMessage());
|
||||
}
|
||||
|
||||
$this->warn('Make sure that your key is correct and that you have a valid subscription.');
|
||||
$this->info('');
|
||||
$this->info('For more info visit the docs on https://flareapp.io/docs/ignition-for-laravel/introduction');
|
||||
$this->info('You can see the status page of Flare at https://status.flareapp.io');
|
||||
$this->info('Flare support can be reached at support@flareapp.io');
|
||||
|
||||
$this->line('');
|
||||
$this->line('Extra info');
|
||||
$this->table([], [
|
||||
['Platform', PHP_OS],
|
||||
['PHP', phpversion()],
|
||||
['Laravel', app()->version()],
|
||||
['facade/ignition', InstalledVersions::getVersion('facade/ignition')],
|
||||
['facade/flare-client-php', InstalledVersions::getVersion('facade/flare-client-php')],
|
||||
['Curl', curl_version()['version']],
|
||||
['SSL', curl_version()['ssl_version']],
|
||||
]);
|
||||
|
||||
if ($this->output->isVerbose()) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
18
vendor/facade/ignition/src/Commands/stubs/solution-provider.stub
vendored
Normal file
18
vendor/facade/ignition/src/Commands/stubs/solution-provider.stub
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace DummyNamespace;
|
||||
|
||||
use Facade\IgnitionContracts\HasSolutionsForThrowable;
|
||||
|
||||
class DummyClass implements HasSolutionsForThrowable
|
||||
{
|
||||
public function canSolve(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getSolutions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user