Problem/Motivation
Coder 8.3.21
False positive Drupal.Commenting.VariableComment.Missing: Missing member variable doc comment when when declaring typehints with intersecting parameters.
Steps to reproduce
/**
* Mock of the user storage.
*
* @var \Drupal\user\UserStorageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected UserStorageInterface&MockObject $userStorageMock;
Proposed resolution
TBD
Remaining tasks
Patch
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #3
klausiPushed a fix, thanks a lot for reporting!
Tip of the day: if you define an explicit type, then you don't need to repeat it in @var comments.
Comment #4
solideogloria commentedThanks for the info! I began writing my project back when the @var comments were necessary to pass code review, even when an explicit type was declared, but it's helpful to know that only one is needed now. I tested it, and it passes code review as you said.