Skip to content

Commit 1a44948

Browse files
committed
Collaboration: Fix array arrow alignment after column rename
Align double arrow operators in arrays that reference the `data` column to satisfy WordPress coding standards (PHPCS). See #64696.
1 parent 9f78a21 commit 1a44948

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

src/wp-includes/collaboration/class-wp-collaboration-table-storage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public function add_update( string $room, $update ): bool {
5959
$result = $wpdb->insert(
6060
$wpdb->collaboration,
6161
array(
62-
'room' => $room,
63-
'type' => $update['type'] ?? '',
64-
'client_id' => $update['client_id'] ?? '',
65-
'data' => wp_json_encode( $update ),
66-
'date_gmt' => gmdate( 'Y-m-d H:i:s' ),
62+
'room' => $room,
63+
'type' => $update['type'] ?? '',
64+
'client_id' => $update['client_id'] ?? '',
65+
'data' => wp_json_encode( $update ),
66+
'date_gmt' => gmdate( 'Y-m-d H:i:s' ),
6767
),
6868
array( '%s', '%s', '%s', '%s', '%s' )
6969
);

tests/phpunit/tests/rest-api/rest-collaboration-server.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,16 +1165,16 @@ private function insert_collaboration_row( int $age_in_seconds, string $label =
11651165
$wpdb->insert(
11661166
$wpdb->collaboration,
11671167
array(
1168-
'room' => $this->get_post_room(),
1169-
'type' => 'update',
1170-
'client_id' => '1',
1171-
'data' => wp_json_encode(
1168+
'room' => $this->get_post_room(),
1169+
'type' => 'update',
1170+
'client_id' => '1',
1171+
'data' => wp_json_encode(
11721172
array(
11731173
'type' => 'update',
11741174
'data' => $label,
11751175
)
11761176
),
1177-
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - $age_in_seconds ),
1177+
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - $age_in_seconds ),
11781178
),
11791179
array( '%s', '%s', '%s', '%s', '%s' )
11801180
);
@@ -1441,12 +1441,12 @@ public function test_collaboration_expired_awareness_rows_cleaned_up(): void {
14411441
$wpdb->insert(
14421442
$wpdb->collaboration,
14431443
array(
1444-
'room' => $room,
1445-
'type' => 'awareness',
1446-
'client_id' => '99',
1447-
'user_id' => self::$editor_id,
1448-
'data' => wp_json_encode( array( 'cursor' => 'stale' ) ),
1449-
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - 120 ),
1444+
'room' => $room,
1445+
'type' => 'awareness',
1446+
'client_id' => '99',
1447+
'user_id' => self::$editor_id,
1448+
'data' => wp_json_encode( array( 'cursor' => 'stale' ) ),
1449+
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - 120 ),
14501450
),
14511451
array( '%s', '%s', '%s', '%d', '%s', '%s' )
14521452
);
@@ -1497,12 +1497,12 @@ public function test_cron_cleanup_deletes_expired_awareness_rows(): void {
14971497
$wpdb->insert(
14981498
$wpdb->collaboration,
14991499
array(
1500-
'room' => $this->get_post_room(),
1501-
'type' => 'awareness',
1502-
'client_id' => '42',
1503-
'user_id' => self::$editor_id,
1504-
'data' => wp_json_encode( array( 'cursor' => 'old' ) ),
1505-
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - 120 ),
1500+
'room' => $this->get_post_room(),
1501+
'type' => 'awareness',
1502+
'client_id' => '42',
1503+
'user_id' => self::$editor_id,
1504+
'data' => wp_json_encode( array( 'cursor' => 'old' ) ),
1505+
'date_gmt' => gmdate( 'Y-m-d H:i:s', time() - 120 ),
15061506
),
15071507
array( '%s', '%s', '%s', '%d', '%s', '%s' )
15081508
);
@@ -1567,12 +1567,12 @@ public function test_collaboration_awareness_non_array_json_ignored() {
15671567
$wpdb->insert(
15681568
$wpdb->collaboration,
15691569
array(
1570-
'room' => $room,
1571-
'type' => 'awareness',
1572-
'client_id' => '99',
1573-
'user_id' => self::$editor_id,
1574-
'data' => '"hello"',
1575-
'date_gmt' => gmdate( 'Y-m-d H:i:s' ),
1570+
'room' => $room,
1571+
'type' => 'awareness',
1572+
'client_id' => '99',
1573+
'user_id' => self::$editor_id,
1574+
'data' => '"hello"',
1575+
'date_gmt' => gmdate( 'Y-m-d H:i:s' ),
15761576
),
15771577
array( '%s', '%s', '%s', '%d', '%s', '%s' )
15781578
);

0 commit comments

Comments
 (0)