Skip to content
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

refactor: Fix phpstan return.type #9375

Merged

Conversation

neznaika0
Copy link
Contributor

Description
static or self will decide what is returned.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks return covariance: https://3v4l.org/J04NA

@neznaika0
Copy link
Contributor Author

RouteCollectionInterface not have method map()
And there is no extension from RouteCollection.
Where does it break?

@samsonasik
Copy link
Member

it bc break if RouteCollection is extended by user.

@neznaika0 neznaika0 force-pushed the refactor/phpstan-return-type branch from 0bc632c to 8f6a8c0 Compare January 7, 2025 19:15
@neznaika0
Copy link
Contributor Author

An alternative way to specify the types

@paulbalandan paulbalandan added the testing Pull requests that changes tests only label Jan 8, 2025
@paulbalandan paulbalandan requested review from samsonasik and removed request for samsonasik January 8, 2025 16:05
@paulbalandan paulbalandan merged commit 72b7f8a into codeigniter4:develop Jan 8, 2025
39 checks passed
@neznaika0 neznaika0 deleted the refactor/phpstan-return-type branch January 8, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Pull requests that changes tests only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants