75 Commits

Author SHA1 Message Date
Fabien Potencier 9ac4a2dd9c Merge branch '3.x' into 4.x
* 3.x:
  Fix tiny typo in CI workflow label
  Fix typo
  Fix opcache preload warning for unlinked anonymous class
  Bump version
  Prepare the 3.22.2 release
  Add .gitignore & .gitattributes to all .gitattributes
2026-01-07 16:24:12 +01:00
jmsche ff327e4163 Add .gitignore & .gitattributes to all .gitattributes 2025-12-02 15:45:16 +01:00
Fabien Potencier 83f264bcd8 Merge branch '3.x' into 4.x
* 3.x:
  Allow Symfony 8 packages in Twig extra packages
  Fix array typehint for $variants in HtmlExtension
2025-11-02 20:03:33 +01:00
Javier Eguiluz 9a8a1dc1dd Allow Symfony 8 packages in Twig extra packages 2025-11-02 12:00:49 +01:00
Fabien Potencier dc6356268b Bump min PHP version to 8.1 2025-01-31 21:45:36 +01:00
Fabien Potencier cf105b566a Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-11-30 09:43:08 +01:00
Fabien Potencier 14fc89ebea Fix CS 2024-11-30 09:42:13 +01:00
Fabien Potencier 6f996fc214 Merge branch '3.x' into 4.x
* 3.x:
  Simplify enum usage in docs
  Forbid adding Nodes to EmptyNode
  Add phpstan analysis
  Fix the intl-extra tests
  Fix the string-extra tests when running with older symfony/string
  Fix the exception message to match the expected one for not ready nodes
  Add missing import
  Add BC break note in CHANGELOG for 3.15
  Fix CHANGELOG
  Update CHANGELOG
  Bump version
  Prepare the 3.15.0 release
2024-11-22 10:06:29 +01:00
Christophe Coevoet abc34bd263 Fix the string-extra tests when running with older symfony/string 2024-11-20 14:10:15 +01:00
Fabien Potencier 429b13c9b0 Merge branch '3.x' into 4.x
* 3.x:
  Remove obsolete code
  Update CHANGELOG
  Sandbox ArrayAccess and do sandbox checks before isset() checks
  Fix sandbox handling for __toString()
  Fix mistake in docs for `keys` filter
  Update CHANGELOG
  [String] Add SpanishInflector support for singular and plural
  Add `find` to `Filters` docs
  Remove duplicate test case
  Revert "minor #4411 Add return type to getDebugInfo (ruudk)"
  Add `$this` return type to Template::unwrap
  Add link to TwigQI in docs "You might also be interested in" section
  Add return type to compiled macro
2024-11-06 21:52:30 +01:00
Dennis Tobar 290a923a42 [String] Add SpanishInflector support for singular and plural 2024-11-03 15:08:48 +01:00
Alexander M. Turek f2053bbea0 PHPUnit 11 2024-09-04 12:11:51 +02:00
Fabien Potencier a789eca738 Merge branch '3.x' into 4.x
* 3.x:
  Validate the input of CoreExtension::map()
  Rename AbstractTest to ProfilerTestCase
  Make data providers static
  Prepare IntegrationTestCase for static data providers
2024-09-03 22:20:28 +02:00
Alexander M. Turek 18f4203827 Prepare IntegrationTestCase for static data providers 2024-09-03 15:08:40 +02:00
Fabien Potencier 06ac86e3dd Merge branch '3.x' into 4.x
* 3.x:
  Fix tests
  Allow extra extensions to use Twig 4
