Repository navigation
Conversation
The function was registered with needs_environment, so Twig passed the Environment as the first argument to Runtime::displayWithVat(), which declares no parameters. It only worked because PHP silently ignores surplus arguments to userland functions. is_safe was equally wrong: the function returns a bool, so there is no markup to mark as safe. Both options remain on sstv_vat_toggler, where they are correct. Claude-Session: https://claude.ai/code/session_01P9NzuVPQGvaVR97HZFq98a
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sstv_display_with_vatwas registered with two options that do not apply to it:needs_environment => true— Twig therefore compiles the call as->displayWithVat($this->env), butRuntime::displayWithVat()declares no parameters. This only works because PHP silently ignores surplus arguments to userland functions; the moment the signature gains a parameter it starts receiving theEnvironmentinstead of what the caller meant.is_safe => ['html']— the function returns abool. There is no markup to mark as safe, so the option is inert.Both options are correct on
sstv_vat_toggler(it does take theEnvironment, and it does return rendered HTML) and are left alone there.No behaviour change — the existing Twig integration fixture still passes.
Addresses a nitpick from #5.
https://claude.ai/code/session_01P9NzuVPQGvaVR97HZFq98a