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

6.0 - RFC - Remove argument overloading #18002

Open
4 tasks
ADmad opened this issue Oct 30, 2024 · 0 comments
Open
4 tasks

6.0 - RFC - Remove argument overloading #18002

ADmad opened this issue Oct 30, 2024 · 0 comments
Milestone

Comments

@ADmad
Copy link
Member

ADmad commented Oct 30, 2024

Description

We have various methods where argument overloading is used for ease of use. For e.g. for RouteBuilder::scope() if the 2nd argument is a callback it's used as the 3rd argument.

The availability of named arguments and autocompleting features of today's IDEs negate the need of such loading. Removing the overloading would make the API cleaner.

Functions list

  • RouteBuilder::scope(string $path, Closure|array $params, ?Closure $callback = null)
  • RouteBuilder::resources(string $name, Closure|array $options = [], ?Closure $callback = null)
  • RouteBuilder::prefix(string $name, Closure|array $params = [], ?Closure $callback = null)
  • RouteBuilder::plugin(string $name, Closure|array $params = [], ?Closure $callback = null)

CakePHP Version

6.0

@ADmad ADmad added this to the 6.0 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant