Commit Graph

6005 Commits

Author SHA1 Message Date
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
Fabien Potencier 7f9cad9972 Add PHP 8.2 to the tests 2022-12-26 12:43:08 +01:00
Fabien Potencier ef7a5ef2e3 Remove a test that was a regression test for the C extension 2022-12-26 12:42:02 +01:00
Fabien Potencier e5c87f8821 Merge branch '2.x' into 3.x
* 2.x:
  Add output
  Fix the drupal testing script
  Add missing argument for the cycle function
2022-12-15 11:46:42 +01:00
Fabien Potencier 6642c3a520 minor #3779 Cycle function: Add output to example code (kathi-at-datrycs)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Cycle function: Add output to example code

At first I couldn't grasp the concept of the cycle function, but after I saw the output in twigfiddle it was clear. I can imagine other readers having the same issue. Therefore I suggest to add the output to the example code.

Commits
-------

1e3b126c Add output
2022-12-15 11:46:20 +01:00
Katharina Luthe 1e3b126cf2 Add output 2022-12-15 11:46:17 +01:00
Fabien Potencier 2ae70b5b9c minor #3780 Add missing argument for the cycle function (stof)
This PR was merged into the 2.x branch.

Discussion
----------

Add missing argument for the cycle function

Commits
-------

883fb333 Add missing argument for the cycle function
2022-12-15 11:45:51 +01:00
Fabien Potencier c8cf74de25 minor #3781 Fix the drupal testing script (stof)
This PR was merged into the 2.x branch.

Discussion
----------

Fix the drupal testing script

Commits
-------

f3b8c012 Fix the drupal testing script
2022-12-15 11:45:00 +01:00
Christophe Coevoet f3b8c01262 Fix the drupal testing script 2022-12-15 11:35:27 +01:00
Christophe Coevoet 883fb333b3 Add missing argument for the cycle function 2022-12-15 11:26:46 +01:00
Fabien Potencier 705d7ce122 Merge branch '2.x' into 3.x
* 2.x:
  Fix optimizing closures callbacks
  Update templates.rst
2022-12-13 16:48:36 +01:00
Fabien Potencier fba01bfba2 bug #3777 Fix optimizing closures callbacks (nicolas-grekas)
This PR was merged into the 2.x branch.

Discussion
----------

Fix optimizing closures callbacks

Follows https://github.com/twigphp/Twig/pull/3722 and https://github.com/php/php-src/issues/8932

Uses a dedicated method added to PHP 8.1.11 (and 8.0.24, but I feel like there is no need to make the check too complex for an outdated version. We just need a marker to make the code simpler when we'll bump to PHP >= 8.1.11.)

Commits
-------

406b3e59 Fix optimizing closures callbacks
2022-12-13 16:48:15 +01:00
Nicolas Grekas 406b3e5969 Fix optimizing closures callbacks 2022-12-12 16:33:12 +01:00
Fabien Potencier b5ec7ab1cd minor #3768 Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays (VincentLanglet)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays

Binary and Unary operator have a really specific format
```
array<string, array{precedence: int, class: class-string}>,
array<string, array{precedence: int, class: class-string, associativity: int}>
```
so it's worth to mention that in the phpdoc rather than `array<array>`

Commits
-------

e98a652a Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays
2022-11-18 10:55:04 +01:00
Vincent Langlet e98a652a6c Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays 2022-11-18 10:55:01 +01:00
Fabien Potencier ce55cb842e feature #3763 Remove internal from ExpressionParser (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Remove internal from ExpressionParser

In the advanced doc, it's explained how to write TokenParser:
https://github.com/twigphp/Twig/blob/3.x/doc/advanced.rst#defining-a-token-parser

Such an implementation rely on method like
ExpressionParser::parseExpression or Expression::parseMultitargetExpression,

Currently the ExpressionParser is marked as internal, implying all the method are also internal.
It would be great to promise BC about those methods since they are require/usefull for custom TokenParser.

I dunno if the ``@internal`` tag is still needed for some methods of the ExpressionParser (like the constructor ?).

This would also
Closes https://github.com/twigphp/Twig/issues/3443

Commits
-------

de0f947e Remove internal from ExpressionParser
2022-10-22 14:59:12 +02:00
Vincent Langlet de0f947efc Remove internal from ExpressionParser 2022-10-20 22:22:52 +02:00
Fabien Potencier 0986e54682 minor #3759 Update templates.rst (Francoscopic)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Update templates.rst

Changed "an other strategy" to "another strategy". I assume this latter should be the intended sentence structure.

Commits
-------

4904f38e Update templates.rst
2022-10-15 07:53:42 +02:00
Joshua Francis 4904f38e32 Update templates.rst 2022-10-15 07:53:40 +02:00
Fabien Potencier 6ddd95c709 Merge branch '2.x' into 3.x
* 2.x:
  Update michelf/php-markdown require-dev to allow v2
  Bump version
2022-10-05 08:26:51 +02:00
Fabien Potencier e542b9d5a1 minor #3751 Update michelf/php-markdown require-dev to allow v2 (bobvandevijver)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Update michelf/php-markdown require-dev to allow v2

This new release should work fine: https://github.com/michelf/php-markdown#version-history

Commits
-------

1a8ac1d8 Update michelf/php-markdown require-dev to allow v2
2022-10-05 08:25:59 +02:00
Bob van de Vijver 1a8ac1d83f Update michelf/php-markdown require-dev to allow v2 2022-10-05 08:25:56 +02:00
Fabien Potencier efe6294cc2 Bump version 2022-09-28 10:43:58 +02:00
Fabien Potencier 7a2e23ce17 Bump version 2022-09-28 10:43:25 +02:00
Fabien Potencier c38fd6b0b7 Prepare the 3.4.3 release v3.4.3 2022-09-28 10:42:51 +02:00
Fabien Potencier 5a858ac971 Merge branch '2.x' into 3.x
* 2.x:
  Prepare the 2.15.3 release
  Update CHANGELOG
2022-09-28 10:42:14 +02:00
Fabien Potencier ab402673db Prepare the 2.15.3 release v2.15.3 2022-09-28 10:40:08 +02:00
Fabien Potencier fc18c2ed30 Update CHANGELOG 2022-09-28 10:39:41 +02:00