Skip to content

Commit

Permalink
refactor(src): remove unnecessary code
Browse files Browse the repository at this point in the history
- Remove unused import
- Remove unused method
  • Loading branch information
guanguans committed Aug 11, 2023
1 parent cd96d45 commit af8c526
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/ExceptionNotifyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Guanguans\LaravelExceptionNotify\Jobs\ReportExceptionJob;
use Guanguans\Notify\Factory;
use Illuminate\Cache\RateLimiter;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Arr;
use Illuminate\Support\Manager;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -108,9 +107,6 @@ public function getDefaultDriver()
return Arr::first((array) config('exception-notify.defaults'));
}

/**
* @throws BindingResolutionException
*/
protected function shouldntReport(\Throwable $throwable): bool
{
if (! config('exception-notify.enabled')) {
Expand Down
3 changes: 0 additions & 3 deletions src/Jobs/ReportExceptionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public function __construct(array $reports)
}
}

/**
* @noinspection BadExceptionsProcessingInspection
*/
public function handle(): void
{
foreach ($this->reports as $name => $report) {
Expand Down
6 changes: 3 additions & 3 deletions tests/Macros/RequestMacroTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

/** @noinspection NullPointerExceptionInspection */

declare(strict_types=1);

/**
Expand All @@ -12,8 +10,10 @@
* This source file is subject to the MIT license that is bundled.
*/

use Illuminate\Http\Request;

it('can get headers', function (): void {
expect(request())
expect($this->app->make(Request::class))
->headers()->toBeArray()
->headers('user-agent')->toBeString();
})->group(__DIR__, __FILE__);
3 changes: 3 additions & 0 deletions tests/Pipes/PipeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
)
->through(FixPrettyJsonPipe::class)
->then(
/**
* @throws JsonException
*/
static fn (Collection $collectors): Stringable => str(to_pretty_json($collectors->jsonSerialize()))
->substr(-256)
);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function tearDown(): void
{
parent::tearDown();
if ($container = \Mockery::getContainer()) {
$this->addToAssertionCount($container->Mockery_getExpectationCount());
$this->addToAssertionCount($container->mockery_getExpectationCount());
}

\Mockery::close();
Expand Down

0 comments on commit af8c526

Please sign in to comment.