Skip to content

Naming collision risk: HTTP OPTIONS attribute and route "options" #19450

@jamisonbryant

Description

@jamisonbryant

Description

Our app uses attribute-based routing, which predates the Cake 6.x feature added in #19293, and we needed to attach some metadata to a route. We originally tried putting it in route defaults, but that broke reverse routing, so we switched to route options.

That's when we noticed that our built-in #[Options(...)] attribute (intended for HTTP OPTIONS) would collide with Cake's definition of route options. Since we weren't using HTTP OPTIONS anywhere, we decided to repurpose the attribute to mean route options instead. I wanted to flag this in core as a potential issue ahead of 6.x.

CakePHP Version

5.3

PHP Version

8.5

Metadata

Metadata

Assignees

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions