Commit Graph

6499 Commits

Author SHA1 Message Date
Fabien Potencier 6f4e6e7b8e Make Environment::getGlobals() private 2024-07-05 08:05:37 +02:00
Fabien Potencier c33386a86d Merge branch '3.x' into 4.x
* 3.x:
  Add missing reference in docs
2024-07-05 08:05:09 +02:00
Fabien Potencier b37417972c Add missing reference in docs 2024-07-05 08:05:05 +02:00
Fabien Potencier b621b4473e Remove versionadded in docs 2024-07-05 08:01:53 +02:00
Fabien Potencier 0f76a81b10 Merge branch '3.x' into 4.x
* 3.x:
  Fix tests
  Tweak code and docs
  feat(string-extra): Add singularize and pluralize filter
2024-07-05 08:00:46 +02:00
Fabien Potencier 82d31319bb Fix tests 2024-07-05 07:59:36 +02:00
Fabien Potencier 0bbe173d29 feature #4107 [String] Add singularize and pluralize filter (welcoMattic, fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

[String] Add singularize and pluralize filter

This PR follows up this one in Symfony https://github.com/symfony/symfony/pull/57245.

It adds 2 new filters `singularize` and `pluralize`. It uses the String component, especially `EnglishInflector` and `FrenchInflector`.

Examples:

```php
{{ 'person'|pluralize('en') }} // persons
{{ 'person'|pluralize('en', false) }} // ['persons', 'people']

{{ 'personne'|pluralize('fr') }} // personnes
{{ 'personne'|pluralize('fr', false) }} // ['personnes']

{{ 'persons'|singluarize('en') }} // person
{{ 'people'|singluarize('en') }} // person
{{ 'persons'|singluarize('en', false) }} // ['person']

{{ 'personnes'|singluarize('fr') }} // personne
{{ 'personnes'|singluarize('fr', false) }} // ['personne']

{{ 'persona'|pluralize('it') }} // \InvalidArgumentException('Language "it" is not supported.')
{{ 'persone'|singluarize('it') }} // \InvalidArgumentException('Language "it" is not supported.')
```

Commits
-------

8c969d40 Tweak code and docs
cb392489 feat(string-extra): Add singularize and pluralize filter
2024-07-05 07:54:10 +02:00
Fabien Potencier 8c969d403c Tweak code and docs 2024-07-04 08:17:15 +02:00
Mathieu Santostefano cb392489c3 feat(string-extra): Add singularize and pluralize filter 2024-07-02 22:44:09 +02:00
Fabien Potencier cc7c08592d Merge branch '3.x' into 4.x
* 3.x:
  [Doc] Replace http links with https
  [Doc] Modernize Class name in examples
2024-07-02 08:11:16 +02:00
Fabien Potencier e4835b189f minor #4116 [Doc] Modernize Class name in examples (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Modernize Class name in examples

From "Project_Twig_Extension" to "CustomExtension"

Just a suggestion, feel free to close if you want to keep it like this :)

I found those namings only in "advanced"

Commits
-------

4a8e8ee1 [Doc] Modernize Class name in examples
2024-07-02 08:11:03 +02:00
Fabien Potencier b6360fbae3 minor #4117 [Doc] Replace http links with https (smnandre)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

[Doc] Replace http links with https

Commits
-------

ae429bd5 [Doc] Replace http links with https
2024-07-02 08:10:01 +02:00
Simon André ae429bd51d [Doc] Replace http links with https 2024-07-02 08:09:58 +02:00
Fabien Potencier 3734ba6a17 Merge branch '3.x' into 4.x
* 3.x:
  Remove usage of uniqid
  Document OPTIMIZE_TEXT_NODES
  Issue #3828: Add sequence and mapping tests
2024-07-01 18:45:00 +02:00
Fabien Potencier a2f5d49126 minor #4118 Remove usage of uniqid (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove usage of uniqid

Commits
-------

2f8219e6 Remove usage of uniqid
2024-07-01 18:43:37 +02:00
Fabien Potencier 2f8219e691 Remove usage of uniqid 2024-07-01 18:40:58 +02:00
Fabien Potencier cd2f7f2521 minor #4115 [Doc] Document OPTIMIZE_TEXT_NODES (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Document OPTIMIZE_TEXT_NODES

(and remove obselete OPTIMIZE_VAR_ACCESS)

Commits
-------

491a8417 Document OPTIMIZE_TEXT_NODES
2024-07-01 14:33:44 +02:00
Simon André 4a8e8ee16b [Doc] Modernize Class name in examples
From "Project_Twig_Extension" to "CustomExtension"

Just a suggestion, feel free to close if you want to keep it like this :)

I found those namings only in "advanced"
2024-06-30 10:31:01 +02:00
Simon André 491a84175d Document OPTIMIZE_TEXT_NODES
(and remove obselete OPTIMIZE_VAR_ACCESS)
2024-06-30 10:13:10 +02:00
Fabien Potencier 045f5adec7 feature #3859 Issue #3828: Add sequence and mapping tests (pdureau)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Issue #3828: Add sequence and mapping tests

Add sequence and mapping tests from Jinja.

Commits
-------

