Commit Graph

7732 Commits

Author SHA1 Message Date
Jacob Dreesen 151b05b2bb Fix some typos in html_cva docs 2024-11-08 19:22:16 +01:00
Fabien Potencier 5b380e5b3b minor #4435 Fix wrong type for cycle position (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Fix wrong type for cycle position

It also accepts 0, which is not a positive int.

Commits
-------

c78499bda9 Fix wrong type for cycle position
2024-11-07 18:02:41 +01:00
Fabien Potencier 8f1ae67b73 minor #4421 Add type for join method (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Add type for join method

Looking at the code, this method is very forgiving in what it accepts.

This helps PHPStan to not complain when something other than an array is passed.

Did I miss other types?

/cc `@stof`

Commits
-------

226f0ff0dd Add type for join method
2024-11-07 18:02:05 +01:00
Fabien Potencier 0232d389ca minor #4425 Rely on reflection to access null properties (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Rely on reflection to access null properties

Benchmark like https://gist.github.com/arnaud-lb/c4235164fb41e11672aa670da8fa4fc7 (which were done for another use case but is still relevant here) prove that using reflection instead of array-casts is significantly faster for accessing properties.

Checking for dynamic properties is done with property_exists.

Commits
-------

5cd1ff1977 Rely on reflection to access null properties
2024-11-07 13:39:46 +01:00
Fabien Potencier a362ee312d Merge branch '3.14.x' into 3.x
* 3.14.x:
  Prepare the 3.14.2 release
  Prepare the 3.11.3 release
  Update CHANGELOG
2024-11-07 13:37:21 +01:00
Fabien Potencier 0b6f9d8370 Prepare the 3.14.2 release v3.14.2 2024-11-07 13:36:22 +01:00
Fabien Potencier fe9e0d00c1 Merge branch '3.11.x' into 3.14.x
* 3.11.x:
  Prepare the 3.11.3 release
  Update CHANGELOG
2024-11-07 13:35:53 +01:00
Fabien Potencier 3b06600ff3 Prepare the 3.11.3 release v3.11.3 2024-11-07 13:34:41 +01:00
Fabien Potencier dbd734a553 Update CHANGELOG 2024-11-07 13:34:21 +01:00
Nicolas Grekas 5cd1ff1977 Rely on reflection to access null properties 2024-11-07 11:23:04 +01:00
Nicolas Grekas d72ae2447e Merge branch '3.14.x' into 3.x
* 3.14.x:
  Improve detection of recursion
  Fix recursion when arrays contain self-references in sandboxed mode
  Fix code
  Prepare the 3.11.2 release
  Update CHANGELOG
  Sandbox ArrayAccess and do sandbox checks before isset() checks
  Fix sandbox handling for __toString()
  Prepare the 3.14.1 release
  Update CHANGELOG
  Sandbox ArrayAccess and do sandbox checks before isset() checks
  Fix sandbox handling for __toString()
  Prepare the 3.11.1 release
  Fix a security issue when an included sandboxed template has been loaded before without the sandbox context
2024-11-07 11:17:57 +01:00
Nicolas Grekas 83a21d31e5 Merge branch '3.11.x' into 3.14.x
* 3.11.x:
  Improve detection of recursion
  Fix recursion when arrays contain self-references in sandboxed mode
  Fix code
  Prepare the 3.11.2 release
  Update CHANGELOG
  Sandbox ArrayAccess and do sandbox checks before isset() checks
  Fix sandbox handling for __toString()
  Prepare the 3.11.1 release
  Fix a security issue when an included sandboxed template has been loaded before without the sandbox context
2024-11-07 11:11:36 +01:00
Nicolas Grekas d3fc074171 Improve detection of recursion 2024-11-07 10:15:07 +01:00
Lee Rowlands a0f775683d Fix recursion when arrays contain self-references in sandboxed mode 2024-11-07 09:42:22 +01:00
Fabien Potencier 32e99c263d Remove obsolete code 2024-11-06 21:45:08 +01:00
Fabien Potencier cf5d4e3bc8 Update CHANGELOG 2024-11-06 21:41:52 +01:00
Nicolas Grekas b957e5a44c Sandbox ArrayAccess and do sandbox checks before isset() checks 2024-11-06 21:41:25 +01:00
Fabien Potencier d4a302681b Fix sandbox handling for __toString() 2024-11-06 21:35:53 +01:00
Fabien Potencier 5b580ec188 Fix code v3.11.2 2024-11-06 19:50:16 +01:00
Fabien Potencier 94612e7602 Prepare the 3.11.2 release 2024-11-06 19:48:59 +01:00
Fabien Potencier 8b5278227b Update CHANGELOG 2024-11-06 19:48:59 +01:00
Nicolas Grekas ec39a9dccc Sandbox ArrayAccess and do sandbox checks before isset() checks 2024-11-06 19:48:59 +01:00
Fabien Potencier cafc608ece Fix sandbox handling for __toString() 2024-11-06 19:27:48 +01:00
Fabien Potencier f405356d20 Prepare the 3.14.1 release v3.14.1 2024-11-06 19:17:38 +01:00
Fabien Potencier 793e8358fb Update CHANGELOG 2024-11-06 19:16:07 +01:00
Nicolas Grekas 831c148e78 Sandbox ArrayAccess and do sandbox checks before isset() checks 2024-11-06 19:16:07 +01:00
Fabien Potencier 2bb8c2460a Fix sandbox handling for __toString() 2024-11-05 17:54:37 +01:00
Ruud Kamphuis c78499bda9 Fix wrong type for cycle position
It also accepts 0, which is not a positive int.
2024-11-04 11:31:38 +01:00
Fabien Potencier 98e7f7141a minor #4432 Fix mistake in docs for keys filter (ruudk)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Fix mistake in docs for `keys` filter

