Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update the schema stub to use iterable for the fields and filters#308

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
shanginn wants to merge2 commits intolaravel-json-api:develop
base:develop
Choose a base branch
Loading
fromshanginn:develop

Conversation

@shanginn
Copy link

In thecore/src/Core/Schema/Schema.php bothfields andfilters returns iterable, but stubs still generate them as arrays:

abstract public function fields(): iterable;

public function filters(): iterable

…rs methods, enhancing type consistency and clarity. Additionally, include the Filter contract for improved functionality.
@lindyhopchris
Copy link
Contributor

Thanks for the PR. I'm not sure it needs to beiterable as the generated schema is returning an array, andarray is allowed as the return type as it is a covariant.

Do you have a specific reason for changing this? I.e. are you not returningarray from those methods?

@shanginn
Copy link
Author

yeah, you are right, array is a covariant of iterable. all I want to do is make PHPStan happy with the default generated schemas.
how about this then? Just add iterable type to the phpdoc?

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@shanginn@lindyhopchris

[8]ページ先頭

©2009-2025 Movatter.jp