Skip to content

Commit

Permalink
Merge pull request #636 from WordPress-Coding-Standards/WPCS/feature/…
Browse files Browse the repository at this point in the history
…issue-628-undefined-offset

Prevent WPCS throwing an "undefined offset" notice during live code …
  • Loading branch information
GaryJones authored Jul 26, 2016
2 parents 6759229 + 674c3e9 commit e01adcb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {

$this->init( $phpcsFile );

if ( T_WHITESPACE !== $tokens[ ( $stackPtr + 1) ]['code']
if ( isset( $tokens[ ( $stackPtr + 1 ) ] ) && T_WHITESPACE !== $tokens[ ( $stackPtr + 1 ) ]['code']
&& ! ( T_ELSE === $tokens[ $stackPtr ]['code'] && T_COLON === $tokens[ ( $stackPtr + 1 ) ]['code'] )
&& ! (
T_CLOSURE === $tokens[ $stackPtr ]['code']
Expand Down

0 comments on commit e01adcb

Please sign in to comment.