This PR was merged into the 3.x branch.
Discussion
----------
Added configuration for commonmark use in twig-extra-bundle.
Following this tweet: https://twitter.com/ramsey/status/1561894460560138241, this PR adds the configuration options for `commonmark` to the `twig-extra-bundle`.
The configuration is added to the `LeagueCommonMarkConverterFactory` and in turn injected in the `CommonMarkConverter`. This way a user can provide the configuration for usage inside twig.
I'm not sure if adding the configuration inside the extension is the way to go.
Hope this helps out at least `@ramsey` :-)
Added `ignoreExtraKeys` to be somewhat future proof in case extra configuration is added later on, and also to be able to provide de configuration for extensions.
Commits
-------
6f20629622 Added configuration for commonmark use in twig-extra-bundle.
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix timezone conversion on strings
When setting a default application timezone, and a display timezone:
```php
date_default_timezone_set('UTC');
$twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris');
```
Date objects get converted, but strings don't. See #4545.
For most other paths in `convertDate`, the dateTime object is initialized, and afterwards the timezone gets set. For strings, the timezone is passed as a constructor argument before having the timezone set again, losing its converting behaviour. This makes the convertDate method work identical for DateTime objects as strings. This different behaviour was already spotted in #3568.
Fixes#4545#3568#2819
Commits
-------
f69531fa00 Fix timezone conversion on strings
This PR was merged into the 3.x branch.
Discussion
----------
Use correct lineno for ForElseNode
It should take the line number of the `{% else %}` block.
Commits
-------
a84e602b4f Use correct lineno for ForElseNode
This PR was merged into the 3.x branch.
Discussion
----------
Add support for registered undefined element callbacks in tests
This also defines the proper type for the callable arguments in those methods, allowing to know the expected signature (and allowing static analysis tools to check it) instead of having to inspect the implementation to see how those callables are used.
Commits
-------
198fc1a9f9 Add support for registered undefined element callbacks in tests
This PR was merged into the 3.x branch.
Discussion
----------
Reimplement the cache tag in an adhoc way
Commits
-------
3288d8d98d Reimplement the cache tag in an adhoc way
This PR was merged into the 3.x branch.
Discussion
----------
Add some tests on balanced brackets
Commits
-------
3b605c4180 Add some tests on balanced brackets
This PR was merged into the 3.x branch.
Discussion
----------
Fix typo for html_cva code example
Fix a typo where 'red' should be 'blue' according to the code above.
Commits
-------
83da53c3f1 Fix typo for html_cva code example
This PR was merged into the 3.x branch.
Discussion
----------
Fix Token::__toString()
Broken by #4554
Commits
-------
11535e9058 Fix Token::__toString()
This PR was merged into the 3.x branch.
Discussion
----------
add missing parentheses to deprecation message
Commits
-------
431697fc05 add missing parentheses to deprecation message
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate Token::getType()
This change will allow us to deprecate some types and let us trigger a deprecation.
Commits
-------
ade8bce516 Deprecate Token::getType()
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate passing $ifexpr to ForNode
Commits
-------
9d16de6e3d Deprecate passing $ifexpr to ForNode
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments()
Commits
-------
960f6762ed Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments()
This PR was merged into the 3.x branch.
Discussion
----------
Fix inheritance logic to be able to use instanceof ContextVariable instead of NameExpression
Commits
-------
b6d9dd62ee Fix inheritance logic to be able to use instanceof ContextVariable instead of NameExpression
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add return type annotations on Twig 3 to prepare Twig 4
Started to add missing type annotation following `@stof` comment [here](https://github.com/twigphp/Twig/pull/4523#discussion_r1901915880).
Update: I checked here every class (but one) in the `src` directory.
But you should ~~probably~~ **certainely** have another look.
Remains:
- src/ExpressionParser.php, where i'm not confident enough about the best return types (AbstractExpression|null works almost everytime, but lack some precision)
- extra directory
- tests directory
I'm happy to let them to someone else.... this was less fun than I expected 😅
Commits
-------
82be13429c Add return type annotations on Twig 3 to prepare Twig 4