Skip to content

Document and test sandbox __call support#4858

Merged
fabpot merged 2 commits into
twigphp:3.xfrom
fabpot:sandbox-call-tests
Jul 12, 2026
Merged

Document and test sandbox __call support#4858
fabpot merged 2 commits into
twigphp:3.xfrom
fabpot:sandbox-call-tests

Conversation

@fabpot

@fabpot fabpot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Related to #1950

@upsun-dispatch

upsun-dispatch Bot commented Jul 12, 2026

Copy link
Copy Markdown

📋 PR Summary

This PR documents how the Twig sandbox handles attribute access that resolves through PHP's magic __call() method and adds tests covering the allowed, unallowed, method-syntax, and __call-literal cases. It touches only documentation (doc/sandbox.rst) and tests (tests/Extension/SandboxTest.php), with no production code changes.

Changes
Layer / File(s) Summary
documentation
doc/sandbox.rst Adds a note explaining that the sandbox checks the virtual method name written in the template (not __call) when an attribute resolves through __call(), and that allow-listing __call itself has no effect.
tests
tests/Extension/SandboxTest.php Adds five tests and a MagicCallObject fixture covering sandbox behavior for __call()-routed virtual methods: allowed, unallowed (property and method syntax), the __call literal not granting access, and the property→__call fallback.

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: full · 2 files reviewed · no issues found

Review details

Commit: Commit 7c50819
Model: claude-opus-4-8
Panel: none

@fabpot fabpot force-pushed the sandbox-call-tests branch from 7c50819 to b38efa1 Compare July 12, 2026 13:10

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: full · 2 files reviewed · no issues found

Review details

Commit: Commit b38efa1
Model: claude-opus-4-8
Panel: none

@fabpot fabpot force-pushed the sandbox-call-tests branch from b38efa1 to b2471fd Compare July 12, 2026 13:18

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: full · 2 files reviewed · no issues found

Review details

Commit: Commit b2471fd
Model: claude-opus-4-8
Panel: none

@fabpot fabpot force-pushed the sandbox-call-tests branch from b2471fd to 764ce45 Compare July 12, 2026 13:28

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: full · 2 files reviewed · no issues found

Review details

Commit: Commit 764ce45
Model: claude-opus-4-8
Panel: none

@fabpot fabpot force-pushed the sandbox-call-tests branch from 764ce45 to 65b93f2 Compare July 12, 2026 13:40

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: full · 2 files reviewed · no issues found

Review details

Commit: Commit 65b93f2
Model: claude-opus-4-8
Panel: none

@fabpot fabpot force-pushed the sandbox-call-tests branch from 65b93f2 to 29b66fd Compare July 12, 2026 13:45

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Upsun Dispatch Review: incremental · 2 files reviewed · no new issues

Review details

Commit: Commits 65b93f2..29b66fd
Model: claude-opus-4-8
Panel: none

@fabpot fabpot merged commit bfbd962 into twigphp:3.x Jul 12, 2026
54 checks passed
@fabpot fabpot deleted the sandbox-call-tests branch July 12, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant