Skip to content

Commit 34ddcca

Browse files
committed
fix php cs
Fix tests
1 parent 6b1df28 commit 34ddcca

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/general/user-interface/opt-in-route.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
use WP_REST_Request;
66
use WP_REST_Response;
7-
use Yoast\WP\SEO\Main;
87
use Yoast\WP\SEO\Conditionals\No_Conditionals;
98
use Yoast\WP\SEO\Helpers\Capability_Helper;
109
use Yoast\WP\SEO\Helpers\User_Helper;
10+
use Yoast\WP\SEO\Main;
1111
use Yoast\WP\SEO\Routes\Route_Interface;
1212

1313
/**
1414
* Registers a route to get dismiss opt in notification.
15-
*
1615
*/
1716
class Opt_In_Route implements Route_Interface {
1817

@@ -49,11 +48,11 @@ class Opt_In_Route implements Route_Interface {
4948
/**
5049
* Constructs Opt_In_Route.
5150
*
52-
* @param User_Helper $user_helper The user helper.
51+
* @param User_Helper $user_helper The user helper.
5352
* @param Capability_Helper $capability_helper The capability helper.
5453
*/
5554
public function __construct( User_Helper $user_helper, Capability_Helper $capability_helper ) {
56-
$this->user_helper = $user_helper;
55+
$this->user_helper = $user_helper;
5756
$this->capability_helper = $capability_helper;
5857
}
5958

@@ -91,9 +90,9 @@ public function set_opt_in_seen( $request ) {
9190
$key = $request->get_param( 'key' );
9291
$current_user_id = $this->user_helper->get_current_user_id();
9392

94-
$result = $this->user_helper->update_meta( $current_user_id, $key, true );
93+
$result = $this->user_helper->update_meta( $current_user_id, $key, true );
9594
$success = $result !== false;
96-
$status = $success ? 200 : 400;
95+
$status = ( $success ) ? 200 : 400;
9796

9897
return new WP_REST_Response(
9998
(object) [
@@ -125,6 +124,6 @@ public function validate_key( $key ) {
125124
'wpseo_seen_llm_txt_opt_in_notification',
126125
];
127126

128-
return in_array( $key, $allowed_keys, true );
127+
return \in_array( $key, $allowed_keys, true );
129128
}
130129
}

tests/Unit/General/User_Interface/General_Page_Integration_Test.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,6 @@ public function test_enqueue_assets() {
334334
->once()
335335
->andReturn( false );
336336

337-
$this->user_helper
338-
->expects( 'update_meta' )
339-
->with( 1, 'wpseo_seen_llm_txt_opt_in_notification', true )
340-
->once();
341-
342337
$this->options_helper
343338
->expects( 'get' )
344339
->with( 'enable_llms_txt', true )

0 commit comments

Comments
 (0)