Commits
-------

deb37c30c4 Fix mistake in docs for `keys` filter
2024-11-04 08:50:22 +01:00
Ruud Kamphuis deb37c30c4 Fix mistake in docs for keys filter 2024-11-04 08:50:19 +01:00
Fabien Potencier b99d73c927 Update CHANGELOG 2024-11-03 15:09:58 +01:00
Fabien Potencier 8d3bad4c50 feature #4426 [String] Add SpanishInflector support for singular and plural (dennistobar)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

[String] Add SpanishInflector support for singular and plural

This PR implement a new Inflector using Spanish (ISO Code = es) implemented in this PR symfony/symfony#58228.

* I sort the list of supported Inflectors to follow some rule (alphabet?)
* I just change invalid test from "it" to "qq" (qq doesn't exist as valid ISO code, but it is italian... don't be evil if anyone want to create the italian inflector 😅 )

Commits
-------

290a923a42 [String] Add SpanishInflector support for singular and plural
2024-11-03 15:08:50 +01:00
Dennis Tobar 290a923a42 [String] Add SpanishInflector support for singular and plural 2024-11-03 15:08:48 +01:00
Fabien Potencier e062a17cc5 minor #4430 Add find to Filters docs (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Add `find` to `Filters` docs

https://twig.symfony.com/doc/3.x/filters/index.html
https://twig.symfony.com/doc/3.x/filters/find.html

It's missing or I am blind.

Commits
-------

b4ed19b5e1 Add `find` to `Filters` docs
2024-11-03 15:07:52 +01:00
Ruud Kamphuis b4ed19b5e1 Add find to Filters docs
https://twig.symfony.com/doc/3.x/filters/index.html
https://twig.symfony.com/doc/3.x/filters/find.html
2024-10-31 15:57:00 +01:00
Ruud Kamphuis 226f0ff0dd Add type for join method
Looking at the code, this method is very forgiving in what it accepts.
2024-10-30 15:44:01 +01:00
Fabien Potencier 75751250cc minor #4423 Remove duplicate test case (jdreesen)
This PR was merged into the 3.x branch.

Discussion
----------

Remove duplicate test case

The test cases in line `7` and `9` were the same.

Commits
-------

d59cc8baa5 Remove duplicate test case
2024-10-30 08:17:12 -04:00
Jacob Dreesen d59cc8baa5 Remove duplicate test case 2024-10-28 11:25:54 +01:00
Fabien Potencier 494f010d29 Revert "minor #4411 Add return type to getDebugInfo (ruudk)"
This reverts commit 868b429853, reversing
changes made to b0017ad8c3.
2024-10-25 16:01:04 +02:00
Fabien Potencier 09b4693fdb minor #4420 Add $this return type to Template::unwrap (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Add `$this` return type to Template::unwrap

See https://phpstan.org/writing-php-code/phpdoc-types#static-and-%24this

This way, PHPStan understands that the returned template is the exact same instance, and not just a Template.

Commits
-------

92e4989002 Add `$this` return type to Template::unwrap
2024-10-25 15:58:24 +02:00
Ruud Kamphuis 92e4989002 Add $this return type to Template::unwrap
See https://phpstan.org/writing-php-code/phpdoc-types#static-and-%24this

This way, PHPStan understands that the returned template is the exact same instance, and not just a Template.
2024-10-25 13:19:27 +02:00
Fabien Potencier 55d56c4cb9 minor #4412 Add link to TwigQI in docs "You might also be interested in" section (drjayvee)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add link to TwigQI in docs "You might also be interested in" section

As proposed by Fabien last Thursday at Evolve. Merci beaucoup!

Commits
-------

4a0568521a Add link to TwigQI in docs "You might also be interested in" section
2024-10-25 11:36:55 +02:00
Jeroen Versteeg 4a0568521a Add link to TwigQI in docs "You might also be interested in" section 2024-10-25 11:36:55 +02:00
Fabien Potencier 05550cafb1 minor #4410 Add return type to compiled macro (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Add return type to compiled macro

This makes it easier for TwigStan to analyze the return type.

Commits
-------

1e7c719e24 Add return type to compiled macro
2024-10-25 08:22:06 +02:00
Fabien Potencier 89fdc7d31d Refactor code 2024-10-25 07:47:55 +02:00
Fabien Potencier f3db1d1a0c bug #4413 do not drop none digit characters from generated variable names (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

do not drop none digit characters from generated variable names

I was wondering if it was really intended to cast the var name generated by the compiler to an int as done in #4398. Doesn't this create the risk of variable names being reused at some point?

Commits
-------

5b0209ffa3 do not drop none digit characters from generated variable names
2024-10-24 17:55:22 +02:00
Christian Flothmann 5b0209ffa3 do not drop none digit characters from generated variable names 2024-10-24 17:52:15 +02:00
Fabien Potencier 1d22d300fa Revert "feature #4409 Deprecate the range function (fabpot)"
This reverts commit 99c6fbd517, reversing
changes made to 868b429853.
2024-10-24 15:37:54 +02:00
Fabien Potencier 99c6fbd517 feature #4409 Deprecate the range function (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate the range function

Commits
-------

3d99e595c8 Deprecate the range function
2024-10-24 15:34:03 +02:00
Fabien Potencier 3d99e595c8 Deprecate the range function 2024-10-24 14:02:46 +02:00