Skip to content

Conversation

DanielEScherzer
Copy link
Member

Each commit can be reviewed independently, and should have no functional changes

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()`
Copy link
Member

@arnaud-lb arnaud-lb left a 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()) {
Copy link
Member

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());
Copy link
Member

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

Copy link
Member

@kocsismate kocsismate left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants