14 Commits

Author SHA1 Message Date
Fabien Potencier 16a7e4ec0d Merge branch '3.x' into 4.x
* 3.x:
  Document how to customize the markdown_to_html converter
  Make the include() function return a Markup object
  Fix nested block() resolution when a directly rendered block calls parent()
  Fix nested block() resolution when a directly rendered block calls parent()
  Document storing an enum in a variable to avoid repeating its FQCN
  Stop reporting a skipped test in IntegrationTestCase when there is no legacy test to run
  Document {#--#} as the replacement for the deprecated spaceless filter
  Skip the string cast in PrintNode when the expression is already a string and add tests
  Ensure PrintNode is yielding string content
  CoreExtension::getAttribute: small improvement regarding getter/isser/hasser

# Conflicts:
#	CHANGELOG
#	tests/Node/ForTest.php
2026-06-06 08:48:52 +02:00
Fabien Potencier e1178abfa1 Document storing an enum in a variable to avoid repeating its FQCN 2026-06-03 21:58:29 +02:00
Fabien Potencier 280960d9e1 Merge branch '3.x' into 4.x
* 3.x:
  Fix documentation for getOperators()
  bump version
  Enhance enum.rst with dynamic case example
  Add === and !== operators
  Update extends.rst
  Fix spread operator behavior
2026-01-17 10:24:43 +01:00
Hugo Alliaume bcc5ffc301 Enhance enum.rst with dynamic case example 2026-01-14 22:26:11 +01:00
Fabien Potencier b03de9de05 Merge branch '3.x' into 4.x
* 3.x:
  Update CHANGELOG
  Fix accessing arrays with stringable objects as key
  Update inky_to_html.rst: Updating link
  Update replace.rst
  [Doc] Tweaks in the escaping article
  Compile 'index' with repr (not string) in EmbedNode
  Introduce registerUndefinedTestCallback
  Fix intl test
  Bump minimum Commonmark requirement
  Support two words test guard
  Bump version
  Improve documentation examples for `enum` and `enum_cases`
  Avoid errors when failing to guess the template info for an error
  Add note to format_datetime explaining how to install required extensions
  Fix compatibility layer
2025-10-29 11:55:46 -04:00
Hugo Alliaume def4abbd5e Improve documentation examples for enum and enum_cases
It may be obvious, but I first thought initializing an BackendEnum with a certain value could be possible with `enum(FQCN, value)`, but it does not, it always returns the first case  instance (if exists).

Instead, `enum(FQCN).from(value)` must be used, I think it's worth to improve `enum()` examples.
2025-09-12 18:14:50 +02:00
Fabien Potencier ef7ade8ee3 Merge branch '3.x' into 4.x
* 3.x: (30 commits)
  Make {} optional for the types tag
  Remove the note about types mapping argument
  Add a note on the types locality
  Fix CS
  Fix typos in the docs
  Use spl_object_id() instead of spl_object_hash()
  Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
  Bump version
  Optimize NameExpression compilation
  Fix typo in enum twig doc functions
  Remove dead method in ModuleNode
  Bump version
  Prepare the 3.18.0 release
  Add support for `Twig\Markup`
  Fix unary operator precedence change
  Replace Twigfiddle by the new Twig playground
  Fix MacroNode $name argument can be overridden
  Ignore exceptions from undefined handlers when using the guard tag
  [Doc] Update the docs about attribute() function
  Fix doc
  ...
2025-01-10 08:41:31 +01:00
Baptiste 3889bc7b18 Fix typo in enum twig doc functions 2025-01-02 09:42:18 +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
Ruud Kamphuis 7556fe1c6f Simplify enum usage in docs 2024-11-21 09:11:11 +01:00
Fabien Potencier 14216a8d68 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate using the not unary operator without parenthesis
  Deprecate using ?? without explicit parentheses
  Add support for logical `xor` operator
  Allow running CI on all branches
  [Doc] Fix enum title
  Document Twig vs PHP types
2024-10-02 14:19:28 +02:00
nicolas-joubert f16382ba91 [Doc] Fix enum title
Copy/Paste fix from enum_case documentation page
2024-09-30 23:05:34 +02:00
Fabien Potencier 741b79b6c2 Remove versionadded in docs 2024-09-27 08:29:00 +02:00
Nicolas Grekas cff6f1ca80 Implement the enum function 2024-09-27 08:23:21 +02:00