Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various minor doc fixes #324

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ final class DuplicateArrayKeySniff extends AbstractArrayDeclarationSniff
/**
* Process every part of the array declaration.
*
* This contains the default logic for the sniff, but can be overloaded in a concrete child class
* if needed.
*
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function process(File $phpcsFile, $stackPtr)
$current = $tokens[$stackPtr]['scope_opener'];
$end = $tokens[$stackPtr]['scope_closer'];

// Not searching for arrow functions as those have an implicit return, so no
// Not searching for arrow functions as those have an implicit return, so won't use the `return` keyword.
$search = Collections::functionDeclarationTokens();
$search[\T_RETURN] = \T_RETURN;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function process(File $phpcsFile, $stackPtr)
if ($tokens[$nextAfter]['code'] === \T_SEMICOLON) {
$innerScopeCloser = $nextAfter;
} else {
// Missing semi-colon. Report, but don't auto-fix.
// Missing semicolon. Report, but don't auto-fix.
$autoFixable = false;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function process(File $phpcsFile, $stackPtr)
return;
}

// Semi-colon, so check for any code between it and the close tag.
// Semicolon, so check for any code between it and the close tag.
$nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($endOfStatement + 1), null, true);
if ($nextNonEmpty === false
|| $tokens[$nextNonEmpty]['code'] === \T_CLOSE_TAG
Expand Down
2 changes: 0 additions & 2 deletions Universal/Tests/UseStatements/KeywordSpacingUnitTest.2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* For PHP < 8.0, it will correctly flag this as "no space" after the `use` keyword.
* For PHP 8.0+, this will no longer be flagged as keywords are allowed in namespaced names,
* so the `use` is tokenized as `T_STRING` instead of `T_USE` and won't be flagged.
*
* For this reason, there is no "fixed" file included as the test would not be able to pass on PHP 8.0+.
*/
use\Util\MyOtherClass;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* For PHP < 8.0, it will correctly flag this as "no space" after the `use` keyword.
* For PHP 8.0+, this will no longer be flagged as keywords are allowed in namespaced names,
* so the `use` is tokenized as `T_STRING` instead of `T_USE` and won't be flagged.
*
* For this reason, there is no "fixed" file included as the test would not be able to pass on PHP 8.0+.
*/
use \Util\MyOtherClass;
2 changes: 1 addition & 1 deletion Universal/Tests/UseStatements/KeywordSpacingUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getErrorList($testFile = '')

case 'KeywordSpacingUnitTest.2.inc':
return [
11 => 1,
9 => 1,
];

default:
Expand Down