Skip to content
Snippets Groups Projects
Unverified Commit ba6e6230 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(VariableComment): Allow intersection types in @var comment (#3392423)

parent c3f8e282
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ class VariableCommentSniff extends AbstractVariableSniff ...@@ -50,6 +50,7 @@ class VariableCommentSniff extends AbstractVariableSniff
T_NULLABLE, T_NULLABLE,
T_READONLY, T_READONLY,
T_TYPE_UNION, T_TYPE_UNION,
T_TYPE_INTERSECTION,
T_FALSE, T_FALSE,
T_NULL, T_NULL,
]; ];
......
...@@ -84,4 +84,16 @@ class Test { ...@@ -84,4 +84,16 @@ class Test {
*/ */
protected string $constant; protected string $constant;
/**
* Intersection type support, it is allowed to repeat it in the var type.
*
* @var \Drupal\user\UserStorageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected UserStorageInterface&MockObject $userStorageMock;
/**
* It is also allowed to leave the var comment out since there is a type.
*/
protected UserStorageInterface&MockObject $userStorageMock2;
} }
...@@ -88,4 +88,16 @@ class Test { ...@@ -88,4 +88,16 @@ class Test {
*/ */
protected string $constant; protected string $constant;
/**
* Intersection type support, it is allowed to repeat it in the var type.
*
* @var \Drupal\user\UserStorageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected UserStorageInterface&MockObject $userStorageMock;
/**
* It is also allowed to leave the var comment out since there is a type.
*/
protected UserStorageInterface&MockObject $userStorageMock2;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment