Commit Graph

6082 Commits

Author SHA1 Message Date
Fabien Potencier 9a9580fff9 Bump version 2023-07-26 09:17:41 +02:00
Fabien Potencier 5cf942bbab Prepare the 3.7.0 release v3.7.0 2023-07-26 09:16:09 +02:00
Fabien Potencier 07c4b11399 Update CHANGELOG 2023-07-26 09:15:15 +02:00
Nicolas Grekas 4ef92bf092 minor #3860 Fix spread operator implementation (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Fix spread operator implementation

#3839 is too invasive, leading to failures like https://github.com/symfony/symfony/actions/runs/5612246672/jobs/10269741115

Commits
-------

75efa5e1 Fix spread operator implementation
2023-07-20 18:36:01 +02:00
Nicolas Grekas 75efa5e1ba Fix spread operator implementation 2023-07-20 18:11:45 +02:00
Fabien Potencier 09177a7006 feature #3839 Adding support for the ...spread operator on arrays and hashes (weaverryan)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Adding support for the ...spread operator on arrays and hashes

Hi!

Long time user, first time contributor of a real future. I hope I didn't miss anything - but this seemed quite straightforward in the end.

Notes:
* In PHP 7.3 or lower, using the spread operator will result in a Twig syntax error.
* In 8.0 or lower, using the spread operator on a hash will result in a Twig syntax error.

fabbot failures are unrelated, so I'm not touching them.

Cheers!

Commits
-------

ba4fe3ba Adding support for the ...spread operator on arrays and hashes
2023-07-20 16:08:59 +02:00
Ryan Weaver ba4fe3ba34 Adding support for the ...spread operator on arrays and hashes 2023-07-20 16:08:57 +02:00
Fabien Potencier e145d36266 minor #3856 Fix callable phpdoc for twig elements (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Fix callable phpdoc for twig elements

Hi `@fabpot`
```
[MyRuntime::class, 'myMethod]
```
is not a valid callable in PHP 8 https://3v4l.org/tWqPs

But this syntax is supported because twig has a special behavior
```
$compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
```

The PHPDoc should be updated in order to reflect the real behavior and solve static analysis errors.
A phpstan discussion can be found here: https://github.com/phpstan/phpstan/discussions/9567

Commits
-------

cd68de5e Fix callable phpdoc for twig elements
2023-07-05 12:13:55 +02:00
Vincent Langlet cd68de5e06 Fix callable phpdoc for twig elements 2023-07-05 11:30:59 +02:00
Fabien Potencier 58f7b22081 minor #3854 add extra example to slice filter (expedition-robin-martijn)
This PR was merged into the 3.x branch.

Discussion
----------

add extra example to slice filter

Commits
-------

0170dc3c add extra example to slice filter
2023-06-30 08:17:55 +02:00
Robin Martijn 0170dc3cd7 add extra example to slice filter 2023-06-28 14:29:30 +02:00
Fabien Potencier 2fa539bfe7 Merge branch '2.x' into 3.x
* 2.x:
  Mention where named arguments are supported
  Bump version
2023-06-12 08:17:02 +02:00
Fabien Potencier 7f4f55575b minor #3849 Mention where named arguments are supported (mpdude)
This PR was merged into the 2.x branch.

Discussion
----------

Mention where named arguments are supported

This follows up on #929. I tend to forget this detail, so it confuses me over and over again.

Commits
-------

ef9d7855 Mention where named arguments are supported
2023-06-12 08:16:05 +02:00
Fabien Potencier df75bfef37 Bump version to 3.6.2 2023-06-09 16:03:53 +02:00
Matthias Pigulla ef9d785518 Mention where named arguments are supported 2023-06-09 11:18:52 +00:00
Fabien Potencier 7e7d5839d4 Prepare the 3.6.1 release v3.6.1 2023-06-08 14:52:13 +02:00
Fabien Potencier 69d58e5705 Update CHANGELOG 2023-06-08 14:51:43 +02:00
Fabien Potencier 833e51ea35 minor #3840 Suppress native return type deprecation msg (PhilETaylor)
This PR was merged into the 3.x branch.

Discussion
----------

Suppress native return type deprecation msg

