Fabien Potencier
0c30e78b1c
Add support for named arguments on special functions
2024-08-16 08:37:24 +02:00
Simon André
c662e0ce27
Remove remaining const optimizations
...
After #4198 some `Token::` const optimization remains.
This PR remove them.. **in case** it was not intended
2024-08-15 19:11:55 +02:00
Fabien Potencier
3156d8093e
Move FunctionExpression/FilterExpression/TestExpression attributes from compilation time to parsing time
2024-08-14 18:45:35 +02:00
Fabien Potencier
148d3e079d
Make various optimization for dynamic Twig callables
2024-08-12 09:45:32 +02:00
Fabien Potencier
cd0ac3cc0a
Remove const optimization
2024-08-12 09:40:52 +02:00
Fabien Potencier
0ce79df5c4
Use trigger_deprecation() instead of trigger_error() for deprecations
2024-08-08 14:28:28 +02:00
Fabien Potencier
c77354ebad
Add missing comment
2024-06-22 19:44:04 +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
b63bde3063
Optimize sprintf() calls for PHP 8.4
2024-06-21 08:16:55 +02:00
Fabien Potencier
2b2ac80d34
Fxi some errors reported by phpstan
2024-02-05 17:48:36 +01:00
Fabien Potencier
af8ec178b6
Remove list() usage in code
2024-01-05 12:46:24 +01:00
Jérôme Tamarelle
fb0d7495a8
Compile Elvis operator with Elvis operator
2023-10-21 19:08:38 +02:00
Jérôme Tamarelle
6d715e2002
Remove unused variables and unreachable code
2023-10-08 21:18:06 +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
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
Vincent Langlet
e98a652a6c
Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays
2022-11-18 10:55:01 +01:00
Vincent Langlet
de0f947efc
Remove internal from ExpressionParser
2022-10-20 22:22:52 +02:00
hubert.lenoir
009bb4fd82
Add "some" and "every" filters
2022-03-25 11:04:50 +01:00
Fabien Potencier
3fef888756
Merge branch '2.x' into 3.x
...
* 2.x:
Add a test
Added token type and value to error message
Add phpdoc to SecurityPolicyInterface
2022-03-25 09:18:59 +01:00
Kamyar Mirzavaziri
6c8da65b74
Added token type and value to error message
...
Added the given token type and value to the error message in case that the token after '.' is neither a name nor a number.
2022-03-25 09:17:46 +01:00
Fabien Potencier
9e6e700f96
minor #3509 Some code style fixes (dionisvl)
...
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Some code style fixes
Fixes that:
- Type cast is unnecessary
- Unnecessary curly braces syntax for variable
- Operations priority might differ that except
Commits
-------
17c6371f Some code style fixes
2021-05-14 10:26:10 +02:00
Den
17c6371fb5
Some code style fixes
2021-05-14 10:26:05 +02:00
Fabien Potencier
13e360972a
Merge branch '2.x' into 3.x
...
* 2.x:
Fix CS
Fix CS
Migrate to the new PHP CS Fixer config file
Fixing links
2021-05-12 09:45:40 +02:00
Fabien Potencier
2dd1d909b9
Fix CS
2021-05-12 09:37:17 +02:00
Fabien Potencier
7759111e75
Merge branch '2.x' into 3.x
...
* 2.x:
Update CHANGELOG
Update CHANGELOG
Fix previous merge
Make round brackets optional for one argument tests like sameas
2020-08-23 14:22:39 +02:00
Fabien Potencier
9bf49d5ccf
Merge branch '1.x' into 2.x
...
* 1.x:
Update CHANGELOG
Fix previous merge
Make round brackets optional for one argument tests like sameas
2020-08-23 14:22:09 +02:00
Andreas
1ee72d9e15
Make round brackets optional for one argument tests like sameas
2020-08-23 14:16:31 +02:00
Fabien Potencier
f9ae0f8237
Merge branch '2.x' into 3.x
...
* 2.x:
Bump version
Bump version
Tweak docs
Update CHANGELOG
Support object init from variable
2020-08-23 14:02:58 +02:00
Fabien Potencier
77dcff7186
Merge branch '1.x' into 2.x
...
* 1.x:
Bump version
Tweak docs
Update CHANGELOG
Support object init from variable
2020-08-23 14:01:18 +02:00
Jérôme TAMARELLE
133edb3696
Support object init from variable
...
{a} is a shortcut for {a:a}
From ECMAScript 2015 syntax https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer
2020-08-23 13:54:49 +02:00
Fabien Potencier
839b4f7744
Fix CS
2020-07-06 15:27:44 +02:00
Fabien Potencier
36141fafb2
Merge branch '1.x' into 2.x
...
* 1.x:
Unify code style
2020-07-06 15:27:15 +02:00
Jannik Zschiesche
38cb89c2bc
Unify code style
2020-07-06 14:57:49 +02:00
Fabien Potencier
8a6c47cbf2
Merge branch '2.x' into 3.x
...
* 2.x:
Allow trailing commas in macros + functions + filters
2020-07-06 14:00:03 +02:00
Fabien Potencier
865da858ae
Merge branch '1.x' into 2.x
...
* 1.x:
Allow trailing commas in macros + functions + filters
2020-07-06 13:59:53 +02:00
Jannik Zschiesche
ccc2dbb043
Allow trailing commas in macros + functions + filters
2020-07-06 13:58:05 +02:00
Fabien Potencier
e99363231b
Fix CS
2020-06-22 08:11:03 +02:00
Fabien Potencier
76352a037d
Merge branch '2.x' into 3.x
...
* 2.x:
Replace strtolower() with strtr() when dealing with method names
2020-01-08 09:32:39 +01:00
Fabien Potencier
04174b5f62
Merge branch '1.x' into 2.x
...
* 1.x:
Replace strtolower() with strtr() when dealing with method names
2020-01-08 09:32:31 +01:00
Matthias Pigulla
30feddef10
Replace strtolower() with strtr() when dealing with method names
2020-01-08 09:27:07 +01:00
Fabien Potencier
ad0a7b376f
Merge branch '2.x' into 3.x
...
* 2.x:
allowed string operators as variables names in assignments
2019-06-03 12:16:18 +02:00
Fabien Potencier
3fde1536d3
Merge branch '1.x' into 2.x
...
* 1.x:
allowed string operators as variables names in assignments
2019-06-03 12:15:17 +02:00
Fabien Potencier
5835c2344f
allowed string operators as variables names in assignments
2019-06-03 11:58:56 +02:00
Fabien Potencier
c191b7a184
Merge branch '2.x' into 3.x
...
* 2.x:
added support for macros on "is defined" tests
2019-05-17 18:56:16 +02:00
Fabien Potencier
9fe3213d1b
added support for macros on "is defined" tests
2019-05-17 18:04:15 +02:00
Fabien Potencier
3d1b9a11d8
Merge branch '2.x' into 3.x
...
* 2.x:
fixed CS
added the key to the map and filter filters
added support for iterators
removed fn in front of arrow functions
changed arrow syntax
added "filter", "map", and "reduce" filters
simplified code
fixed CS
bumped version to 2.10
bumped version to 1.41
fixed partial output leak when a PHP fatal error occurs
fixed markup in docs
2019-05-09 13:29:19 +02:00
Fabien Potencier
00966f434f
fixed CS
2019-05-09 13:27:48 +02:00
Fabien Potencier
5c484ce7eb
Merge branch '1.x' into 2.x
...
* 1.x:
added the key to the map and filter filters
added support for iterators
removed fn in front of arrow functions
changed arrow syntax
added "filter", "map", and "reduce" filters
simplified code
fixed CS
fixed partial output leak when a PHP fatal error occurs
2019-05-09 13:25:49 +02:00
Fabien Potencier
175041e01b
removed fn in front of arrow functions
2019-05-03 18:12:19 +02:00