Skip to content

Commit

Permalink
Remove PHPCS excludes.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 13, 2023
1 parent d1b29d5 commit eb2af36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 0 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<exclude-pattern>tests/wp-config.php</exclude-pattern>

<rule ref="PronamicWP">
<exclude name="PHPCompatibility.Interfaces.InternalInterfaces.datetimeinterfaceFound" />

<exclude name="Squiz.Commenting" />
</rule>
</ruleset>
10 changes: 8 additions & 2 deletions src/DateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
5 changes: 5 additions & 0 deletions tests/src/DateTimeZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit eb2af36

Please sign in to comment.