Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Aug 25, 2023
1 parent 40a6cb6 commit f3c5f91
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 59 deletions.
45 changes: 0 additions & 45 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\Cache\\:\\:cacheInteractions\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/Cache.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\Cache\\:\\:monitoredCacheInteractions\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/Cache.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\Cache\\:\\:monitoredKeys\\(\\) return type with generic class Illuminate\\\\Support\\\\Collection does not specify its types\\: TKey, TValue$#"
count: 1
path: src/Livewire/Cache.php

-
message: "#^Unable to resolve the template type TKey in call to function collect$#"
count: 1
Expand All @@ -25,36 +10,6 @@ parameters:
count: 1
path: src/Livewire/Cache.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\Exceptions\\:\\:exceptions\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/Exceptions.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\SlowJobs\\:\\:slowJobs\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/SlowJobs.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\SlowOutgoingRequests\\:\\:slowOutgoingRequests\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/SlowOutgoingRequests.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\SlowQueries\\:\\:slowQueries\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/SlowQueries.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\SlowRoutes\\:\\:slowRoutes\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/SlowRoutes.php

-
message: "#^Method Laravel\\\\Pulse\\\\Livewire\\\\Usage\\:\\:userRequestCounts\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Livewire/Usage.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\HigherOrderCollectionProxy\\:\\:resolve\\(\\)\\.$#"
count: 1
Expand Down
9 changes: 8 additions & 1 deletion src/Livewire/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public function placeholder(): Renderable

/**
* All the cache interactions.
*
* @return array{mixed, int, string}
*/
protected function cacheInteractions(callable $query): array
{
Expand All @@ -64,6 +66,8 @@ protected function cacheInteractions(callable $query): array

/**
* The monitored cache interactions.
*
* @return array{mixed, int, string}
*/
protected function monitoredCacheInteractions(callable $query): array
{
Expand All @@ -80,7 +84,10 @@ protected function monitoredCacheInteractions(callable $query): array
});
}

/** The monitored keys.
/**
* The monitored keys.
*
* @return \Illuminate\Support\Collection<string, string>
*/
protected function monitoredKeys(): Collection
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function placeholder(): Renderable

/**
* The exceptions.
*
* @return array{mixed, int, string}
*/
protected function exceptions(callable $query): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/SlowJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function placeholder(): Renderable

/**
* The slow jobs.
*
* @return array{mixed, int, string}
*/
protected function slowJobs(callable $query): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/SlowOutgoingRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function placeholder(): Renderable

/**
* The slow outgoing requests.
*
* @return array{mixed, int, string}
*/
protected function slowOutgoingRequests(callable $query): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/SlowQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function placeholder(): Renderable

/**
* The slow queries.
*
* @return array{mixed, int, string}
*/
protected function slowQueries(callable $query): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/SlowRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function placeholder(): Renderable

/**
* The slow routes.
*
* @return array{mixed, int, string}
*/
protected function slowRoutes(callable $query): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Livewire/Usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public function placeholder(): Renderable

/**
* The user request counts.
*
* @return array{mixed, int, string}
*/
protected function userRequestCounts(callable $query): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Recorders/CacheInteractions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CacheInteractions
public array $listen = [CacheHit::class, CacheMissed::class];

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand All @@ -36,7 +36,7 @@ public function __construct(
}

/**
* Handle a cache miss.
* Record the cache interaction.
*/
public function record(CacheHit|CacheMissed $event): ?Entry
{
Expand Down
4 changes: 2 additions & 2 deletions src/Recorders/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Exceptions
public string $table = 'pulse_exceptions';

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand All @@ -37,7 +37,7 @@ public function register(callable $record, ExceptionHandler $handler): void
}

/**
* Handle an exception.
* Record the exception.
*/
public function record(Throwable $e): Entry
{
Expand Down
5 changes: 4 additions & 1 deletion src/Recorders/Jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Jobs
];

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand All @@ -43,6 +43,9 @@ public function __construct(
//
}

/**
* Record the job.
*/
public function record(JobFailed|JobProcessed|JobProcessing|JobQueued $event): Entry|Update
{
// TODO: currently if a job fails, we have no way of tracking it through properly.
Expand Down
4 changes: 2 additions & 2 deletions src/Recorders/OutgoingRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OutgoingRequests
public string $table = 'pulse_outgoing_requests';

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand Down Expand Up @@ -64,7 +64,7 @@ public function register(callable $record, Application $app): void
}

/**
* Record the request information.
* Record the outgoing request.
*/
public function record(RequestInterface $request, CarbonImmutable $startedAt): Entry
{
Expand Down
5 changes: 4 additions & 1 deletion src/Recorders/QueueSizes.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class QueueSizes
*/
public string $listen = Beat::class;

/**
* Create a new recorder instance.
*/
public function __construct(
protected Repository $config,
protected QueueManager $queue,
Expand All @@ -38,7 +41,7 @@ public function __construct(
}

/**
* Resolve the queue size.
* Record the queue sizes.
*
* @return \Illuminate\Support\Collection<int, \Laravel\Pulse\Entries\Entry>
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Recorders/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Requests
public string $table = 'pulse_requests';

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand All @@ -38,7 +38,7 @@ public function register(callable $record, Kernel $kernel): void
}

/**
* Handle the completion of an HTTP request.
* Record the request.
*/
public function record(Carbon $startedAt, Request $request, Response $response): Entry
{
Expand Down
4 changes: 2 additions & 2 deletions src/Recorders/SlowQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SlowQueries
public string $listen = QueryExecuted::class;

/**
* Create a new handler instance.
* Create a new recorder instance.
*/
public function __construct(
protected Pulse $pulse,
Expand All @@ -36,7 +36,7 @@ public function __construct(
}

/**
* Handle the execution of a database query.
* Record a slow query.
*/
public function record(QueryExecuted $event): ?Entry
{
Expand Down
5 changes: 4 additions & 1 deletion src/Recorders/SystemStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ class SystemStats
*/
public string $listen = Beat::class;

/**
* Create a new recorder instance.
*/
public function __construct(
protected Repository $config,
) {
//
}

/**
* Resolve the systems stats.
* Record the system stats.
*/
public function record(Beat $event): ?Entry
{
Expand Down

0 comments on commit f3c5f91

Please sign in to comment.