File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,7 @@ public function process(File $phpCsFile, $stackPointer): void
7474 $ classNameIndex = $ i + 2 ;
7575
7676 if ($ tokens [$ classNameIndex ]['type ' ] !== 'T_DOC_COMMENT_STRING ' ) {
77- $ phpCsFile ->addError ('Missing type in param doc block ' , $ i , 'TypeMissing ' );
78-
77+ // Let DocBlockParam sniff handle this
7978 continue ;
8079 }
8180
Original file line number Diff line number Diff line change @@ -75,13 +75,22 @@ public function process(File $phpCsFile, $stackPointer): void
7575 }
7676
7777 $ content = $ tokens [$ classNameIndex ]['content ' ];
78+ if (!$ content ) {
79+ continue ;
80+ }
81+
82+ $ varIndex = strpos ($ content , '$ ' );
83+ if ($ varIndex === false ) {
84+ continue ;
85+ }
86+
87+ $ content = trim (substr ($ content , 0 , $ varIndex ));
88+ if (!$ content ) {
89+ $ phpCsFile ->addError ('Param type is empty ' , $ classNameIndex , 'EmptyType ' );
7890
79- //$appendix = '';
80- $ spaceIndex = strpos ($ content , ' ' );
81- if ($ spaceIndex ) {
82- //$appendix = substr($content, $spaceIndex);
83- $ content = substr ($ content , 0 , $ spaceIndex );
91+ continue ;
8492 }
93+
8594 if ($ content !== 'null ' ) {
8695 continue ;
8796 }
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ parameters:
55 - PhpCollectiveStrict/
66 bootstrapFiles :
77 - '%rootDir%/../../../tests/bootstrap.php'
8- checkGenericClassInNonGenericObjectType : false
98 ignoreErrors :
9+ - identifier : missingType.generics
You can’t perform that action at this time.
0 commit comments