Skip to content

Commit

Permalink
Fixed phpstan & phpcs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee committed Jul 29, 2024
1 parent 66c9ebd commit ca9477a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
11 changes: 4 additions & 7 deletions inc/Engine/Common/PerformanceHints/Admin/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Controller {
* @param array $factories Array of factories.
*/
public function __construct( array $factories ) {
$this->factories = $factories;
$this->factories = $factories;
}

/**
Expand Down Expand Up @@ -58,7 +58,6 @@ private function delete_rows() {
'3.16.4',
'rocket_after_clear_atf'
);

}

/**
Expand Down Expand Up @@ -96,7 +95,7 @@ public function delete_term( $term_id ) {

$url = get_term_link( (int) $term_id );

if ( is_wp_error( $url ) ) {
if ( is_wp_error( $url ) ) {
return;
}

Expand All @@ -106,11 +105,9 @@ public function delete_term( $term_id ) {
/**
* Deletes rows when triggering clean from admin
*
* @param array $clean An array containing the status and message.
*
* @return array
*/
public function truncate_from_admin( $clean ) {
public function truncate_from_admin() {
if ( empty( $this->factories ) ) {
return;
}
Expand Down Expand Up @@ -180,4 +177,4 @@ private function delete_by_url( string $url ) {
$factory->queries()->delete_by_url( untrailingslashit( $url ) );
}
}
}
}
8 changes: 3 additions & 5 deletions inc/Engine/Common/PerformanceHints/Admin/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Subscriber implements Subscriber_Interface {
/**
* Instantiate the class
*
* @param AdminContext $controller Controller instance.
* @param Controller $controller Controller instance.
*/
public function __construct( Controller $controller ) {
$this->controller = $controller;
Expand Down Expand Up @@ -78,12 +78,10 @@ public function delete_term( int $term_id ): void {
/**
* Deletes rows when triggering clean from admin
*
* @param array $clean An array containing the status and message.
*
* @return array
*/
public function truncate_from_admin( array $clean ): array {
return $this->controller->truncate_from_admin( $clean );
public function truncate_from_admin(): array {
return $this->controller->truncate_from_admin();
}

/**
Expand Down
10 changes: 5 additions & 5 deletions inc/Engine/Common/PerformanceHints/WarmUp/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public function __construct( Controller $controller ) {
*/
public static function get_subscribed_events(): array {
return [
'wp_rocket_upgrade' => [ 'warm_up_on_update', 10, 2 ],
'rocket_after_clear_performance_hints_data' => 'warm_up_home',
'rocket_job_warmup' => 'warm_up',
'rocket_job_warmup_url' => 'send_to_saas',
'rocket_saas_api_queued_url' => 'add_wpr_imagedimensions_query_arg',
'wp_rocket_upgrade' => [ 'warm_up_on_update', 10, 2 ],
'rocket_after_clear_performance_hints_data' => 'warm_up_home',
'rocket_job_warmup' => 'warm_up',
'rocket_job_warmup_url' => 'send_to_saas',
'rocket_saas_api_queued_url' => 'add_wpr_imagedimensions_query_arg',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Brain\Monkey\Functions;
use Mockery;
use WP_Rocket\Tests\Unit\TestCase;
use function Brain\Monkey\Functions;
use WP_Rocket\Engine\Common\PerformanceHints\Admin\Controller;
use WP_Rocket\Engine\Media\AboveTheFold\Factory as ATFFactory;
use WP_Rocket\Engine\Media\AboveTheFold\Database\Queries\AboveTheFold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Brain\Monkey\Functions;
use Mockery;
use WP_Rocket\Tests\Unit\TestCase;
use function Brain\Monkey\Functions;
use WP_Rocket\Engine\Common\PerformanceHints\Admin\Controller;
use WP_Rocket\Engine\Media\AboveTheFold\Factory as ATFFactory;
use WP_Rocket\Engine\Media\AboveTheFold\Database\Queries\AboveTheFold;
Expand Down

0 comments on commit ca9477a

Please sign in to comment.