Skip to content

ext/sodium: Fix parameter name in the length-mismatch errors - #23396

Open
lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/sodium-add-param-name
Open

ext/sodium: Fix parameter name in the length-mismatch errors#23396
lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/sodium-add-param-name

Conversation

@lacatoire

Copy link
Copy Markdown
Member

The length-mismatch errors of sodium_add(), sodium_memcmp() and sodium_compare() refer to $string_2, which does not exist. All three functions declare $string2.

The Argument #1 ($string1) part is generated from the arginfo and was already correct; only the hardcoded cross-reference to the second argument was stale.

The added test triggers the mismatch on all three functions and lists sodium_add()'s parameter names through Reflection, so a later rename that forgets these messages fails the test.

sodium_add(), sodium_memcmp() and sodium_compare() all cross-reference
their second argument as $string_2, a name none of them declares; the
stub calls it $string2.
Comment thread ext/sodium/tests/sodium_length_mismatch_error.phpt Outdated
Co-authored-by: NickSdot <32384907+NickSdot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants