From 16b35ae2ab2bd7785d4658b783656ffb1a24e29c Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 26 Nov 2021 13:23:11 -0300 Subject: [PATCH 1/2] Removed leftovers from some debugging --- tools/changelogger/Formatter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/changelogger/Formatter.php b/tools/changelogger/Formatter.php index f24f63d007a..14d8127c3bd 100644 --- a/tools/changelogger/Formatter.php +++ b/tools/changelogger/Formatter.php @@ -239,7 +239,6 @@ class Formatter extends KeepAChangelogParser { $version = $entry->getVersion(); $is_subentry = preg_match( $this->subentry_pattern, $version, $subentry ); $timestamp = $entry->getTimestamp(); - error_log(print_r($version, true)); $release_link = $this->getReleaseLink( $version ); if ( $is_subentry ) { From a8060e34d35b3fecbf648a16c9525e5a65ad0a82 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 26 Nov 2021 13:25:43 -0300 Subject: [PATCH 2/2] Fixed global namespace of DateTime and DateTimeZone Fixes a PHP Fatal error: ``` PHP Fatal error: Uncaught Error: Class 'Automattic\WooCommerce\MonorepoTools\Changelogger\DateTime' not found in /var/www/woo/wp-content/plugins/woocommerce/tools/changelogger/Formatter.php:143 ``` --- tools/changelogger/Formatter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/changelogger/Formatter.php b/tools/changelogger/Formatter.php index 14d8127c3bd..1d2192d1a1e 100644 --- a/tools/changelogger/Formatter.php +++ b/tools/changelogger/Formatter.php @@ -140,15 +140,15 @@ class Formatter extends KeepAChangelogParser { } $version = ''; - $timestamp = new DateTime( 'now', new DateTimeZone( 'UTC' ) ); - $entry_timestamp = new DateTime( 'now', new DateTimeZone( 'UTC' ) ); + $timestamp = new \DateTime( 'now', new \DateTimeZone( 'UTC' ) ); + $entry_timestamp = new \DateTime( 'now', new \DateTimeZone( 'UTC' ) ); if ( count( $heading ) ) { $version = $heading[1]; $timestamp = $heading[2]; try { - $timestamp = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) ); + $timestamp = new \DateTime( $timestamp, new \DateTimeZone( 'UTC' ) ); } catch ( \Exception $ex ) { throw new \InvalidArgumentException( "Heading has an invalid timestamp: $heading", 0, $ex ); }