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

PHPCS 2.9.0: Update sniffs to use the new PHP_CodeSniffer_Tokens::$textStringTokens token array. #138

Merged
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
5 changes: 1 addition & 4 deletions WordPress/Sniffs/Theme/NoAutoGenerateSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ class NoAutoGenerateSniff extends Sniff {
* @return array
*/
public function register() {
$tokens = Tokens::$stringTokens;
$tokens[] = T_INLINE_HTML;
$tokens[] = T_HEREDOC;
$tokens = Tokens::$textStringTokens;
$tokens[] = T_STRING; // Functions named after or prefixed with the generator name.
$tokens[] = T_NOWDOC;
$tokens[] = T_COMMENT;
$tokens[] = T_DOC_COMMENT_STRING;
return $tokens;
Expand Down
7 changes: 1 addition & 6 deletions WordPress/Sniffs/Theme/NoFaviconSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ public function register() {

$this->favicon_regex = sprintf( self::REGEX_TEMPLATE, implode( '|', $regex_parts ) );

$tokens = Tokens::$stringTokens;
$tokens[] = T_INLINE_HTML;
$tokens[] = T_HEREDOC;
$tokens[] = T_NOWDOC;

return $tokens;
return Tokens::$textStringTokens;
}

/**
Expand Down
7 changes: 1 addition & 6 deletions WordPress/Sniffs/Theme/NoTitleTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ class NoTitleTagSniff extends Sniff {
* @return array
*/
public function register() {
$tokens = Tokens::$stringTokens;
$tokens[ T_INLINE_HTML ] = T_INLINE_HTML;
$tokens[ T_HEREDOC ] = T_HEREDOC;
$tokens[ T_NOWDOC ] = T_NOWDOC;

return $tokens;
return Tokens::$textStringTokens;
}

/**
Expand Down