mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Prevent TNamedObject from having a leading slash
This commit is contained in:
parent
1c0bfc7e7a
commit
1cc13bdeeb
@ -1152,11 +1152,6 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
|
||||
$return_type_tokens = Type::tokenize($return_type);
|
||||
|
||||
foreach ($return_type_tokens as $i => &$return_type_token) {
|
||||
if ($return_type_token[0] === '\\') {
|
||||
$return_type_token = substr($return_type_token, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($return_type_token, ['<', '>', '|', '?', ',', '{', '}', ':'], true)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ class TNamedObject extends Atomic
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
if ($value[0] === '\\') {
|
||||
$value = substr($value, 1);
|
||||
}
|
||||
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user