From 6aed2c92d1497aa1313631f3052bb409d67d9c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Thu, 10 Sep 2026 08:34:47 +0200 Subject: [PATCH] Code Modernization: Use the null coalescing operator in `wp_get_chromium_major_version()` tests. Replaces an `isset()` ternary with the null coalescing operator when reading `$_SERVER['HTTP_USER_AGENT']`. The operator is available since PHP 7.0 and WordPress requires PHP 7.4 or later. --- tests/phpunit/tests/media/wpGetChromiumMajorVersion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/media/wpGetChromiumMajorVersion.php b/tests/phpunit/tests/media/wpGetChromiumMajorVersion.php index 7249d9b91b665..eb03985116451 100644 --- a/tests/phpunit/tests/media/wpGetChromiumMajorVersion.php +++ b/tests/phpunit/tests/media/wpGetChromiumMajorVersion.php @@ -17,7 +17,7 @@ class Tests_Media_wpGetChromiumMajorVersion extends WP_UnitTestCase { public function set_up() { parent::set_up(); - $this->original_user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null; + $this->original_user_agent = $_SERVER['HTTP_USER_AGENT'] ?? null; } public function tear_down() {