Commit Graph

6032 Commits

Author SHA1 Message Date
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 609794c376 feature #3803 pass the current key to reduce filter's callback (ju1ius)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

pass the current key to reduce filter's callback

See #3802 for context.

Commits
-------

4f2f3f81 pass the current key to reduce filter's callback
2023-01-25 10:42:46 +01:00
ju1ius 4f2f3f814e pass the current key to reduce filter's callback 2023-01-25 10:42:37 +01:00
Fabien Potencier 0d29e91374 minor #3804 Update docs for filters that use the calendar option (phansys)
This PR was merged into the 3.x branch.

Discussion
----------

Update docs for filters that use the `calendar` option

`IntlExtension` does not accept "Gregorian", just "gregorian" ([ref](https://github.com/twigphp/intl-extra/blob/f5aa1e3fe3286d476ceca5feafd4390564f7cc29/IntlExtension.php#L324)).

Commits
-------

9527f93e Update docs for filters that use the `calendar` option
2023-01-23 11:42:27 +01:00
Javier Spagnoletti 9527f93e75 Update docs for filters that use the calendar option 2023-01-21 14:32:09 -03:00
Fabien Potencier 9a40f4a18a bug #3800 Fix error messages in sandboxed mode for has some and has every (stof)
This PR was merged into the 3.x branch.

Discussion
----------

Fix error messages in sandboxed mode for has some and has every

This has been forgotten when changing the PR to implement operators rather than filters.

Commits
-------

44c46712 Fix error messages in sandboxed mode for has some and has every
2023-01-03 19:07:44 +01:00
Christophe Coevoet 44c46712b8 Fix error messages in sandboxed mode for has some and has every 2023-01-03 18:06:19 +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 7b4d2a69f3 Tweak docs 2022-12-28 14:50:47 +01:00
Fabien Potencier 1dc69ff852 minor #3795 Fix CHANGELOG (jdreesen)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Fix CHANGELOG

The title of #3670 is misleading, as the implementation changed from being a filter to an operator.

Also fixed some typos.

Commits
-------

dc693725 Fix CHANGELOG
2022-12-28 14:45:17 +01:00
Jacob Dreesen dc693725ea Fix CHANGELOG 2022-12-28 14:45:14 +01:00
Fabien Potencier 462c9aeddd minor #3797 Add "has some" and "has every" expressions documentation (Jean-Beru)
This PR was merged into the 3.x branch.

Discussion
----------

Add "has some" and "has every" expressions documentation

Add documentation for https://github.com/twigphp/Twig/pull/3670.

Commits
-------

459ed67e Add "has some" and "has every" expressions
2022-12-28 14:43:25 +01:00
hubert.lenoir 459ed67e48 Add "has some" and "has every" expressions 2022-12-28 14:34:31 +01:00
Fabien Potencier 8f8d67b489 Add some missing functions in docs 2022-12-27 13:34:33 +01:00
Fabien Potencier 7d326d512f Bump version 2022-12-27 13:29:16 +01:00
Fabien Potencier 3ffcf4b7d8 Prepare the 3.5.0 release v3.5.0 2022-12-27 13:28:18 +01:00
Fabien Potencier d573914760 Bump version 2022-12-27 13:27:28 +01:00
Fabien Potencier 3e059001d6 Prepare the 2.15.4 release v2.15.4 2022-12-27 13:26:20 +01:00
Fabien Potencier 0e5d37e59c Update CHANGELOG 2022-12-27 13:25:12 +01:00
Fabien Potencier 0c8f5b2ea4 Bump version to 3.5 2022-12-27 13:23:36 +01:00
Fabien Potencier 01d55dbd1b Merge branch '2.x' into 3.x
* 2.x:
  Update CHANGELOG
2022-12-27 13:19:42 +01:00
Fabien Potencier de55785d85 Update CHANGELOG 2022-12-27 13:19:32 +01:00
Fabien Potencier 3b46c89a66 feature #3742 Add function twig *_name for intl (seb-jean, fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add function twig *_name for intl

Hi,

I add `language_names`, `script_names`, `country_names`, `locale_names`, `currency_names`, `timezone_names`.

It allows us to have a list but on the Twig side and to use them in filters for example.

Commits
-------

6f9c7c02 Fix tests
b376bdd0 Add function twig *_name for intl list
2022-12-27 12:52:32 +01:00
Fabien Potencier 6f9c7c02ae Fix tests 2022-12-27 12:49:56 +01:00
seb-jean b376bdd0a9 Add function twig *_name for intl list 2022-12-27 12:49:56 +01:00
Fabien Potencier 4a7c8b3b67 minor #3687 throwing syntax error when the matches regexp is not valid (WebMamba, fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

throwing syntax error when the matches regexp is not valid

During the symfony live, Fabien talk about a PR he did on the Expression Language component (https://github.com/symfony/symfony/pull/45875/files). The goal was to throw a more readable error when using the matchs operator. This think need to be fix in twig to. So as promises, here is my PR !
This is my first contrib to symfony so any advice is welcome ! 😁

Commits
-------

a82e94d9 Add some tests
61672c43 throwing syntaxt error when the matches regexp is not valid
2022-12-27 12:34:09 +01:00
Fabien Potencier a82e94d911 Add some tests 2022-12-27 12:31:54 +01:00
Matheo Daninos 61672c43f9 throwing syntaxt error when the matches regexp is not valid 2022-12-27 12:25:33 +01:00
Fabien Potencier f6ef36a447 Merge branch '2.x' into 3.x
* 2.x:
  do not clean up whitespace text nodes inside if tags
2022-12-26 20:36:12 +01:00
Fabien Potencier 7cbabe42e2 bug #3738 do not clean up whitespace text nodes inside if tags (xabbuh)
This PR was merged into the 2.x branch.

Discussion
----------

do not clean up whitespace text nodes inside if tags

Commits
-------

c8ec092c do not clean up whitespace text nodes inside if tags
2022-12-26 18:08:03 +01:00
Christian Flothmann c8ec092ceb do not clean up whitespace text nodes inside if tags 2022-12-26 18:04:52 +01:00
Fabien Potencier 93196e9eea feature #3788 Add Compile::reset() (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add Compile::reset()

refs #3736

Commits
-------

824dbd9e Add Compile::reset()
2022-12-26 17:49:43 +01:00
Fabien Potencier 04c8163e01 Merge branch '2.x' into 3.x
* 2.x:
  Bump version of actions/cache
2022-12-26 17:29:12 +01:00
Fabien Potencier 6cd1473d65 Bump version of actions/cache 2022-12-26 17:29:08 +01:00
Fabien Potencier e752a1450f Merge branch '2.x' into 3.x
* 2.x:
  chore: Included githubactions in the dependabot config
2022-12-26 17:20:57 +01:00
naveen 3b6a2a6910 chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-12-26 17:19:56 +01:00
Fabien Potencier d769ae90d1 feature #3670 Add "some" and "every" filters (Jean-Beru)
This PR was merged into the 3.x branch.

Discussion
----------

Add "some" and "every" filters

This PR adds 2 new tests inspired from Javascript's functions: [some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) and [every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).

Usage :
```twig
Value {{ ([1, 2, 3] has some v => v == 2) ? 'found' : 'not found' }}

Key {{ ([1, 2, 3] has some (v, k) => k == 2) ? 'found' : 'not found' }}

Every values {{ ([1, 2, 3] has every v => 42 > v) ? 'match' : 'do not match' }}

Every keys {{ ([1, 2, 3] has every (v, k) => 42 > k) ? 'match' : 'do not match' }}
```

Commits
-------

009bb4fd Add "some" and "every" filters
2022-12-26 17:18:29 +01:00
Fabien Potencier d53fc8044e minor #3718 chore: Included githubactions in the dependabot config (naveensrinivasan)
This PR was merged into the 3.x branch.

Discussion
----------

chore: Included githubactions in the dependabot config

This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>

Commits
-------

6448ca06 chore: Included githubactions in the dependabot config
2022-12-26 17:16:16 +01:00
Fabien Potencier b1d00ba58a minor #3728 Update .gitattributes (cedric-anne)
This PR was merged into the 3.x branch.

Discussion
----------

Update .gitattributes

`.github` directory and `.editorconfig`, `.gitattributes`, `.gitignore` and `.php-cs-fixer.dist.php` are present in dist package. I added `export-ignore` attribute to them.

Commits
-------

849d6832 Update .gitattributes
2022-12-26 17:14:22 +01:00
Fabien Potencier 824dbd9e21 Add Compile::reset() 2022-12-26 17:10:13 +01:00
Fabien Potencier fe347bbf1b Merge branch '2.x' into 3.x
* 2.x:
  Fix tests
  Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
2022-12-26 16:12:53 +01:00
Fabien Potencier 61f55998d2 Fix tests 2022-12-26 16:06:40 +01:00
Fabien Potencier 6c2bb9fc8d bug #3769 Updates CoreExtension::twig_constant to check for definition first to avoid hard crash (Alex Henderson-Roche)
This PR was merged into the 2.x branch.

Discussion
----------

Updates CoreExtension::twig_constant to check for definition first to avoid hard crash

The behaviour of PHP's constant() method has been updated after https://github.com/php/php-src/issues/9905 was accepted and fixed in PHP 8.1 (and previously changed post PHP 8.0) . This PR prevents a fatal error in the case a constant is supplied that doesn't actually exist.

Commits
-------

56b31224 Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
2022-12-26 13:36:08 +01:00
Alex Henderson-Roche 56b31224bd Updates CoreExtension::twig_constant to check for definition first to avoid hard crash 2022-12-26 13:36:01 +01:00
Fabien Potencier 7144b9b442 Merge pull request #3787 from fabpot/drupal-test-on-3x
Re-enable Drupal integration tests
2022-12-26 13:29:49 +01:00
Fabien Potencier 589655c1b9 Re-enable Drupal integration tests 2022-12-26 13:27:08 +01:00
Fabien Potencier 201baa76a6 Merge branch '2.x' into 3.x
* 2.x:
  Do more Github actions updates
  Use checkout actions v3
  Add PHP 8.2 to the tests
  Remove a test that was a regression test for the C extension
2022-12-26 13:19:29 +01:00
Fabien Potencier dec30692ab Do more Github actions updates 2022-12-26 12:47:02 +01:00
Fabien Potencier e428a0b701 Use checkout actions v3 2022-12-26 12:43:42 +01:00