Skip to content

Commit

Permalink
Minimalist docblock and fix some spacing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Camwyn committed Nov 9, 2023
1 parent 75ff515 commit 84d5a78
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Telemetry/Events/Event_Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
class Event_Subscriber extends Abstract_Subscriber {

/**
* Holds the events in a non-persistent way.
*
* @since 2.3.1
*
* @var array
*/
private static $events = [];
Expand Down Expand Up @@ -107,11 +103,11 @@ public function send_events() {
$events = filter_input( INPUT_POST, 'events', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); // phpcs:ignore WordPressVIPMinimum.Security.PHPFilterFunctions.RestrictedFilter

if ( empty( $events ) ) {
return;
return;
}

if ( ! is_array( $events ) ) {

Check failure on line 109 in src/Telemetry/Events/Event_Subscriber.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to function is_array() with non-empty-array<string> will always evaluate to true.
$events = (array) $events;
$events = (array) $events;
}

$this->container->get( Event::class )->send_batch( $events );
Expand Down

0 comments on commit 84d5a78

Please sign in to comment.