Skip to content

Commit fa2b44e

Browse files
authored
Merge pull request #2562 from WordPress/feature/validposttypeslug-clean-up
NamingConventions/ValidPostTypeSlug: check token via code, not type
2 parents 2bb6fc5 + 793ff43 commit fa2b44e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ public function process_parameters( $stackPtr, $group_name, $matched_content, $p
172172
);
173173

174174
// Warn for dynamic parts in the slug parameter.
175-
if ( 'T_DOUBLE_QUOTED_STRING' === $this->tokens[ $string_pos ]['type']
176-
|| ( 'T_HEREDOC' === $this->tokens[ $string_pos ]['type']
175+
if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $string_pos ]['code']
176+
|| ( \T_HEREDOC === $this->tokens[ $string_pos ]['code']
177177
&& strpos( $this->tokens[ $string_pos ]['content'], '$' ) !== false )
178178
) {
179179
$this->phpcsFile->addWarning(

0 commit comments

Comments
 (0)