-
Notifications
You must be signed in to change notification settings - Fork 8k
gen_stub: various simplifications and clean up (6) #19699
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
base: master
Are you sure you want to change the base?
Conversation
Reduce the number of global functions by moving it to instance method `FileInfo::generateArgInfoCode()`. In the process, make the following parts of `FileInfo` private: - `$funcInfos` - `$generateFunctionEntries` - `$declarationPrefix` - `$generateClassEntries` - `::getMinimumPhpVersionIdCompatibility()`
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.
Looks good to me otherwise
$this->attributes = $attributes; | ||
$this->framelessFunctionInfos = $framelessFunctionInfos; | ||
$this->exposedDocComment = $exposedDocComment; | ||
if ($return->tentativeReturnType && $this->isFinalMethod()) { |
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.
I like the intent, but IMHO the method has the advantage of putting a name on the expression ($this->flags & Modifiers::FINAL) || ($this->classFlags & Modifiers::FINAL)
.
} | ||
|
||
return true; | ||
return !array_any($this->types, static fn (SimpleType $type) => !$type->isScalar()); |
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.
nit: just for the sake of completeness, it would be nice to add return type for the callables
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.
LGTM except for my nit and Arnaud's comment
Each commit can be reviewed independently, and should have no functional changes