Skip to content

Commit 157cf8b

Browse files
authored
Fix PHP 8.0+ fatal error in DocCommentSpacingSniff (#27)
The DocCommentSpacingSniff was causing a fatal error in PHP 8.0+ due to passing a string instead of an array to vsprintf(): <img width="1542" height="271" alt="Screenshot 2025-09-19 at 15 23 16" src="https://github.com/user-attachments/assets/72f69f80-9216-430e-9837-ac2c4b6950f6" />
2 parents bb7ea48 + 0eade36 commit 157cf8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

StellarWP/Sniffs/Whitespace/DocCommentSpacingSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function process( File $phpcsFile, $stackPtr ) {
5555
// Check if @since or @version is followed by more than one space
5656
if ( strlen( $whitespace ) > 1 ) {
5757
$error = 'There should be exactly one space after the `%s` tag, not multiple.';
58-
$fix = $phpcsFile->addFixableError( $error, $stackPtr, 'ExtraSpaces', $full_tag );
58+
59+
$fix = $phpcsFile->addFixableError( $error, $stackPtr, 'ExtraSpaces', [ $full_tag ] );
5960

6061
if ( $fix ) {
6162
$this->fixMultipleSpaces( $phpcsFile, $stackPtr + 1 );

0 commit comments

Comments
 (0)