Skip to content
Snippets Groups Projects
Unverified Commit 35a81fff authored by Mitch Portier's avatar Mitch Portier Committed by GitHub
Browse files

fix(VariableComment): Add support for union types (#3249360 by Arkener)

parent 54e8b472
Branches
Tags
No related merge requests found
......@@ -48,6 +48,9 @@ class VariableCommentSniff extends AbstractVariableSniff
T_STRING,
T_NS_SEPARATOR,
T_NULLABLE,
T_TYPE_UNION,
T_FALSE,
T_NULL,
];
$commentEnd = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true);
......
......@@ -16,7 +16,7 @@
"require": {
"php": ">=7.0.8",
"ext-mbstring": "*",
"squizlabs/php_codesniffer": "^3.5.6",
"squizlabs/php_codesniffer": "^3.6.0",
"symfony/yaml": ">=2.0.5",
"sirbrillig/phpcs-variable-analysis": "^2.10"
},
......
......@@ -51,4 +51,11 @@ class Test {
*/
public ?Bar $bar;
/**
* Property fooBar.
*
* @var Foo|Bar|false|null
*/
public Foo|Bar|FALSE|NULL $fooBar;
}
......@@ -55,4 +55,11 @@ class Test {
*/
public ?Bar $bar;
/**
* Property fooBar.
*
* @var Foo|Bar|false|null
*/
public Foo|Bar|FALSE|NULL $fooBar;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment