Skip to content

adjust cake 6.0 upgrade to current upgrade tooling rectors#8221

Merged
LordSimal merged 5 commits into6.xfrom
6.x-upgrade-docs
Feb 22, 2026
Merged

adjust cake 6.0 upgrade to current upgrade tooling rectors#8221
LordSimal merged 5 commits into6.xfrom
6.x-upgrade-docs

Conversation

@LordSimal
Copy link
Contributor

@LordSimal LordSimal commented Feb 7, 2026

Closes #8188

@LordSimal
Copy link
Contributor Author

@ADmad this what you had in mind?

@ADmad
Copy link
Member

ADmad commented Feb 10, 2026

@ADmad this what you had in mind?

Don't like the use of named arg for the 1st argument :) Sorry for not being clear earlier, I meant to use them for 2nd/3rd args because of the swapping of the args done in 6.x.

Your changes do highlight an inconsistency though. For RouterBuilder::connect() the 1st arg is called route, while for RouterBuilder::get() (and other RESTful shortcuts) it is called template. Should sync the argument names between the methods?

RouteBuilder::connect() also accepts a Route instance as 1st argument but in this case the $defaults argument is ignored (unless I am misreading the code). I am wondering if we should add a separate method RouterBuilder::add(Route $route, array $options = []) and make the 1st arg of RouteBuilder::connect() string only. Then we can rename it to template.

@LordSimal
Copy link
Contributor Author

We are already BC breaking here for the RouteBuilder, so adjusting the arg names to make them more unified is a good idea.
@dereuromark do you want to tackle this?

@dereuromark
Copy link
Member

Is the PR what you had in mind?

@LordSimal
Copy link
Contributor Author

will clean this PR up after your PR has been merged.

@ADmad I'd say its more of a "only use named params if they are optional"

So e.g. ->get() would be

->get('/', ['controller' => 'Posts', 'action' => 'index'], name: 'postsIndex')

@LordSimal
Copy link
Contributor Author

@ADmad so is the current state of the routing docs what you had in mind?

@LordSimal
Copy link
Contributor Author

The routing docs need to be refactored anyways as cakephp/cakephp#19293 is a thing now 😁

@LordSimal LordSimal merged commit bcc089b into 6.x Feb 22, 2026
5 checks passed
@LordSimal LordSimal deleted the 6.x-upgrade-docs branch February 22, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants