-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
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
-
Entity::set(array|string $field, mixed $value = null, array $options = []) -
ConsoleInputArgument::__construct(array|string $name, string $help = '', bool $required = false, array $choices = [], ?string $default = null, ?string $separator = null)Remove argument overloading #18868 -
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) -
public function on(EventListenerInterface|string $eventKey, callable|array $options = [], ?callable $callable = null)
CakePHP Version
6.0
LordSimal, dereuromark and josbeir