Skip to content

Commit

Permalink
Update sniffs to use the new `PHP_CodeSniffer_Tokens::$textStringToke…
Browse files Browse the repository at this point in the history
…ns` token array.
  • Loading branch information
jrfnl committed May 27, 2018
1 parent 501380b commit 4839763
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
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

0 comments on commit 4839763

Please sign in to comment.