Skip to content

Add Easy Rule Name URLs#3660

Open
JHWelch wants to merge 10 commits intorectorphp:mainfrom
JHWelch:easy-rule-urls
Open

Add Easy Rule Name URLs#3660
JHWelch wants to merge 10 commits intorectorphp:mainfrom
JHWelch:easy-rule-urls

Conversation

@JHWelch
Copy link
Copy Markdown
Contributor

@JHWelch JHWelch commented Apr 8, 2026

This PR does two related things.

First it allows you to use the PascalCase class name of a rule to find it via the URL. To maintain one consistent canonical URL, this will still redirect to the slug that it is currently. So:
/rule-detail/ArrayToFirstClassCallableRector will 301 redirect to
/rule-detail/array-to-first-class-callable-rector

The second thing this adds is an extra convenient way to find rules, which is resolving them via slug or class name at the root of the URL.

This process also redirects to the /rule-detail/kebab-slug for a canonical URL, but allows for quickly finding a rector rule from name.

So this same rule would be accessible at
https://getrector.com/ArrayToFirstClassCallableRector
and it would redirect to
/rule-detail/array-to-first-class-callable-rector

If you would like either part of this separately without the other I can split this apart, just let me know.

Thanks!

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.

1 participant