processwire-requests icon indicating copy to clipboard operation
processwire-requests copied to clipboard

Add AddHookUrl() method for better readability

Open ivangretsky opened this issue 2 years ago • 3 comments

Short description of the enhancement

Add AddHookUrl() method as an alias for AddHook() for better readability

Why would the enhancement be useful to users?

Debugging URL hooks will be way easier.

ivangretsky avatar May 11 '23 12:05 ivangretsky

Why would that make debugging easier?

Personally I was totally confused reading this. I'd expected something like "addUrlHook" instead. But of course your version is in line with present naming like addHookMethod and addHookProperty. Not sure - but just wanted to mention that it was really confusing for me to see hook-url when I'm used to the term url-hook.

BernhardBaumrock avatar May 11 '23 12:05 BernhardBaumrock

Yep, the naming is to be in line with existing methods.

Why would that make debugging easier?

Easier to find only the hooks that add url handlers.

ivangretsky avatar May 12 '23 09:05 ivangretsky

You mean by searching your codebase for "addHookUrl" or what are you talking about?

BernhardBaumrock avatar May 12 '23 09:05 BernhardBaumrock