-
Notifications
You must be signed in to change notification settings - Fork 64
Support unsealed array shapes #169
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
Conversation
ecf47c7
to
6254ad1
Compare
Thank you. This is useful so that unsealed array shapes in |
/** @var bool */ | ||
public $sealed; | ||
|
||
public function __construct(array $items, bool $sealed = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrmajor this cause error on Rector side, that's sealed true make all changes to add ...
which actually not, see
https://github.com/rectorphp/rector-src/actions/runs/3706328433/jobs/6281403238
we forced pin to use 1.5.0 and the issue disappear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that's actually a bug in __toString()
. I'll provide a fix later today.
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); | ||
$items = [$this->parseArrayShapeItem($tokens)]; | ||
$items = []; | ||
$sealed = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrmajor this cause error on Rector side, if this goes to false
for default value, it may reduce the possible error.
that's sealed true make all changes to add ...
which actually not, see
https://github.com/rectorphp/rector-src/actions/runs/3706328433/jobs/6281403238
we forced pin to use 1.5.0 and the issue disappear
This PR adds support for
array{foo: int, ...}
syntax (phpstan/phpstan#8438).