We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9256901 commit 26c0368Copy full SHA for 26c0368
Backdrop/Sniffs/Commenting/InlineCommentSniff.php
@@ -179,6 +179,14 @@ public function process(File $phpcsFile, $stackPtr)
179
}
180
181
182
+ if ($tokens[$stackPtr]['type'] === 'T_COMMENT' && strpos($tokens[$stackPtr]['content'], '@var') !== FALSE) {
183
+ // Enforce inline type hints to the syntax most widely supported by IDEs and tools.
184
+ if (strpos($tokens[$stackPtr]['content'], '/**') !== 0) {
185
+ $error = 'Inline type hint comments must be in the form "/** @var ... */".';
186
+ $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint');
187
+ }
188
189
+
190
// Only want inline comments.
191
if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') {
192
return;
0 commit comments