From 5983bd9fcc2f7b2716d8272edd26b3687c4aeed0 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 10 May 2019 00:29:35 +0200 Subject: [PATCH] Minor tidying up --- .../Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php | 3 ++- .../Tests/CoreFunctionality/PrefixAllGlobalsUnitTest.php | 6 +++--- .../ThemeTemplatesException/attachment.inc | 4 ++-- .../ThemeTemplatesException/footer_widgets.inc | 4 ++-- .../CoreFunctionality/ThemeTemplatesException/header.inc | 4 ++-- .../ThemeTemplatesException/partials/post-edit.inc | 1 + .../ThemeTemplatesException/social-share.inc | 4 ++-- WPThemeReview/ruleset.xml | 2 -- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php b/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php index 0bafd0ac..04a5e00a 100644 --- a/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php +++ b/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php @@ -16,7 +16,8 @@ * Verify that everything defined in the global namespace is prefixed with a theme specific prefix. * * This sniff extends the upstream WPCS PrefixAllGlobalsSniff. The differences are: - * - For non-prefixed global variables, an error will only be thrown when the variable is created outside of a theme template file. + * - For non-prefixed global variables, an error will only be thrown when the variable + * is created outside of a theme template file. * * @link https://github.com/WPTRT/WPThemeReview/issues/205 * @link https://github.com/WPTRT/WPThemeReview/issues/201 diff --git a/WPThemeReview/Tests/CoreFunctionality/PrefixAllGlobalsUnitTest.php b/WPThemeReview/Tests/CoreFunctionality/PrefixAllGlobalsUnitTest.php index 89eb222c..e7470fab 100644 --- a/WPThemeReview/Tests/CoreFunctionality/PrefixAllGlobalsUnitTest.php +++ b/WPThemeReview/Tests/CoreFunctionality/PrefixAllGlobalsUnitTest.php @@ -44,7 +44,7 @@ protected function getTestFiles( $testFileBase ) { * @param string $testFile The name of the file being tested. * @return array => */ - public function getErrorList( $testFile = 'partials/post-edit.inc' ) { + public function getErrorList( $testFile = '' ) { switch ( $testFile ) { case 'attachment.inc': // Template file - all OK, fall through to the default case. @@ -54,8 +54,8 @@ public function getErrorList( $testFile = 'partials/post-edit.inc' ) { return array( 6 => 1, ); - case 'post-edit.inc': - // Template file - all OK, fall through to the default case. + + case 'post-edit.inc': // Template file - all OK, fall through to the default case. default: return array(); } diff --git a/WPThemeReview/Tests/CoreFunctionality/ThemeTemplatesException/attachment.inc b/WPThemeReview/Tests/CoreFunctionality/ThemeTemplatesException/attachment.inc index 2ef34fc0..a1583a22 100644 --- a/WPThemeReview/Tests/CoreFunctionality/ThemeTemplatesException/attachment.inc +++ b/WPThemeReview/Tests/CoreFunctionality/ThemeTemplatesException/attachment.inc @@ -1,8 +1,8 @@ // phpcs:set WPThemeReview.CoreFunctionality.PrefixAllGlobals prefixes[] my_theme -// phpcs:set WPThemeReview.CoreFunctionality.PrefixAllGlobals allowed_folders[] template-parts,templates,partials + - @@ -159,5 +158,4 @@ -