> Method "Symfony\Component\DependencyInjection\Extension\ExtensionInterface::load()" might add "void" as a native return type declaration in the future. Do the same in implementation "Twig\Extra\TwigExtraBundle\DependencyInjection\TwigExtraExtension" now to avoid errors or add an explicit ``@return`` annotation to suppress this message.

Commits
-------

72d6f205 suppress native return type deprecation msg
2023-05-06 19:15:54 +02:00
Phil E. Taylor 72d6f20556 suppress native return type deprecation msg 2023-05-06 12:11:46 +01:00
Fabien Potencier 51ccbdc983 Bump version 2023-05-03 21:08:52 +02:00
Fabien Potencier 3fd3645601 Bump version 2023-05-03 21:08:22 +02:00
Fabien Potencier 106c170d08 Prepare the 3.6.0 release v3.6.0 2023-05-03 21:06:57 +02:00
Fabien Potencier 0911e40675 Update CHANGELOG 2023-05-03 21:06:32 +02:00
Fabien Potencier 125532f572 Merge branch '2.x' into 3.x
* 2.x:
  Prepare the 2.15.5 release
  Update CHANGELOG
2023-05-03 19:50:57 +02:00
Fabien Potencier fc02a6af3e Prepare the 2.15.5 release v2.15.5 2023-05-03 19:49:41 +02:00
Fabien Potencier 17bf0637d9 Update CHANGELOG 2023-05-03 19:49:13 +02:00
Fabien Potencier e2d668551b Merge branch '2.x' into 3.x
* 2.x:
  Making the Lexer initialize itself lazily, to avoid loading the extension set early
2023-05-03 19:47:35 +02:00
Fabien Potencier 72230e28d3 bug #3837 Making the Lexer initialize itself lazily, to avoid loading the extension set early (weaverryan)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Making the Lexer initialize itself lazily, to avoid loading the extension set early

Hi!

Over on Symfony UX, we are pushing Twig in some crazy, "unconventional" ways by overriding the lexer to add a new HTML-like syntax - e.g. `<twig:Alert type="success">` - https://github.com/symfony/ux/blob/2.x/src/TwigComponent/src/Twig/ComponentLexer.php

Normally, the internal `Lexer` is not instantiated until it's needed - i.e. when a template is rendered. However, when overriding the lexer, our `ComponentLexer` needs to be instantiated early and set onto the `Environment`. And since it needs to extend `Lexer`, `Lexer::__construct()` is called much earlier than normal. One line in the constructor - https://github.com/twigphp/Twig/blob/f5ee1b6815a28fbab6e6fbb8c48b7964f0d93dd4/src/Lexer.php#L108 - causes the "extension set" to be loaded inside `Environment`. Some applications rely on being able to set extra Twig extensions after `Environment` is created, but before a template is rendered and our custom lexer currently breaks that.

So, the suggestion is to make the work inside `__construct()` done later. Everything is private, so I believe this is safe.

Cheers!

Commits
-------

2f7e8680 Making the Lexer initialize itself lazily, to avoid loading the extension set early
2023-05-03 19:47:15 +02:00
Ryan Weaver 2f7e868017 Making the Lexer initialize itself lazily, to avoid loading the extension set early 2023-05-03 19:47:11 +02:00
Fabien Potencier f5ee1b6815 minor #3834 Put example all on one line (edent)
This PR was merged into the 3.x branch.

Discussion
----------

Put example all on one line

Fixes #3833

Commits
-------

9bb05aca Put example all on one line
2023-04-25 14:06:28 +02:00
Terence Eden 9bb05acae4 Put example all on one line
Fixes #3833
2023-04-24 22:26:49 +01:00
Fabien Potencier 1812ca1ade bug #3832 return annotation to suppress deprecation warning (PhilETaylor)
This PR was merged into the 3.x branch.

Discussion
----------

return annotation to suppress deprecation warning

(finally PRed in the right repo - sorry about that)

> !!  2023-04-14T10:59:02+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Twig\Extra\TwigExtraBundle\TwigExtraBundle" now to avoid errors or add an explicit ``@return`` annotation to suppress this message.

Commits
-------

