Skip to content

Commit d392ae0

Browse files
committed
Fix up static analysis issues in collaboration.php
1 parent 46388e7 commit d392ae0

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/wp-includes/collaboration.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @return bool Whether real-time collaboration is enabled.
2020
*/
21-
function wp_is_collaboration_enabled() {
21+
function wp_is_collaboration_enabled(): bool {
2222
return (
2323
wp_is_collaboration_allowed() &&
2424
get_option( 'wp_collaboration_enabled' ) &&
@@ -38,7 +38,7 @@ function wp_is_collaboration_enabled() {
3838
*
3939
* @return bool Whether real-time collaboration is allowed.
4040
*/
41-
function wp_is_collaboration_allowed() {
41+
function wp_is_collaboration_allowed(): bool {
4242
if ( ! defined( 'WP_ALLOW_COLLABORATION' ) ) {
4343
$env_value = getenv( 'WP_ALLOW_COLLABORATION' );
4444
if ( false === $env_value ) {
@@ -47,14 +47,14 @@ function wp_is_collaboration_allowed() {
4747
} else {
4848
/*
4949
* Environment variable is defined, let's confirm it is actually set to
50-
* "true" as it may still have a string value "false" – the preceeding
50+
* "true" as it may still have a string value "false" – the preceding
5151
* `if` branch only tests for the boolean `false`.
5252
*/
5353
define( 'WP_ALLOW_COLLABORATION', 'true' === $env_value );
5454
}
5555
}
5656

57-
return WP_ALLOW_COLLABORATION;
57+
return (bool) WP_ALLOW_COLLABORATION;
5858
}
5959

6060
/**
@@ -66,7 +66,7 @@ function wp_is_collaboration_allowed() {
6666
*
6767
* @global string $pagenow The filename of the current screen.
6868
*/
69-
function wp_collaboration_inject_setting() {
69+
function wp_collaboration_inject_setting(): void {
7070
global $pagenow;
7171

7272
if ( ! wp_is_collaboration_enabled() ) {
@@ -94,8 +94,10 @@ function wp_collaboration_inject_setting() {
9494
* sessions are cleaned up to prevent unbounded table growth.
9595
*
9696
* @since 7.0.0
97+
*
98+
* @global wpdb $wpdb WordPress database abstraction object.
9799
*/
98-
function wp_delete_old_collaboration_data() {
100+
function wp_delete_old_collaboration_data(): void {
99101
global $wpdb;
100102

101103
if ( ! wp_is_collaboration_enabled() ) {
@@ -107,7 +109,7 @@ function wp_delete_old_collaboration_data() {
107109
wp_clear_scheduled_hook( 'wp_delete_old_collaboration_data' );
108110
}
109111

110-
/* Clean up rows older than 7 days. */
112+
// Clean up rows older than 7 days.
111113
$wpdb->query(
112114
$wpdb->prepare(
113115
"DELETE FROM {$wpdb->collaboration} WHERE date_gmt < %s",

0 commit comments

Comments
 (0)