Skip to content

Feat: Support aliases for params#10

Merged
ChiragAgg5k merged 2 commits into
mainfrom
feat-param-aliases
May 5, 2026
Merged

Feat: Support aliases for params#10
ChiragAgg5k merged 2 commits into
mainfrom
feat-param-aliases

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

@Meldiron Meldiron commented May 4, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR adds alias support to Hook::param(), allowing a parameter to be matched under one or more alternative names when the canonical key is absent from both $requestParams and $values. The implementation in Base::prepare() correctly prioritises the canonical key and falls back to the first matching alias for both lookup sources.

Confidence Score: 5/5

Safe to merge — the alias resolution logic is correct and backward-compatible.

No P0 or P1 issues found. The alias resolution correctly handles canonical-key precedence, empty alias lists, and lookup in both $requestParams and $values. The previously flagged test-coverage gap is a P2 concern that does not affect correctness.

No files require special attention.

Important Files Changed

Filename Overview
src/Servers/Hook.php Adds optional aliases parameter (default []) to param() method and stores it in the params array — clean, backward-compatible addition.
src/Servers/Base.php Implements alias resolution for both $requestParams and $values in prepare(); canonical key takes precedence when present, first matching alias used otherwise. Logic is correct.
tests/Servers/Unit/HookTest.php Adds two unit tests verifying alias storage in Hook::param(); integration tests for actual resolution in Base::prepare() are absent (previously flagged).

Reviews (2): Last reviewed commit: "fix url params" | Re-trigger Greptile

Comment thread src/Servers/Base.php Outdated
Comment thread tests/Servers/Unit/HookTest.php
@ChiragAgg5k ChiragAgg5k merged commit 7db346e into main May 5, 2026
6 checks passed
@ChiragAgg5k ChiragAgg5k deleted the feat-param-aliases branch May 5, 2026 04:08
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.

3 participants