Skip to content

fix: Leave pagination params out of the at least one parameter guard - #474

Merged
razor-x merged 1 commit into
betafrom
claude/php-audit-uoa7nb-m7-param-guard-scope
Aug 19, 2026
Merged

fix: Leave pagination params out of the at least one parameter guard#474
razor-x merged 1 commit into
betafrom
claude/php-audit-uoa7nb-m7-param-guard-scope

Conversation

@razor-x

@razor-x razor-x commented Aug 18, 2026

Copy link
Copy Markdown
Member

Rebased onto beta (4.0.0-beta.17).

The generated "at least one parameter is required" guard iterated every parameter, so limit and page_cursor counted as filters. Effects:

  • access_codes->list(limit: 20) passed the guard while naming no filter at all.
  • A paginator satisfied the guard from page 2 onward purely because page_cursor was set, so the first page threw and later pages did not.
  • events->list(limit: 20) passed the guard even though that endpoint is not paginated.

The guard now iterates filter parameters only, and is dropped entirely for an endpoint where that leaves nothing to check.

Generated output changed in three places: limit/page_cursor removed from the /access_codes/list and /access_methods/list guards, limit removed from the /events/list guard.

tests/RequiredParametersTest.php is new — these guards had no tests. Reverting src/Routes to beta fails the four pagination-only cases.

vendor/bin/phpunit (259 tests), vendor/bin/psalm, and npm run lint are green.

The generated guard counted limit and page_cursor as parameters, so
access_codes->list(limit: 20) satisfied it while naming no filter, and a
paginator satisfied it from page 2 onward purely because page_cursor was
set.
@razor-x
razor-x force-pushed the claude/php-audit-uoa7nb-m7-param-guard-scope branch from 12bdce1 to 77e9395 Compare August 19, 2026 22:40
@razor-x
razor-x merged commit fe40180 into beta Aug 19, 2026
15 checks passed
@razor-x
razor-x deleted the claude/php-audit-uoa7nb-m7-param-guard-scope branch August 19, 2026 22:54
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.

2 participants