Skip to content

Commit

Permalink
Phpstan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Camwyn committed Nov 8, 2023
1 parent f90ea7b commit 265e306
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/Telemetry/Admin/Admin_Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Admin_Subscriber extends Abstract_Subscriber {
*/
public function register(): void {
add_action( 'admin_init', [ $this, 'maybe_enqueue_admin_assets' ] );

}

/**
Expand Down Expand Up @@ -59,5 +58,4 @@ public function maybe_enqueue_admin_assets() {
$this->container->get( Resources::class )->enqueue_admin_assets();
}
}

}
1 change: 0 additions & 1 deletion src/Telemetry/Admin/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ public function enqueue_styles() {
public static function get_asset_path(): string {
return plugin_dir_url( dirname( __DIR__ ) );
}

}
1 change: 0 additions & 1 deletion src/Telemetry/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,4 @@ public static function add_stellar_slug( string $stellar_slug, string $wp_slug =
public static function set_server_url( string $url ) {
static::$server_url = $url;
}

}
1 change: 0 additions & 1 deletion src/Telemetry/Contracts/Abstract_Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ abstract class Abstract_Subscriber implements Subscriber_Interface {
public function __construct( ContainerInterface $container ) {
$this->container = $container;
}

}
1 change: 0 additions & 1 deletion src/Telemetry/Contracts/Subscriber_Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ interface Subscriber_Interface {
* @return void
*/
public function register();

}
1 change: 0 additions & 1 deletion src/Telemetry/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,4 @@ protected function get_url() {
*/
return apply_filters( 'stellarwp/telemetry/' . Config::get_hook_prefix() . 'events_url', $events_url );
}

}
2 changes: 0 additions & 2 deletions src/Telemetry/Exit_Interview/Exit_Interview_Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use StellarWP\Telemetry\Contracts\Abstract_Subscriber;
use StellarWP\Telemetry\Config;
use StellarWP\Telemetry\Core;
use StellarWP\Telemetry\Opt_In\Status;
use StellarWP\Telemetry\Telemetry\Telemetry;

Expand Down Expand Up @@ -161,5 +160,4 @@ public function plugin_action_links( $links, $plugin_file ) {

return array_merge( $before_deactivate, $after_deactivate );
}

}
1 change: 0 additions & 1 deletion src/Telemetry/Last_Send/Last_Send.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ public function get_timestamp() {

return $result;
}

}
5 changes: 2 additions & 3 deletions src/Telemetry/Opt_In/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function get() {

$status = self::STATUS_INACTIVE;
$option = $this->get_option();
$plugins = isset( $option['plugins'] ) ? $option['plugins'] : [];
$plugins = $option['plugins'] ?? [];

if ( count( $plugins ) === 0 ) {
$status = self::STATUS_INACTIVE;
Expand Down Expand Up @@ -242,11 +242,10 @@ public function set_status( bool $status, string $stellar_slug = '' ) {
$option['plugins'][ $stellar_slug ]['optin'] = $status;

// Force the others to all match.
foreach( $option['plugins'] as &$plugin_data ) {
foreach ( $option['plugins'] as &$plugin_data ) {
$plugin_data['optin'] = $status;
}


return update_option( $this->get_option_name(), $option );
}

Expand Down

0 comments on commit 265e306

Please sign in to comment.