Skip to content

[4.x] Treat gist IDs as strings - #86

Open
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-gist-ids
Open

Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-gist-ids

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

GitHub gist IDs are hex strings (e.g. aa5a315d61ae9438b18d), but every method in Gists and Gists\Comments built the path with '/gists/' . (int) $gistId. (int) 'aa5a315d61ae9438b18d' is 0, so delete(), edit(), fork(), get(), getCommitList(), getForkList(), getRevision(), star(), isStarred(), unstar() and comments->create()/comments->getList() could never address a real gist; they all requested /gists/0.

The ID is now used as a string and passed through rawurlencode(). The @param types say string. Numeric IDs (old gists) still work.

Testing Instructions

Tests/Package/GistsTest.php now uses hex gist IDs. Before the change 31 of its tests fail (/gists/0 instead of /gists/aa5a315d61ae9438b18d); after, all pass.

Documentation Changes Required

None. No docs page describes the gist ID handling. (The packages page in #66 lists the methods only.)

🤖 Generated with Claude Code

Gist IDs are hex strings such as aa5a315d61ae9438b18d, but every gist
method cast them to int, so delete, edit, fork, get, getCommitList,
getForkList, getRevision, star, isStarred, unstar and the gist comment
list and create calls all requested /gists/0.

Use the ID as a string and rawurlencode() it, and use realistic IDs in
the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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