Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam committed Jul 16, 2021
1 parent db4d819 commit 4674121
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/Listeners/SetupTelescopeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,30 @@ public function handle($event): void
if (Str::startsWith($entry->content['name'] ?? '', 'Spiral\\RoadRunnerLaravel\\')) {
return false;
}

break;

case EntryType::REQUEST:
if (Str::startsWith($entry->content['controller_action'] ?? '', 'Laravel\\Telescope\\')) {
return false;
}

break;

case EntryType::VIEW:
if (Str::startsWith($entry->content['name'] ?? '', 'telescope::')) {
return false;
}

break;

case EntryType::REDIS:
if (Str::contains($entry->content['command'] ?? '', [
'telescope:pause-recording',
'telescope:dump-watcher',
])) {
$cmd = $entry->content['command'] ?? '';

if (Str::contains($cmd, ['telescope:pause-recording', 'telescope:dump-watcher'])) {
return false;
}

break;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Listeners/SetupTelescopeListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function testHandle(): void
Telescope::recordEvent($event = new IncomingEntry(['name' => 'Spiral\\RoadRunnerLaravel\\']));
Telescope::recordRequest($request = new IncomingEntry(['controller_action' => 'Laravel\\Telescope\\']));
Telescope::recordView($view = new IncomingEntry(['name' => 'telescope::foo']));
Telescope::recordRedis($redis1 = new IncomingEntry(['command' => 'get laravel_cache:telescope:pause-recording']));
Telescope::recordRedis($redis2 = new IncomingEntry(['command' => 'get laravel_cache:telescope:dump-watcher']));
Telescope::recordRedis($redis1 = new IncomingEntry(['command' => 'get cache:telescope:pause-recording']));
Telescope::recordRedis($redis2 = new IncomingEntry(['command' => 'get cache:telescope:dump-watcher']));
$this->assertCount(5, Telescope::$entriesQueue);

Telescope::flushEntries();
Expand Down

0 comments on commit 4674121

Please sign in to comment.