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

Remove unused variables from a few sniffs #2514

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion WordPress/Sniffs/Security/EscapeOutputSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public function getGroups() {
*/
public function process_token( $stackPtr ) {
$start = ( $stackPtr + 1 );
$end = $start;

switch ( $this->tokens[ $stackPtr ]['code'] ) {
case \T_STRING:
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Sniffs/WP/I18nSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ private function check_for_translator_comment( $stackPtr, $matched_content, $par
continue;
}

if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $param_info['clean'], $placeholders ) === 1 ) {
if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $param_info['clean'] ) === 1 ) {
$needs_translators_comment = true;
break;
}
Expand Down Expand Up @@ -969,7 +969,7 @@ private function check_for_translator_comment( $stackPtr, $matched_content, $par
* @return bool
*/
private function is_translators_comment( $content ) {
if ( preg_match( '`^(?:(?://|/\*{1,2}) )?translators:`i', $content, $matches ) === 1 ) {
if ( preg_match( '`^(?:(?://|/\*{1,2}) )?translators:`i', $content ) === 1 ) {
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function process_token( $stackPtr ) {

// Move past end comments.
if ( $this->tokens[ $trailingContent ]['line'] === $this->tokens[ $scopeCloser ]['line'] ) {
if ( preg_match( '`^//[ ]?end`i', $this->tokens[ $trailingContent ]['content'], $matches ) > 0 ) {
if ( preg_match( '`^//[ ]?end`i', $this->tokens[ $trailingContent ]['content'] ) > 0 ) {
$scopeCloser = $trailingContent;
$trailingContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $trailingContent + 1 ), null, true );
}
Expand Down
Loading