From 810e5eb5d35cdb6c5b1cf076a833ed8920e887ec Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 4 Nov 2024 22:37:55 +0100 Subject: [PATCH 1/2] CS/QA: minor cleanup Remove a few unused variables. --- tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php | 2 -- .../Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php | 1 - 2 files changed, 3 deletions(-) diff --git a/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php b/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php index e595f2927d..f4ef2f2062 100644 --- a/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php +++ b/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php @@ -405,8 +405,6 @@ public function testNamespaceOperatorInTypes() */ public function testKeywordReturnTypes($testMarker) { - $tokens = $this->phpcsFile->getTokens(); - $token = $this->getTargetToken($testMarker, T_FN); $this->backfillHelper($token); $this->scopePositionTestHelper($token, 11, 14); diff --git a/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php b/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php index 9fee3c5f59..91d10ac3fc 100644 --- a/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php +++ b/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php @@ -218,7 +218,6 @@ public function testDNFTypeParentheses($testMarker) $this->assertArrayHasKey('parenthesis_closer', $closer, 'Parenthesis closer is not set'); $this->assertSame($closePtr, $closer['parenthesis_closer'], 'Parenthesis closer is not the expected token'); - $intersectionCount = 0; for ($i = ($openPtr + 1); $i < $closePtr; $i++) { $this->assertArrayHasKey('nested_parenthesis', $tokens[$i], "Nested parenthesis key not set on token $i ({$tokens[$i]['type']})"); $this->assertArrayHasKey($openPtr, $tokens[$i]['nested_parenthesis'], 'Nested parenthesis is missing target parentheses set'); From fcf7fdd578263a1d4f3c9d4d3501ecf661695c7f Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 18 Oct 2024 02:21:51 +0200 Subject: [PATCH 2/2] Docs: minor fixes Minor fixes picked up along the way. --- src/Reports/Code.php | 2 +- .../Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Reports/Code.php b/src/Reports/Code.php index 6cbd7eb1e7..c97e1681b7 100644 --- a/src/Reports/Code.php +++ b/src/Reports/Code.php @@ -40,7 +40,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, return false; } - // How many lines to show about and below the error line. + // How many lines to show above and below the error line. $surroundingLines = 2; $file = $report['filename']; diff --git a/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php index 2423e3d181..3e3006f88a 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php @@ -12,7 +12,7 @@ use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; /** - * Unit test class for the LanguageConstructSpacing sniff. + * Unit test class for the HereNowdocIdentifierSpacing sniff. * * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\HereNowdocIdentifierSpacingSniff */