c5c95a2d Issue #3828: Add sequence and mapping tests
2024-06-22 19:49:10 +02:00
Pierre c5c95a2d5c Issue #3828: Add sequence and mapping tests 2024-06-22 19:48:59 +02:00
Fabien Potencier f22d417f8b Merge branch '3.x' into 4.x
* 3.x:
  Add missing comment
2024-06-22 19:44:22 +02:00
Fabien Potencier c77354ebad Add missing comment 2024-06-22 19:44:04 +02:00
Fabien Potencier 8dda0153c4 Remove deprecated features 2024-06-22 19:43:36 +02:00
Fabien Potencier 3236429dc8 Merge branch '3.x' into 4.x
* 3.x:
  Fix typo
  Tweak
  Rename array to sequence
  Rename hash to mapping
2024-06-22 19:42:47 +02:00
Fabien Potencier 3080da32c5 feature #4106 Rename hash to mapping and array to sequence (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Rename hash to mapping and array to sequence

Commits
-------

bc19f2f4 Tweak
c44be99a Rename array to sequence
5157402a Rename hash to mapping
2024-06-22 19:40:59 +02:00
Fabien Potencier f24929a4c9 Fix typo 2024-06-22 19:38:57 +02:00
Fabien Potencier bc19f2f48e Tweak 2024-06-22 19:37:52 +02:00
Fabien Potencier c44be99a84 Rename array to sequence 2024-06-22 19:37:51 +02:00
Fabien Potencier 5157402a77 Rename hash to mapping 2024-06-22 19:36:24 +02:00
Fabien Potencier c250afdda0 Optimize sprintf() calls for PHP 8.4 2024-06-21 08:27:51 +02:00
Fabien Potencier 67cb9a06fe Merge branch '3.x' into 4.x
* 3.x:
  Update PHPUnit config
  Optimize sprintf() calls for PHP 8.4
2024-06-21 08:27:27 +02:00
Fabien Potencier da4592793b minor #4109 Update PHPUnit config (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Update PHPUnit config

Commits
-------

b78dee86 Update PHPUnit config
2024-06-21 08:25:01 +02:00
Fabien Potencier 1d8458d6ec minor #4108 Optimize sprintf() calls for PHP 8.4 (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Optimize sprintf() calls for PHP 8.4

Commits
-------

b63bde30 Optimize sprintf() calls for PHP 8.4
2024-06-21 08:24:40 +02:00
Fabien Potencier b78dee8682 Update PHPUnit config 2024-06-21 08:22:31 +02:00
Fabien Potencier b63bde3063 Optimize sprintf() calls for PHP 8.4 2024-06-21 08:16:55 +02:00
Fabien Potencier 26052502fb Remove deprecated code 2024-06-18 17:16:06 +02:00
Fabien Potencier 9ce10b3260 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate CallExpression::compileArguments
  Bump version
  Prepare the 3.10.3 release
  Fix parse error in generated code when using CaptureNode
  Bump version
  Prepare the 3.10.2 release
2024-06-18 17:15:24 +02:00
Fabien Potencier ca395348cf feature #4105 Deprecate the second argument of CallExpression::compileArguments (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate the second argument of CallExpression::compileArguments

Commits
-------

71d6c82d Deprecate CallExpression::compileArguments
2024-06-18 17:14:20 +02:00
Fabien Potencier 71d6c82de6 Deprecate CallExpression::compileArguments 2024-06-18 17:13:26 +02:00
Fabien Potencier ab071efe3b Bump version 2024-05-31 17:05:59 +02:00
Fabien Potencier 67f29781ff Prepare the 3.10.3 release v3.10.3 2024-05-16 11:04:27 +01:00
Fabien Potencier 75fc9b9487 bug #4093 Fix parse error in generated code when using CaptureNode (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Fix parse error in generated code when using CaptureNode

Fix #4092

Introduced in https://github.com/twigphp/Twig/commit/799355dc823c80467f82670dfca8b57e9cd09622

Commits
-------

50425283 Fix parse error in generated code when using CaptureNode
2024-05-16 11:03:08 +01:00
Nicolas Grekas 504252835c Fix parse error in generated code when using CaptureNode 2024-05-16 11:46:35 +02:00
Fabien Potencier 7069d82f23 Bump version 2024-05-14 07:06:34 +01:00
Fabien Potencier 7aaed0b831 Prepare the 3.10.2 release v3.10.2 2024-05-14 07:04:16 +01:00
Fabien Potencier bf356b3fd7 Remvoe obsolete docs 2024-05-14 06:50:45 +01:00
Fabien Potencier 447c9cc17c Merge branch '3.x' into 4.x
* 3.x:
  Fix old escaper signature + add docs
  Bump version
  Prepare the 3.10.1 release
2024-05-14 06:50:29 +01:00
Fabien Potencier f553f16999 bug #4091 Fix old escaper signature + add docs (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix old escaper signature + add docs

Closes #4087
Closes #4088

Commits
-------

04b1ad3c Fix old escaper signature + add docs
2024-05-14 06:47:40 +01:00
Fabien Potencier 04b1ad3ced Fix old escaper signature + add docs 2024-05-13 18:21:17 +02:00