Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squiz/VariableComment: allow union types to be detected #3757

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
T_STRING => T_STRING,
T_NS_SEPARATOR => T_NS_SEPARATOR,
T_NULLABLE => T_NULLABLE,
T_TYPE_UNION => T_TYPE_UNION,
];

for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,11 @@ class ReadOnlyProps

private readonly string $variable;
}

class UnionTypes
{
/**
* @var array|boolean
*/
private array|bool $variableName = array();
}
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,11 @@ class ReadOnlyProps

private readonly string $variable;
}

class UnionTypes
{
/**
* @var array|boolean
*/
private array|bool $variableName = array();
}