From 7229b65bc97eda1676373c3698375e7676cafc8f Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 7 Jul 2022 08:54:48 +1200 Subject: [PATCH] Changelogger: Fix PHPCS violations (#33664) --- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/admin-e2e-tests/composer.json | 2 +- .../js/api/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/api/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/components/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/csv-export/composer.json | 2 +- .../currency/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/currency/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ .../js/customer-effort-score/composer.json | 2 +- .../js/data/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/data/composer.json | 2 +- .../js/date/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/date/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ .../composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/eslint-plugin/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/experimental/composer.json | 2 +- .../explat/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/explat/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ .../extend-cart-checkout-block/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/navigation/composer.json | 2 +- .../number/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/number/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ packages/js/onboarding/composer.json | 2 +- .../tracks/changelog/fix-changelogger-phpcs | 5 +++++ packages/js/tracks/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ plugins/woocommerce-beta-tester/composer.json | 2 +- .../changelog/fix-changelogger-phpcs | 5 +++++ plugins/woocommerce/composer.json | 2 +- .../{Formatter.php => class-formatter.php} | 21 ++++++++++++------- ...er.php => class-legacy-core-formatter.php} | 18 ++++++++++------ ...matter.php => class-package-formatter.php} | 13 ++++++++---- ...rmatter.php => class-plugin-formatter.php} | 9 ++++++-- 42 files changed, 155 insertions(+), 39 deletions(-) create mode 100644 packages/js/admin-e2e-tests/changelog/fix-changelogger-phpcs create mode 100644 packages/js/api/changelog/fix-changelogger-phpcs create mode 100644 packages/js/components/changelog/fix-changelogger-phpcs create mode 100644 packages/js/csv-export/changelog/fix-changelogger-phpcs create mode 100644 packages/js/currency/changelog/fix-changelogger-phpcs create mode 100644 packages/js/customer-effort-score/changelog/fix-changelogger-phpcs create mode 100644 packages/js/data/changelog/fix-changelogger-phpcs create mode 100644 packages/js/date/changelog/fix-changelogger-phpcs create mode 100644 packages/js/dependency-extraction-webpack-plugin/changelog/fix-changelogger-phpcs create mode 100644 packages/js/eslint-plugin/changelog/fix-changelogger-phpcs create mode 100644 packages/js/experimental/changelog/fix-changelogger-phpcs create mode 100644 packages/js/explat/changelog/fix-changelogger-phpcs create mode 100644 packages/js/extend-cart-checkout-block/changelog/fix-changelogger-phpcs create mode 100644 packages/js/navigation/changelog/fix-changelogger-phpcs create mode 100644 packages/js/number/changelog/fix-changelogger-phpcs create mode 100644 packages/js/onboarding/changelog/fix-changelogger-phpcs create mode 100644 packages/js/tracks/changelog/fix-changelogger-phpcs create mode 100644 plugins/woocommerce-beta-tester/changelog/fix-changelogger-phpcs create mode 100644 plugins/woocommerce/changelog/fix-changelogger-phpcs rename tools/changelogger/{Formatter.php => class-formatter.php} (95%) rename tools/changelogger/{LegacyCoreFormatter.php => class-legacy-core-formatter.php} (81%) rename tools/changelogger/{PackageFormatter.php => class-package-formatter.php} (77%) rename tools/changelogger/{PluginFormatter.php => class-plugin-formatter.php} (78%) diff --git a/packages/js/admin-e2e-tests/changelog/fix-changelogger-phpcs b/packages/js/admin-e2e-tests/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/admin-e2e-tests/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/admin-e2e-tests/composer.json b/packages/js/admin-e2e-tests/composer.json index 81b02367054..90649ce14ac 100644 --- a/packages/js/admin-e2e-tests/composer.json +++ b/packages/js/admin-e2e-tests/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/api/changelog/fix-changelogger-phpcs b/packages/js/api/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/api/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/api/composer.json b/packages/js/api/composer.json index 0e93d583efb..384ed03b22e 100644 --- a/packages/js/api/composer.json +++ b/packages/js/api/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/components/changelog/fix-changelogger-phpcs b/packages/js/components/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/components/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/components/composer.json b/packages/js/components/composer.json index 45f2dfee81f..9bb6df42457 100644 --- a/packages/js/components/composer.json +++ b/packages/js/components/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/csv-export/changelog/fix-changelogger-phpcs b/packages/js/csv-export/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/csv-export/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/csv-export/composer.json b/packages/js/csv-export/composer.json index 9a798be3159..2ac2f972b1e 100644 --- a/packages/js/csv-export/composer.json +++ b/packages/js/csv-export/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/currency/changelog/fix-changelogger-phpcs b/packages/js/currency/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/currency/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/currency/composer.json b/packages/js/currency/composer.json index 80cc0bc3e64..f4975d986e9 100644 --- a/packages/js/currency/composer.json +++ b/packages/js/currency/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/customer-effort-score/changelog/fix-changelogger-phpcs b/packages/js/customer-effort-score/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/customer-effort-score/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/customer-effort-score/composer.json b/packages/js/customer-effort-score/composer.json index f8caaaa07d3..bc3c8c58268 100644 --- a/packages/js/customer-effort-score/composer.json +++ b/packages/js/customer-effort-score/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/data/changelog/fix-changelogger-phpcs b/packages/js/data/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/data/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/data/composer.json b/packages/js/data/composer.json index 9212cbdbd1d..62170ffbdf8 100644 --- a/packages/js/data/composer.json +++ b/packages/js/data/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/date/changelog/fix-changelogger-phpcs b/packages/js/date/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/date/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/date/composer.json b/packages/js/date/composer.json index de7796f9a9f..ba72efa1dc9 100644 --- a/packages/js/date/composer.json +++ b/packages/js/date/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/dependency-extraction-webpack-plugin/changelog/fix-changelogger-phpcs b/packages/js/dependency-extraction-webpack-plugin/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/dependency-extraction-webpack-plugin/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/dependency-extraction-webpack-plugin/composer.json b/packages/js/dependency-extraction-webpack-plugin/composer.json index 8f331940dac..e093fbc6bc4 100644 --- a/packages/js/dependency-extraction-webpack-plugin/composer.json +++ b/packages/js/dependency-extraction-webpack-plugin/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/eslint-plugin/changelog/fix-changelogger-phpcs b/packages/js/eslint-plugin/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/eslint-plugin/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/eslint-plugin/composer.json b/packages/js/eslint-plugin/composer.json index 983cb1986e3..8d62a41f972 100644 --- a/packages/js/eslint-plugin/composer.json +++ b/packages/js/eslint-plugin/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/experimental/changelog/fix-changelogger-phpcs b/packages/js/experimental/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/experimental/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/experimental/composer.json b/packages/js/experimental/composer.json index 85ea1a64722..e3476415ee7 100644 --- a/packages/js/experimental/composer.json +++ b/packages/js/experimental/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/explat/changelog/fix-changelogger-phpcs b/packages/js/explat/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/explat/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/explat/composer.json b/packages/js/explat/composer.json index 2def9999e77..c743758573e 100644 --- a/packages/js/explat/composer.json +++ b/packages/js/explat/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/extend-cart-checkout-block/changelog/fix-changelogger-phpcs b/packages/js/extend-cart-checkout-block/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/extend-cart-checkout-block/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/extend-cart-checkout-block/composer.json b/packages/js/extend-cart-checkout-block/composer.json index 2f930244052..9c44b2a742c 100644 --- a/packages/js/extend-cart-checkout-block/composer.json +++ b/packages/js/extend-cart-checkout-block/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/navigation/changelog/fix-changelogger-phpcs b/packages/js/navigation/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/navigation/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/navigation/composer.json b/packages/js/navigation/composer.json index 3e8269b5ad8..b7f58a6164e 100644 --- a/packages/js/navigation/composer.json +++ b/packages/js/navigation/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/number/changelog/fix-changelogger-phpcs b/packages/js/number/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/number/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/number/composer.json b/packages/js/number/composer.json index 29ed9a6abc6..caf1ed82b65 100644 --- a/packages/js/number/composer.json +++ b/packages/js/number/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/onboarding/changelog/fix-changelogger-phpcs b/packages/js/onboarding/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/onboarding/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/onboarding/composer.json b/packages/js/onboarding/composer.json index 0cb0739e711..20ce9b28533 100644 --- a/packages/js/onboarding/composer.json +++ b/packages/js/onboarding/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/packages/js/tracks/changelog/fix-changelogger-phpcs b/packages/js/tracks/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/packages/js/tracks/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/packages/js/tracks/composer.json b/packages/js/tracks/composer.json index e868a78e030..8c8141d9e26 100644 --- a/packages/js/tracks/composer.json +++ b/packages/js/tracks/composer.json @@ -15,7 +15,7 @@ "extra": { "changelogger": { "formatter": { - "filename": "../../../tools/changelogger/PackageFormatter.php" + "filename": "../../../tools/changelogger/class-package-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/plugins/woocommerce-beta-tester/changelog/fix-changelogger-phpcs b/plugins/woocommerce-beta-tester/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/plugins/woocommerce-beta-tester/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/plugins/woocommerce-beta-tester/composer.json b/plugins/woocommerce-beta-tester/composer.json index 5d4decbf0e3..34687ba440f 100644 --- a/plugins/woocommerce-beta-tester/composer.json +++ b/plugins/woocommerce-beta-tester/composer.json @@ -36,7 +36,7 @@ }, "changelogger": { "formatter": { - "filename": "../../tools/changelogger/PluginFormatter.php" + "filename": "../../tools/changelogger/class-plugin-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/plugins/woocommerce/changelog/fix-changelogger-phpcs b/plugins/woocommerce/changelog/fix-changelogger-phpcs new file mode 100644 index 00000000000..10fdefc7d22 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-changelogger-phpcs @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: PHPCS violation fixes + + diff --git a/plugins/woocommerce/composer.json b/plugins/woocommerce/composer.json index 58c05d0ccf6..1cf78d29c85 100644 --- a/plugins/woocommerce/composer.json +++ b/plugins/woocommerce/composer.json @@ -126,7 +126,7 @@ }, "changelogger": { "formatter": { - "filename": "../../tools/changelogger/LegacyCoreFormatter.php" + "filename": "../../tools/changelogger/class-legacy-core-formatter.php" }, "types": { "fix": "Fixes an existing bug", diff --git a/tools/changelogger/Formatter.php b/tools/changelogger/class-formatter.php similarity index 95% rename from tools/changelogger/Formatter.php rename to tools/changelogger/class-formatter.php index 4ba27e5bfda..a74816fefa7 100644 --- a/tools/changelogger/Formatter.php +++ b/tools/changelogger/class-formatter.php @@ -1,4 +1,9 @@ bullet . '/', '', $row, 1 ); $row_segments = explode( ' - ', $row ); $significance = trim( strtolower( $row_segments[0] ) ); - + array_push( $changes, array( 'subheading' => $is_subentry ? '' : trim( $row_segments[0] ), - 'content' => $is_subentry ? trim( $row ) : trim( isset($row_segments[1]) ? $row_segments[1] : '' ), - 'significance' => in_array( $significance, array( 'patch', 'minor', 'major' ) ) ? $significance : null, + 'content' => $is_subentry ? trim( $row ) : trim( isset( $row_segments[1] ) ? $row_segments[1] : '' ), + 'significance' => in_array( $significance, array( 'patch', 'minor', 'major' ), true ) ? $significance : null, ) ); } diff --git a/tools/changelogger/LegacyCoreFormatter.php b/tools/changelogger/class-legacy-core-formatter.php similarity index 81% rename from tools/changelogger/LegacyCoreFormatter.php rename to tools/changelogger/class-legacy-core-formatter.php index 9e3d5f1d44f..f6b08b04a67 100644 --- a/tools/changelogger/LegacyCoreFormatter.php +++ b/tools/changelogger/class-legacy-core-formatter.php @@ -1,4 +1,9 @@ getEntries() as $entry ) { $version = $entry->getVersion(); - if ( substr_count( $version, '.' ) == 1 ) { - $version .= '.0'; + if ( substr_count( $version, '.' ) === 1 ) { + $version .= '.0'; } $ret .= "= $version YYYY-mm-dd =\n\n"; diff --git a/tools/changelogger/PackageFormatter.php b/tools/changelogger/class-package-formatter.php similarity index 77% rename from tools/changelogger/PackageFormatter.php rename to tools/changelogger/class-package-formatter.php index 09149e39588..3e2e8938b89 100644 --- a/tools/changelogger/PackageFormatter.php +++ b/tools/changelogger/class-package-formatter.php @@ -1,4 +1,9 @@