Skip to content

DOC-7267 Tidy the Predis param names and types - #4511

Merged
andy-stark-redis merged 2 commits into
mainfrom
DOC-7267-php-types
Nov 9, 2026
Merged

andy-stark-redis merged 2 commits into
mainfrom
DOC-7267-php-types

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A follow-up to #4510. I compared every php entry against the Predis 3.7.1 @method declarations and fixed the three differences that are mechanical. 77 command files change, only param name and type fields, plus the merged data file.

  • Variadic names: 52 params whose signature has ...$name stored the name without the dots ($keys for string ...$keys), while INFO and PFCOUNT use ...$keys. They now carry the dots.
  • Doubled ellipsis: 32 of those also ended the type with an ellipsis (string ...), which would show it twice, so the type is the bare string.
  • Untyped params: 47 params typed Any, all untyped in the signature, are now mixed, like the other untyped ones.

Review notes

  • Merge order: this branch is based on DOC-7267 Give the Predis params a name and a type #4510 and its diff against main includes that PR's changes until DOC-7267 Give the Predis params a name and a type #4510 merges. Please merge DOC-7267 Give the Predis params a name and a type #4510 first.
  • Signatures, descriptions and returns are unchanged, which the script asserts. After the change, the param names of all 347 entries whose signature equals its @method line are identical to the declaration, and no php param has type Any. No other client's key changes, and the merged file equals a regeneration.
  • Built with content/develop/clients ignored (the full site only builds in CI). TOUCH renders as touch($keyOrKeys: string[]|string, ...$keys: string), SUBSCRIBE as subscribe(...$channels: string), and GEORADIUS shows mixed for its untyped params.
  • Left on purpose: 31 params say string where Predis leaves the param untyped (for example $subcommand on COMMAND, SCRIPT and CONFIG). That's more specific than the declaration, so I treated it as information.
  • Not unified: 14 module-command variadics (CMS, TOPK, TDIGEST and similar) keep a plain name with a type ending in an ellipsis. That's a different convention, and I didn't change it.

🤖 Generated with Claude Code


Note

Low Risk
Documentation/data-only edits to PHP mapping metadata; no application or client library code changes.

Overview
Aligns Predis (php) parameter metadata in data/command-api-mapping/ (and the merged command-api-mapping.json) with Predis 3.7.1 @method declarations. Only name and type fields change across ~77 command files; signatures, returns, and other clients are untouched.

Variadic parameters now use names like ...$username / ...$keys instead of plain $username / $keys, matching how signatures and other commands (e.g. INFO) already document variadics. Where types had a trailing ellipsis (string ..., ...), they are normalized to a single base type (string, or empty string for fully untyped variadic args).

Optional/untyped parameters shed embedded defaults from the name field (e.g. ?array $options = null → name $options, type ?array), and the former catch-all Any type is replaced with mixed (or more specific types where the signature implies them, such as int, bool, ?string).

This is a follow-up to prior Predis mapping work (#4510); it improves how generated docs render PHP call signatures and does not change runtime client behavior.

Reviewed by Cursor Bugbot for commit 446be04. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7267

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 7 related items from repository history (2 new this commit):

Memory updated at 446be04

@andy-stark-redis
andy-stark-redis requested a review from a team November 9, 2026 10:14
@andy-stark-redis andy-stark-redis self-assigned this Nov 9, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Nov 9, 2026
andy-stark-redis and others added 2 commits November 9, 2026 14:46
165 php params in 90 command files stored their whole declaration in the name field, for
example "?array $options = null" or "string $index = 'byte'", with the type Any. They now follow
the form the other php params use: the name is the variable ($options, or ...$keys for a
variadic) and the type is the declared PHP type. The 11 untyped parameters, such as
$start = null on BITCOUNT, get mixed like the existing untyped ones, and defaults stay in the
signature text only. Signatures, descriptions and returns are untouched. The JSON.SET $subcommand param, the 166th, is fixed by the Predis fpha change (#4509), which edits the same entry.

Each of the 165 text values appeared verbatim in its own entry's signature, and the result was
checked against the @method declarations in Predis 3.7.1 ClientInterface: 161 params equal the
declared name and type at the same position, and the other 4 belong to methods with no @method
line, so they follow the entry's own signature.

Learned: a php param whose name contains a space or an equals sign is a declaration the extractor failed to split, split it into name and type rather than leaving it in the name field
Constraint: a variadic php param keeps the leading ... on its name and the bare type, as INFO and PFCOUNT already do
Gaps: 98 php entries still differ from their @method line in param types, mostly Any or string where the declaration says mixed, these were not in scope
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A follow-up to the php param cleanup. Three differences between php params and their own
signatures, found by comparing every php entry against the Predis 3.7.1 @method declarations.
77 command files change, only param name and type fields.

Variadic params: 52 params whose signature has ...$name stored the name without the dots, such
as $keys for string ...$keys, while INFO and PFCOUNT use ...$keys. They now carry the dots. 32 of
them also ended the type with an ellipsis ("string ..."), which would show the ellipsis twice,
so the type is the bare string. Untyped params: 47 params typed Any, all untyped in the
signature, are mixed like the other untyped ones. Signatures, descriptions and returns are
unchanged.

After the change the param names of all 347 entries whose signature equals its @method line are
identical to the declaration, and no php param has type Any.

Learned: a php variadic keeps the dots on its name and the bare type, a module command keeps a plain name and a type ending in an ellipsis, these are two conventions in one file set
Constraint: only touch a php param type when it is Any or repeats the ellipsis, a concrete type that is more specific than the declaration (string where Predis leaves $subcommand untyped) is information
Gaps: 31 params still say string where the declaration is untyped, kept on purpose
Gaps: 14 module-command variadics (CMS, TOPK, TDIGEST and similar) keep the plain name with a type ending in an ellipsis, a different convention that was not unified
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@andy-stark-redis
andy-stark-redis merged commit 3bcd09a into main Nov 9, 2026
108 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7267-php-types branch November 9, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants