From eb2af369f3581a33195bc2719d9898abc838a265 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Fri, 13 Oct 2023 12:03:05 +0200 Subject: [PATCH] Remove PHPCS excludes. --- phpcs.xml.dist | 2 -- src/DateTimeTrait.php | 10 ++++++++-- tests/src/DateTimeZoneTest.php | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 849c2fc..21e8970 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -7,8 +7,6 @@ tests/wp-config.php - - diff --git a/src/DateTimeTrait.php b/src/DateTimeTrait.php index 0cb4a51..a3bf1af 100644 --- a/src/DateTimeTrait.php +++ b/src/DateTimeTrait.php @@ -251,11 +251,17 @@ public function format_i18n( $format = null ) { * * {@inheritdoc} * + * @param string $format Format. + * @param string $time String representing the time. + * @param DateTimeZone|null $timezone Timezone. * @return self|false */ #[\ReturnTypeWillChange] - // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid - public static function createFromFormat( $format, $time, $timezone = null ) { + public static function createFromFormat( // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid + $format, + $time, + $timezone = null + ) { return self::create_from_format( $format, $time, $timezone ); } diff --git a/tests/src/DateTimeZoneTest.php b/tests/src/DateTimeZoneTest.php index e9b9fe0..8e33b85 100644 --- a/tests/src/DateTimeZoneTest.php +++ b/tests/src/DateTimeZoneTest.php @@ -35,6 +35,9 @@ public function test_constructor() { * Test get default timezone. * * @dataProvider provider_test_get_default + * @param string|null $wp_timezone WordPress timezone. + * @param float|null $wp_gmt_offset WordPress GMT offset. + * @param string $expected Expected timezone. */ public function test_get_default( $wp_timezone, $wp_gmt_offset, $expected ) { \update_option( 'timezone_string', $wp_timezone ); @@ -63,6 +66,8 @@ public function provider_test_get_default() { * WordPress stores offset in hours, `DateTimeZone::getOffset` will return in seconds. * * @dataProvider provider_test_offsets + * @param float $wp_offset WordPress offset. + * @param int $php_offset PHP offset. */ public function test_offsets( $wp_offset, $php_offset ) { \update_option( 'timezone_string', null );