Skip to content

Commit 271778f

Browse files
committed
fix: coding standards
1 parent 5a1fade commit 271778f

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/wp-includes/ai-client/adapters/class-wp-ai-client-cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class WP_AI_Client_Cache implements CacheInterface {
3636
*
3737
* @return string Cache group name.
3838
*/
39-
private function get_cache_group(): string {
39+
private function get_cache_group(): string {
4040
/**
4141
* Filter the cache group used by the WP AI Client cache adapter.
4242
*

tests/phpunit/tests/ai-client/wpAiClientCache.php

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -225,28 +225,34 @@ public function test_ttl_with_date_interval() {
225225
* @ticket 65127
226226
*/
227227
public function test_cache_group_filter_is_respected() {
228-
add_filter( 'wp_ai_client_cache_group', function( $group ) {
229-
return 'wp_ai_client_tests_group';
230-
} );
228+
add_filter(
229+
'wp_ai_client_cache_group',
230+
function ( $group ) {
231+
return 'wp_ai_client_tests_group';
232+
}
233+
);
231234

232-
$set = $this->cache->set( 'ai_test_key', 'ai_value', 3600 );
233-
$this->assertTrue( $set );
235+
$set = $this->cache->set( 'ai_test_key', 'ai_value', 3600 );
236+
$this->assertTrue( $set );
234237

235-
// Directly read from the underlying object cache using the expected group.
236-
$value = wp_cache_get( 'ai_test_key', 'wp_ai_client_tests_group' );
237-
$this->assertSame( 'ai_value', $value );
238-
}
238+
// Directly read from the underlying object cache using the expected group.
239+
$value = wp_cache_get( 'ai_test_key', 'wp_ai_client_tests_group' );
240+
$this->assertSame( 'ai_value', $value );
241+
}
239242

240243
/**
241244
* Test that a non-string cache group filter value is cast to string.
242-
*
245+
*
243246
* @ticket 65127
244247
*/
245248
public function test_cache_group_filter_returns_non_string() {
246-
add_filter( 'wp_ai_client_cache_group', function( $group ) {
247-
return 12345; // Non-string value.
248-
} );
249-
249+
add_filter(
250+
'wp_ai_client_cache_group',
251+
function ( $group ) {
252+
return 12345; // Non-string value.
253+
}
254+
);
255+
250256
$set = $this->cache->set( 'ai_test_key', 'ai_value', 3600 );
251257
$this->assertTrue( $set );
252258

0 commit comments

Comments
 (0)