This PR was merged into the 2.x branch.
Discussion
----------
Allow inherited magic method to still run with calling class
This is #3719 ported to 2.x and improved a bit.
I also reported https://github.com/php/php-src/issues/8932 because the underlying behavior of PHP is broken to me.
If a static method cannot be resolved to the calling class, but the calling class has, or inherits, a `__callStatic` handler, this allows the `__callStatic` handler to be used with the calling class, and not the inherited class as would occur with reflection. This allows systems such as Laravel facades to still work.
Fixes https://github.com/twigphp/Twig/issues/3716
Commits
-------
d1457a40 Allow inherited magic method to still run with calling class
If a static method cannot be resolved to the calling class, but the calling class has, or inherits, a `__callStatic` handler, this allows the `__callStatic` handler to be used with the calling class, and not the inherited class as would occur with reflection. This allows systems such as Laravel facades to still work.
Fixes https://github.com/twigphp/Twig/issues/3716
This PR was merged into the 2.x branch.
Discussion
----------
Bugfix typo in twig/intl-exta
Bugfix typo in text attribute name see https://github.com/twigphp/Twig/issues/3710
Commits
-------
fd2f6d42 Bugfix typo in twig/intl-exta
This PR was submitted for the 3.x branch but it was squashed and merged into the 2.x branch instead.
Discussion
----------
Fixes `CallExpression::reflectCallable()` throwing `TypeError`
See #3708
Commits
-------
e333ccc9 Fixes `CallExpression::reflectCallable()` throwing `TypeError`
This PR was merged into the 2.x branch.
Discussion
----------
Fix optimizing non-public named closures
Fix#3703
Commits
-------
dd34e9f5 Fix optimizing non-public named closures
This PR was merged into the 2.x branch.
Discussion
----------
[Documentation] Add note about simple string matching
During the Symfony Live we mentionned the need to update the documentation around string matching to mention that an approach was possible with the ``ìn`` operator was simpler.
As the documentation part about ``in`` was just below, I wasn't sure that an anchor link was relevant, nor a code example.
Happy to make this first tiny contribution, and available if there are more stuff to do for this PR :).
Commits
-------
5e26ce73 [Documentation] Add note about simple string matching
This PR was merged into the 2.x branch.
Discussion
----------
Enable cache invalidation when auto_reload=true
Related to https://github.com/symfony/symfony-docs/pull/16671
Enabling `auto_reload` is not effective when `opcache.validate_timestamps=0`.
Commits
-------
ef8ae9cb Enable bytecode invalidation with auto_reload
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Fix docs about the deprecated tag
Closes#3594
Commits
-------
17142af9 Fix docs about the deprecated tag
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
New info: Documents / filters / format_datetime: added info and examp…
…le of using argument `timezone`
issues 3477:
https://github.com/twigphp/Twig/issues/3477
Commits
-------
16d06cc4 New info: Documents / filters / format_datetime: added info and example of using argument `timezone`
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Added token type and value to error message
Added the given token type and value to the error message in case that the token after '.' is neither a name nor a number.
I think it helps a lot to have more expressive verbose error messages (specially in this case with the dot `.` operator, since it's the concatenation operator in PHP and developers may mistakenly use it instead of tilde `~` operator which is the concatenation operator in Twig.
I also think that it's better to extract the error message generating script out of `TokenStream::expect` (the code I included at the end of this message) and make it a new method with more general flexibility to be able to use the same method with all these scenarios but I'm not sure if this level of abstraction meets the Twig source policy so I didn't try to do that.
```
sprintf('%sUnexpected token "%s"%s ("%s" expected%s).',
$message ? $message.'. ' : '',
Token::typeToEnglish($token->getType()),
$token->getValue() ? sprintf(' of value "%s"', $token->getValue()) : '',
Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : '')
```
Commits
-------
6c8da65b Added token type and value to error message
This PR was merged into the 2.x branch.
Discussion
----------
Fix custom escapers when using multiple Twig environments
Closes#3668
Commits
-------
9c03ef0d Fix custom escapers when using multiple Twig environments
This PR was merged into the 2.x branch.
Discussion
----------
Rename variable in SecurityPolicyInterface.php
Hi @fabpot
When using psalm, an error is reported when the name of the variable is not the same than the one in the interface.
This also could give issues with named params.
The securityPolicy implementation is using `property` as the name of the variable, which make a lot more sens https://github.com/twigphp/Twig/blob/3.x/src/Sandbox/SecurityPolicy.php#L110.
So I updated the interface. But I wasn't sure on which branch (1.x, 2.x, 3.x) I should have opened the PR.
I also wondering if you want me to rename $obj to $object maybe ?
Commits
-------
3f07c38c Rename variable
This PR was merged into the 2.x branch.
Discussion
----------
do not reuse internally generated variable names during parsing
fixes#3647
Commits
-------
1411c454 do not reuse internally generated variable names during parsing