Skip to content

CoreExtension : Make error message more readable#4711

Merged
fabpot merged 1 commit intotwigphp:3.xfrom
tcoch:patch-1
Nov 15, 2025
Merged

CoreExtension : Make error message more readable#4711
fabpot merged 1 commit intotwigphp:3.xfrom
tcoch:patch-1

Conversation

@tcoch
Copy link
Copy Markdown
Contributor

@tcoch tcoch commented Nov 10, 2025

It's a silly little patch, but really improves the readability of the error message IMO ...

@GromNaN
Copy link
Copy Markdown
Contributor

GromNaN commented Nov 11, 2025

Well spotted!
You have to update the expected message in tests:

['{{ array_access.a }}', 'Neither the property "a" nor one of the methods "a()", "geta()"/"isa()"/"hasa()" or "__call()" exist and have public access in class "Twig\Tests\TemplateArrayAccessObject" in "%s" at line 1.'],
['{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Neither the property "missing_method" nor one of the methods "missing_method()", "getmissing_method()"/"ismissing_method()"/"hasmissing_method()" or "__call()" exist and have public access in class "Twig\Tests\TemplateArrayAccessObject" in "%s" at line 1.'],

@fabpot
Copy link
Copy Markdown
Contributor

fabpot commented Nov 15, 2025

Thank you @tcoch.

@fabpot fabpot merged commit 35a3de7 into twigphp:3.x Nov 15, 2025
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.

3 participants