2024-09-01 23:00:16 +02:00
Fabien Potencier 976cea0403 Fix tests 2024-09-01 22:54:59 +02:00
Fabien Potencier 031c7bda4d Allow extra extensions to use Twig 4 2024-09-01 22:39:12 +02:00
Simon André 470965fcc2 Add missing return types in 4.0 2024-08-17 23:10:07 +02:00
Fabien Potencier c070cd719c Drop support for 8.0 2024-08-10 12:32:24 +02:00
Fabien Potencier 0131c230c7 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-08-07 19:34:39 +02:00
Fabien Potencier f5e10e10f1 Fix CS 2024-08-07 19:34:09 +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 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 b78dee8682 Update PHPUnit config 2024-06-21 08:22:31 +02:00
Fabien Potencier b80f74af9a Merge branch '3.x' into 4.x
* 3.x:
  Bump version
  Prepare the 3.10.0 release
  Update CHANGELOG
  Fix markup
  Revert "minor #4042 Auto-close PRs on subtree-splits (kbond)"
  Fix typo
2024-05-11 09:45:46 +02:00
Fabien Potencier 761aa56a6f Revert "minor #4042 Auto-close PRs on subtree-splits (kbond)"
This reverts commit 12625c0c05, reversing
changes made to ad934312cd.
2024-05-11 09:35:57 +02:00
Fabien Potencier 9a11ee1c64 Merge branch '3.x' into 4.x
* 3.x:
  Bump version to 3.9.4-DEV
  Fix a warning
  Use ::class everywhere
  Auto-close PRs on subtree-splits
  Bump version
  Prepare the 3.9.3 release
  Update CHANGELOG
  Ensure Lexer:: is always initialized
  fix: #4033 add missing unwrap call when a TemplateWrapper instance can be present
  change extended DI extension class
  fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false
2024-04-24 08:25:00 +02:00
Kevin Bond b212f1bb2f Auto-close PRs on subtree-splits 2024-04-19 08:34:22 +02:00
Fabien Potencier ae7e6cc9a3 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
  Remove redundant "$thing instanceof \Countable" check
  Update PHPUnit schema
  fix TwigExtraBundle tests with Symfony 6.0/6.1
2024-02-10 10:03:27 +01:00
Fabien Potencier f7f11ea410 Fix CS 2024-02-10 09:52:03 +01:00
Fabien Potencier 5d5ea62171 Merge branch '3.x' into 4.x
* 3.x:
  Remove support for Twig 2.x and unmaintained Symfony versions
  Clarify the behavior when a property/method does not exist
2024-01-25 09:17:53 +01:00
Fabien Potencier b1a8feaa55 Remove support for Twig 2.x and unmaintained Symfony versions 2024-01-25 08:19:28 +01:00
Fabien Potencier f930a284fe Bump to 4.0 and require PHP 8.2 2023-12-09 13:45:50 +01:00
Fabien Potencier fdb9d9eddf Bump dependencies 2023-11-21 15:02:01 +01:00
Christian Flothmann b8b0c39663 allow Symfony 7 packages to be installed 2023-09-11 13:25:50 +02:00
Fabien Potencier fa5f1d4c2e Merge branch '2.x' into 3.x
* 2.x:
  Bump min deps
2023-07-29 17:34:56 +02:00
Fabien Potencier c12990f9e7 Bump min deps 2023-07-29 13:31:08 +02:00
Fabien Potencier 08d2037f26 Bump version to 3.6 2023-02-09 07:45:16 +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 0cfb6f55e9 Merge branch '2.x' into 3.x
* 2.x:
  Bump LICENSE year
  Bump version
  Prepare the 2.15.4 release
2023-01-01 09:43:26 +01:00
Fabien Potencier eb8bde3c41 Bump LICENSE year 2023-01-01 09:42:51 +01:00
Fabien Potencier 0c8f5b2ea4 Bump version to 3.5 2022-12-27 13:23:36 +01:00
Fabien Potencier 5aad8295af Merge branch '2.x' into 3.x
* 2.x:
  Bump license year
  Typo fix : "flexiblity" ➤ "flexibility"
  allow translation-contracts:^3
2022-01-02 11:02:25 +01:00
Fabien Potencier ce97157b43 Bump license year 2022-01-02 11:02:19 +01:00
Michał Jusięga 0c1e4edc8b allow translation-contracts:^3 2021-12-22 17:41:26 +01:00