-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: ClassAttributesSeparationFixer
- improve code
#8950
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
chore: ClassAttributesSeparationFixer
- improve code
#8950
Conversation
@@ -46,7 +46,7 @@ | |||
* close: int, | |||
* elements: non-empty-list<_Element> | |||
* } | |||
* @phpstan-type _Element array{token: Token, type: string, index: int, start?: int, end?: int} | |||
* @phpstan-type _Element array{token: Token, type: string, index: int, start: int, end: int} |
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.
all elements have start
and end
, when fully created
$element['start'] = $this->getFirstTokenIndexOfClassElement($tokens, $class, $element); | ||
$element['end'] = $this->getLastTokenIndexOfClassElement($tokens, $class, $element, $tokensAnalyzer); | ||
$element['start'] = $this->getFirstTokenIndexOfClassElement($tokens, $class['open'], $index); | ||
$element['end'] = $this->getLastTokenIndexOfClassElement($tokens, $class['index'], $index, $element['type'], $tokensAnalyzer); |
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.
at this place start
and end
are added. so the passed $element
isn't fully created yet. That's why I pass now only the element values really needed inside these methods (so I do not have to define a partial _Element shape).
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.
same for $class
nice |
It resolves 21 phpstan errors.