From f8de6e7d4c328156b3368d72a843a6c232d6ce53 Mon Sep 17 00:00:00 2001 From: Anton Vlasenko Date: Tue, 4 Jun 2024 02:11:24 +0200 Subject: [PATCH] Small optimization. --- tests/phpunit/tests/rest-api/rest-schema-setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index ed66a8a49d049..67f70d2ae7a06 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -759,9 +759,9 @@ private function normalize_fixture( $data, $path ) { return $data; } - foreach ( $data as $key => $value ) { - $datetime_keys = array( 'date', 'date_gmt', 'modified', 'modified_gmt' ); + $datetime_keys = array( 'date', 'date_gmt', 'modified', 'modified_gmt' ); + foreach ( $data as $key => $value ) { if ( is_string( $value ) ) { if ( in_array( $key, $datetime_keys, true ) ) { $data[ $key ] = '2017-02-14T00:00:00';