b7a8ebbe return annotation to suppress deprecation warning
2023-04-14 13:18:53 +02:00
Phil E. Taylor b7a8ebbe6f return annotation to suppress deprecation warning 2023-04-14 12:03:02 +01:00
Fabien Potencier 05bb9186ff minor #3831 Adding mb_strlen (ThomasLandauer)
This PR was merged into the 3.x branch.

Discussion
----------

Adding mb_strlen

Commits
-------

19be50ff Adding mb_strlen
2023-04-11 19:38:30 +02:00
Thomas Landauer 19be50ff01 Adding mb_strlen 2023-04-11 12:35:17 +02:00
Fabien Potencier 78c18ad58e minor #3812 Allow psr/container 2.0.2 (tobilektri)
This PR was merged into the 3.x branch.

Discussion
----------

Allow psr/container 2.0.2

Should allow psr/container 2.0.2 - not only 1.1.2

Changes:
https://github.com/php-fig/container/compare/2.0.2...1.1.2

Commits
-------

d140542c Allow psr/container 2.0.2
2023-02-15 10:14:05 +01:00
Tobias Meindl d140542c2e Allow psr/container 2.0.2
Should allow psr/container 2.0.2 - not only 1.1.2

Changes:
https://github.com/php-fig/container/compare/2.0.2...1.1.2
2023-02-15 10:01:39 +01:00
Fabien Potencier 08d2037f26 Bump version to 3.6 2023-02-09 07:45:16 +01:00
Fabien Potencier 77f0eb37ea feature #3808 Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting. (sukei)
This PR was merged into the 3.x branch.

Discussion
----------

Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting.

Since PHP 8.0, IntlDateFormatter get new constants to format relative dates. This PR add those constants.

Commits
-------

5776f760 Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting.
2023-02-09 07:42:43 +01:00
Quentin Schuler 5776f76068 Add the new PHP 8.0 IntlDateFormatter::RELATIVE_* constants for date formatting. 2023-02-08 10:10:14 +01:00
Fabien Potencier e172f3c6f4 Bump version 2023-02-08 08:51:03 +01:00
Fabien Potencier 2bd9c96c74 Fix LICENSE year 2023-02-08 08:50:32 +01:00
Fabien Potencier a6e0510cc7 Prepare the 3.5.1 release v3.5.1 2023-02-08 08:49:20 +01:00
Fabien Potencier 0752948cdf Update CHANGELOG 2023-02-08 08:48:35 +01:00
Fabien Potencier 4650d37fb2 Merge branch '2.x' into 3.x
* 2.x:
  Fix LICENSE year
2023-02-08 08:44:55 +01:00
Fabien Potencier 872646a70f Fix LICENSE year 2023-02-08 08:44:48 +01:00
Fabien Potencier 10a7bc13fb bug #3809 Restores the leniency of the matches twig comparison (la5942)
This PR was merged into the 3.x branch.

Discussion
----------

Restores the leniency of the `matches` twig comparison

Restores the leniency of the `matches` twig comparison, allowing null subject to result in a non-match.

Resolves BC break introduced in PR https://github.com/twigphp/Twig/pull/3687 ref in https://github.com/twigphp/Twig/issues/3801#issuecomment-1413345131

As per pattern in https://github.com/twigphp/Twig/pull/3617

Commits
-------

f1366689 Restores the leniency of the `matches` twig comparison, allowing null subject to result in a non-match.
2023-02-08 08:21:13 +01:00
Jacob Richardson f136668933 Restores the leniency of the matches twig comparison, allowing null subject to result in a non-match.
Resolves BC break introduced in PR https://github.com/twigphp/Twig/pull/3687

As per pattern in https://github.com/twigphp/Twig/pull/3617
2023-02-07 17:07:16 +00:00
Fabien Potencier b3bdf6abf6 Merge branch '2.x' into 3.x
* 2.x:
  Minor: Fixing language
2023-02-02 13:25:22 +01:00
Fabien Potencier 2e99376bae minor #3806 Minor: Fixing language (ThomasLandauer)
This PR was submitted for the 3.x branch but it was squashed and merged into the 2.x branch instead.

Discussion
----------

Minor: Fixing language

Commits
-------

f52b45d2 Minor: Fixing language
2023-02-02 13:22:52 +01:00