Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1330 commits
Select commit Hold shift + click to select a range
d8fe3bd
Add `LastModifiedExtensionInterface` and implementation in `AbstractE…
GromNaN Dec 23, 2024
51bf2ca
Use spl_object_id() instead of spl_object_hash()
rosier Jan 2, 2025
f2f03d7
Fix typos in the docs
fabpot Jan 2, 2025
7742547
minor #4529 Fix typo in the docs (fabpot)
fabpot Jan 3, 2025
d19f56f
minor #4530 Use spl_object_id() instead of spl_object_hash() (rosier)
fabpot Jan 3, 2025
053572e
Fix CS
fabpot Jan 3, 2025
e7ae984
Add a note on the types locality
fabpot Jan 3, 2025
5dd37d8
feature #4513 Add `getLastModified()` to extensions (GromNaN)
fabpot Jan 3, 2025
8689d46
minor #4531 Add a note on the types locality (fabpot)
fabpot Jan 4, 2025
36ff3fa
Remove the note about types mapping argument
fabpot Jan 6, 2025
fb71503
minor #4535 Remove the note about types mapping argument (fabpot)
fabpot Jan 6, 2025
dff6fdd
Make {} optional for the types tag
fabpot Jan 6, 2025
9d1397a
feature #4536 Make {} optional for the types tag (fabpot)
fabpot Jan 10, 2025
8b43275
invoke filter
Dec 26, 2024
f271158
checkArrow, typehints
Dec 30, 2024
edecc13
typehint instead of checkArrow
Jan 7, 2025
d58ac9a
docs and changelog
Jan 7, 2025
09c30c3
fix merge
Jan 7, 2025
2b95bd6
typo
Lorenzschaef Jan 8, 2025
dacbe51
Apply suggestions from code review
Lorenzschaef Jan 9, 2025
c4fd25f
fix indentation
Jan 9, 2025
3e93e91
Finish the work
fabpot Jan 12, 2025
65fa0c6
feature #4518 Add invoke filter (Lorenz, Lorenzschaef, fabpot)
fabpot Jan 12, 2025
a998723
Fix constant() behavior when used with ??
fabpot Jan 14, 2025
6513bc4
bug #4541 Fix constant() behavior when used with ?? (fabpot)
fabpot Jan 14, 2025
76062c8
Fix CS
fabpot Jan 19, 2025
4f3770e
minor #4542 Fix CS (fabpot)
fabpot Jan 19, 2025
1d51805
Ignore static properties when using the dot operator
nicolas-grekas Jan 22, 2025
2b7f280
bug #4548 Ignore static properties when using the dot operator (nicol…
fabpot Jan 22, 2025
498fb5d
Fixing minor typo in Update inline_css.rst
omarius Jan 22, 2025
03f6351
minor #4549 Fixing minor typo in inline_css.rst (omarius)
fabpot Jan 22, 2025
960f676
Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\Expres…
fabpot Jan 22, 2025
82be134
Add return type annotations on Twig 3 to prepare Twig 4
smnandre Jan 5, 2025
72c91f6
minor #4534 Add return type annotations on Twig 3 to prepare Twig 4 (…
fabpot Jan 24, 2025
b6d9dd6
Fix inheritance logic to be able to use instanceof ContextVariable in…
fabpot Jan 23, 2025
ce40c69
feature #4551 Fix inheritance logic to be able to use instanceof Cont…
fabpot Jan 24, 2025
9346640
feature #4550 Deprecate Twig\ExpressionParser::parseOnlyArguments() a…
fabpot Jan 24, 2025
9d16de6
Deprecate passing $ifexpr to ForNode
fabpot Jan 24, 2025
17b35c8
feature #4552 Deprecate passing $ifexpr to ForNode (fabpot)
fabpot Jan 24, 2025
6097675
Add ForElseNode
fabpot Jan 24, 2025
c542deb
feature #4553 Add ForElseNode (fabpot)
fabpot Jan 24, 2025
ade8bce
Deprecate Token::getType()
fabpot Jan 20, 2025
939c032
feature #4554 Deprecate Token::getType() (fabpot)
fabpot Jan 24, 2025
431697f
add missing parentheses to deprecation message
xabbuh Jan 24, 2025
1800707
fix intl-extra tests
xabbuh Jan 24, 2025
d76d2d7
minor #4555 add missing parentheses to deprecation message (xabbuh)
fabpot Jan 24, 2025
b680354
minor #4556 fix intl-extra tests (xabbuh)
fabpot Jan 24, 2025
11535e9
Fix Token::__toString()
fabpot Jan 25, 2025
fcd0332
minor #4557 Fix Token::__toString() (fabpot)
fabpot Jan 25, 2025
f594248
Fix CS
fabpot Jan 26, 2025
48d167a
minor #4558 Fix CS (fabpot)
fabpot Jan 26, 2025
83da53c
Fix typo for html_cva code example
matthieupetel Jan 28, 2025
b638637
minor #4560 Fix typo for html_cva code example (matthieupetel)
fabpot Jan 28, 2025
445f74c
[SECURITY] Fix a security issue where escaping was missing when using ??
fabpot Jan 16, 2025
38576b1
security #cve-2025-24374 [SECURITY] Fix a security issue where escapi…
fabpot Jan 29, 2025
d4f8c2b
Prepare the 3.19.0 release
fabpot Jan 29, 2025
69f8d40
Bump version
fabpot Jan 29, 2025
3b605c4
Add some tests on balanced brackets
fabpot Jan 30, 2025
4b4a630
minor #4562 Add some tests on balanced brackets (fabpot)
fabpot Jan 30, 2025
e48abfe
Add even more tests
fabpot Jan 31, 2025
dc63562
Bump min PHP version to 8.1
fabpot Jan 31, 2025
8438235
feature #4566 Bump min PHP version to 8.1 (fabpot)
fabpot Jan 31, 2025
a5ebdfe
minor #4564 Add even more tests (fabpot)
fabpot Jan 31, 2025
b039999
Fix wrong array index
fabpot Jan 31, 2025
fff5638
bug #4565 Fix wrong array index (fabpot)
fabpot Feb 1, 2025
7f08008
Fix wrong array index
fabpot Feb 1, 2025
3f9974e
bug #4567 Fix wrong array index (fabpot)
fabpot Feb 1, 2025
af5f4c3
Fix CS
fabpot Feb 3, 2025
3288d8d
Reimplement the cache tag in an adhoc way
fabpot Feb 3, 2025
2cc081d
minor #4568 Reimplement the cache tag in an adhoc way (fabpot)
fabpot Feb 3, 2025
fa1ffb5
Add BinaryInterface
fabpot Feb 3, 2025
462eedd
minor #4569 Add BinaryInterface (fabpot)
fabpot Feb 3, 2025
9ccca47
Add UnaryInterface
fabpot Feb 3, 2025
9157c16
minor #4570 Add UnaryInterface (fabpot)
fabpot Feb 3, 2025
198fc1a
Add support for registered undefined element callbacks in tests
stof Feb 4, 2025
8432946
feature #4571 Add support for registered undefined element callbacks …
fabpot Feb 4, 2025
a84e602
Use correct lineno for ForElseNode
ruudk Feb 7, 2025
7f12e87
bug #4572 Use correct lineno for ForElseNode (ruudk)
fabpot Feb 7, 2025
f69531f
Fix timezone conversion on strings
PrinsFrank Jan 20, 2025
fab1a37
bug #4546 Fix timezone conversion on strings (PrinsFrank)
fabpot Feb 7, 2025
3cdf26f
feature #3737 Added configuration for commonmark use in twig-extra-bu…
fabpot Feb 8, 2025
40a2d5b
Add missing CHANGELOG
fabpot Feb 8, 2025
3794efe
Fix support for ignoring syntax erros in an undefined handler in guard
stof Feb 9, 2025
6508e80
bug #4575 Fix support for ignoring syntax erros in an undefined handl…
fabpot Feb 9, 2025
d1737bd
Fix CHANGELOG
fabpot Feb 9, 2025
f1c9039
Fix typo
fabpot Feb 9, 2025
e456a31
Update CHANGELOG
fabpot Feb 13, 2025
3468920
Prepare the 3.20.0 release
fabpot Feb 13, 2025
586e3de
Bump version
fabpot Feb 13, 2025
229f54f
Bump version to 3.21
fabpot Feb 14, 2025
df877a1
Introduce operator classes to describe operators provided by extensio…
fabpot Jan 19, 2025
42c82e1
Extract operators logic from ExpressionParser to their own classes
fabpot Jan 19, 2025
9334a70
Add a script to update operator precedence documentation
fabpot Jan 26, 2025
f67078b
Move Operators to ExpressionParsers, deprecate ExpressionParser
fabpot Feb 3, 2025
0cb5c0e
Add deprecation notices in CHANGELOG and docs
fabpot Jan 26, 2025
8ff1909
Fix precedence rules
fabpot Feb 3, 2025
4b57f48
Use generics in ExpressionParsers
fabpot Feb 6, 2025
561c662
Remove obsolete code
fabpot Feb 14, 2025
251c0b5
Fix CS
fabpot Feb 14, 2025
79d828b
Fix version
fabpot Feb 14, 2025
1ea5ac6
feature #4543 Move operator definitions to objects (fabpot)
fabpot Feb 14, 2025
4695e33
Fix cache-extra impl
fabpot Feb 14, 2025
613d6b9
bug #4579 Fix cache-extra impl (fabpot)
fabpot Feb 14, 2025
d6f539b
Avoid storing expression parser instances in Node attributes
fabpot Feb 14, 2025
20e677b
Fix docs
fabpot Feb 14, 2025
2f31505
minor #4578 Avoid storing expression parser instances in Node attribu…
fabpot Feb 14, 2025
3964aeb
Add a proper prefix spread operator
fabpot Feb 14, 2025
640b382
feature #4580 Add a proper prefix spread operator (fabpot)
fabpot Feb 14, 2025
151aa4e
Fix CS
fabpot Feb 14, 2025
cfeb51b
minor #4581 Fix CS (fabpot)
fabpot Feb 14, 2025
5f6c67f
re-add mixed return type
xabbuh Feb 14, 2025
576b412
minor #4582 re-add mixed return type (xabbuh)
fabpot Feb 14, 2025
a544dc8
fix the rst syntax of the operator precedence table
xabbuh Feb 16, 2025
0f569b8
minor #4584 fix the rst syntax of the operator precedence table (xabbuh)
fabpot Feb 17, 2025
4c81812
fix typo
xabbuh Feb 18, 2025
4effb66
minor #4587 fix typo (xabbuh)
fabpot Feb 18, 2025
9c6b95f
Make `in_array()` calls strict
alexandre-daubois Feb 19, 2025
2d84abf
Make the defined test implementation more generic
fabpot Feb 21, 2025
d10bcad
Simplify Error implementation
fabpot Feb 21, 2025
9b4db2e
minor #4592 Simplify Error implementation (fabpot)
fabpot Feb 21, 2025
9f275f6
feature #4590 Make the defined test implementation more generic (fabpot)
fabpot Feb 21, 2025
d72c1c6
Fix testing and expression when it evaluates to an instance of Markup
fabpot Feb 21, 2025
d187727
feature #4591 Fix testing and expression when it evaluates to an inst…
fabpot Feb 21, 2025
1c6ac16
minor #4589 Make `in_array()` calls strict (alexandre-daubois)
fabpot Feb 21, 2025
d770284
Remove $templateName from Template::loadTemplate()
fabpot Feb 14, 2025
68481a2
Simplify code
fabpot Feb 21, 2025
6a651cc
Simplify Error
smnandre Feb 22, 2025
c43cd3e
minor #4593 Simplify code (fabpot)
fabpot Feb 22, 2025
d13d31b
minor #4594 Simplify Error (smnandre)
fabpot Feb 22, 2025
d5dc3ee
Improve error reporting
fabpot Feb 22, 2025
ad203c7
bug #4583 Remove template source from Template::loadTemplate() (fabpot)
fabpot Feb 22, 2025
7cde13f
bug #4595 Improve error reporting (fabpot)
fabpot Feb 22, 2025
4a121d9
Sync Error file and line
fabpot Feb 26, 2025
02118c7
bug #4598 Sync Error file and line (fabpot)
fabpot Feb 26, 2025
7b43bd0
Fix Error when the trace has Twig file/line information instead of th…
fabpot Feb 26, 2025
33a0819
bug #4599 Fix Error when the trace has Twig file/line information ins…
fabpot Feb 26, 2025
56204e9
Move some tests
fabpot Feb 26, 2025
b6e7097
minor #4600 Move some tests (fabpot)
fabpot Feb 26, 2025
b86fd0a
Remove obsolete files
fabpot Feb 26, 2025
4e1fa3a
Remove obsolete comment
fabpot Feb 26, 2025
53facb7
remove not needed code
xabbuh Feb 27, 2025
96dade3
Improve docs on creating new tags
fabpot Feb 27, 2025
932a584
minor #4601 Improve docs on creating new tags (fabpot)
fabpot Feb 27, 2025
71f83ec
Tweak Sandbox docs
fabpot Feb 28, 2025
da64c42
Add tests
fabpot Feb 28, 2025
719bba9
Simplify code
fabpot Feb 28, 2025
1fee48e
minor #4603 remove not needed code (xabbuh, fabpot)
fabpot Feb 28, 2025
3d760ae
Avoid polluting ModuleNode::toString() with embedded templates
fabpot Feb 28, 2025
c0db761
minor #4604 Avoid polluting ModuleNode::toString() with embedded temp…
fabpot Feb 28, 2025
76b86aa
Add missing @deprecated tag
fabpot Feb 28, 2025
155d0fa
reduce the number of deprecations being triggered
xabbuh Feb 28, 2025
f8b01eb
merge the Nodes and Node sections
xabbuh Feb 28, 2025
74ad2aa
minor #4606 merge the Nodes and Node sections (xabbuh)
fabpot Feb 28, 2025
d6c1112
minor #4605 reduce the number of deprecations being triggered (xabbuh)
fabpot Feb 28, 2025
81c1fcc
Fix `ModuleNode` instanciation when `$embeddedTemplates` is null
alexandre-daubois Feb 28, 2025
4692c36
minor #4607 Fix `ModuleNode` instanciation when `$embeddedTemplates` …
fabpot Feb 28, 2025
e31a6e4
use EmptyNode instead of an Nodes instance without children
xabbuh Feb 28, 2025
ffd5159
minor #4608 use EmptyNode instead of an Nodes instance without childr…
fabpot Mar 1, 2025
ccec90c
Use `:` instead of `=` for named argument in the docs
jdreesen Mar 6, 2025
8440cf4
minor #4610 Use `:` instead of `=` for named argument in the docs (jd…
fabpot Mar 6, 2025
1a46d12
Update html_cva.rst
seb-jean Mar 12, 2025
c325912
fix: deprecated documentation
Garfield-fr Mar 14, 2025
95596ce
minor #4615 fix: deprecated documentation (Garfield-fr)
fabpot Mar 14, 2025
84b0499
[Docs] Replace `=` by `:` in code examples
smnandre Mar 20, 2025
a7c0482
[Doc] Fix `code-block` in html_cva
smnandre Mar 20, 2025
239a060
fix: update extension references in docs to use backticks
smnandre Mar 20, 2025
7b9aee9
minor #4618 fix: update extension references in docs to use backticks…
fabpot Mar 20, 2025
2a17b4f
minor #4617 [Doc] Fix `code-block` in html_cva (smnandre)
fabpot Mar 20, 2025
77a6da9
minor #4616 [Docs] Replace `=` by `:` in code examples (smnandre)
fabpot Mar 20, 2025
09f9a22
Fix wrong array index (again)
fabpot Mar 21, 2025
3c7c97e
bug #4619 Fix wrong array index (again) (fabpot)
fabpot Mar 21, 2025
5886907
Create attributes `AsTwigFilter`, `AsTwigFunction` and `AsTwigTest` t…
GromNaN Nov 25, 2023
8a7d912
feature #3916 Create attributes `AsTwigFilter`, `AsTwigFunction` and …
fabpot Mar 24, 2025
92f7a5e
Update CHANGELOG
andreybolonin Mar 25, 2025
999092d
minor #4621 Update CHANGELOG (andreybolonin)
fabpot Mar 26, 2025
7b2fe7c
minor #4613 Update html_cva.rst (seb-jean)
fabpot Mar 30, 2025
f14f220
Tweaks html_cva docs
fabpot Mar 30, 2025
fde4de9
minor #4626 Tweaks html_cva docs (fabpot)
fabpot Mar 30, 2025
b54a265
Prepare the 3.21.0 release
fabpot May 2, 2025
06eb9ea
Bump version
fabpot May 2, 2025
00d29e6
Fix instantiation
VincentLanglet May 2, 2025
e14a247
Fix warning
VincentLanglet May 2, 2025
4535f12
bug #4633 Fix ExtensionSet usage of BinaryOperatorExpressionParser (V…
fabpot May 2, 2025
a4293d7
Update CHANGELOG
fabpot May 3, 2025
2851238
Prepare the 3.21.1 release
fabpot May 3, 2025
12a40e7
Bump version
fabpot May 3, 2025
bb6382c
Update reduce.rst
AndCycle May 12, 2025
2184db3
Add TwigCsFixer in tools list
smnandre May 15, 2025
b49e1cd
minor #4639 [Docs] Add TwigCsFixer in tools list (smnandre)
fabpot May 16, 2025
057ea92
replace typographic quote with straigt single quote
xabbuh May 17, 2025
993fb09
minor #4640 replace typographic quote with straigt single quote (xabbuh)
fabpot May 18, 2025
9ff927a
minor #4638 Update reduce.rst (AndCycle)
fabpot May 18, 2025
a8aadc3
Update configuration keys + allow extra keys for extensions
doekenorg May 23, 2025
5f2b1ee
feature #4642 [CommonMark] Update configuration keys + allow extra ke…
fabpot May 23, 2025
a26f43a
Update templates.rst: Removing duplication
ThomasLandauer Jun 5, 2025
7dca48a
minor #4645 Update templates.rst: Removing duplication (ThomasLandauer)
fabpot Jun 6, 2025
0b93a1f
Stof suggestion about empty content
VincentLanglet Jun 12, 2025
403bd9d
minor #4649 Coding standard suggestion about empty content (VincentLa…
fabpot Jun 15, 2025
81e66e9
Update LeagueMarkdown.php
xJuvi Jun 17, 2025
b8827b4
Add documentation for use_yield option
hschletz Jul 2, 2025
7f908ba
minor #4660 Add documentation for use_yield option (hschletz)
fabpot Jul 6, 2025
b6a105c
Fix compatibility with Symfony 8
nicolas-grekas Jul 10, 2025
115114b
bug #4665 Fix compatibility with Symfony 8 (nicolas-grekas)
fabpot Jul 11, 2025
823f502
Escaper performance: avoid static variables
gharlan Jul 5, 2025
1680bba
minor #4663 Escaper performance: avoid static variables (gharlan)
fabpot Jul 12, 2025
a1ea8ed
Enable Fabbot as a GHA
nicolas-grekas Jul 28, 2025
85a4817
CS fixes
nicolas-grekas Jul 10, 2025
fec7345
minor #4664 CS fixes (nicolas-grekas)
nicolas-grekas Jul 29, 2025
b1d2a9c
minor #4671 Enable Fabbot as a GHA (nicolas-grekas)
nicolas-grekas Jul 29, 2025
e05e818
bug #4653 Allow usage of other Markdown converters than CommonMark in…
fabpot Aug 2, 2025
8c78952
#4677: Add use statements for classes referenced in the getOperators …
KevinVanSonsbeek Aug 4, 2025
b409348
Fix wrong rounding_mode values
bodendorfer-simplethings Aug 15, 2025
e2858a7
minor #4682 Fix wrong rounding_mode documentation (bodendorfer-simple…
fabpot Aug 17, 2025
9c94bfe
minor #4678 Add missing use statements in ExtensionInterface (KevinVa…
fabpot Aug 17, 2025
806049f
Fix compatibility layer
fabpot Aug 17, 2025
4bf5d2f
bug #4683 Fix compatibility layer (fabpot)
fabpot Aug 17, 2025
d0177b9
Add note to format_datetime explaining how to install required extens…
LucileDT Aug 23, 2025
8832f63
minor #4685 Add note to format_datetime explaining how to install req…
fabpot Aug 25, 2025
62747ce
Avoid errors when failing to guess the template info for an error
stof Sep 2, 2025
98b664a
bug #4688 Avoid errors when failing to guess the template info for an…
fabpot Sep 2, 2025
def4abb
Improve documentation examples for `enum` and `enum_cases`
Kocal Sep 12, 2025
2a52ec2
minor #4690 Improve documentation examples for `enum` and `enum_cases…
fabpot Sep 15, 2025
57a2f85
Bump version
fabpot Sep 15, 2025
30977bd
Support two words test guard
VincentLanglet Sep 5, 2025
32f88a2
feature #4689 Support two words test guard (VincentLanglet)
fabpot Sep 15, 2025
8f97076
Bump minimum Commonmark requirement
fabpot Sep 15, 2025
d6a5a3e
minor #4691 Bump minimum Commonmark requirement (fabpot)
fabpot Sep 15, 2025
41bfb6b
Fix intl test
fabpot Sep 15, 2025
fecc10c
minor #4692 Fix intl test (fabpot)
fabpot Sep 15, 2025
cc12df9
Introduce registerUndefinedTestCallback
VincentLanglet Aug 29, 2025
1d86628
feature #4687 Introduce registerUndefinedTestCallback (VincentLanglet)
fabpot Sep 16, 2025
e4d7915
Compile 'index' with repr (not string) in EmbedNode
smnandre Sep 25, 2025
50327b5
[Doc] Tweaks in the escaping article
javiereguiluz Sep 25, 2025
dac599c
bug #4693 Compile 'index' with repr (not string) in EmbedNode (smnandre)
fabpot Sep 25, 2025
a895a3f
minor #4694 [Doc] Tweaks in the escaping article (javiereguiluz)
fabpot Sep 25, 2025
df3a281
Update replace.rst
cyphix333 Oct 6, 2025
f0cd0fd
minor #4695 Update replace.rst (cyphix333)
fabpot Oct 7, 2025
b9a4e04
Update inky_to_html.rst: Updating link
ThomasLandauer Oct 19, 2025
d26e8f2
minor #4699 Update inky_to_html.rst: Updating link (ThomasLandauer)
fabpot Oct 20, 2025
9ae75d3
Fix accessing arrays with stringable objects as key
nicolas-grekas Oct 24, 2025
9a5887a
bug #4704 Fix accessing arrays with stringable objects as key (nicola…
fabpot Oct 29, 2025
a5487c8
Update CHANGELOG
fabpot Oct 29, 2025
4509984
Prepare the 3.22.0 release
fabpot Oct 29, 2025
f663cc3
Bump version
fabpot Oct 29, 2025
64c87ee
Fix array typehint for $variants in HtmlExtension
yoeunes Oct 30, 2025
80fa13c
minor #4707 Fix array typehint for $variants in HtmlExtension (yoeunes)
fabpot Oct 30, 2025
9a8a1dc
Allow Symfony 8 packages in Twig extra packages
javiereguiluz Nov 2, 2025
94a3635
minor #4708 Allow Symfony 8 packages in Twig extra packages (javiereg…
fabpot Nov 2, 2025
02c5a4b
Add caution note for random function usage
xelan Nov 4, 2025
2996f0b
minor #4709 Add caution note for random function usage (xelan)
fabpot Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/.github/ export-ignore
/bin/ export-ignore
/doc/ export-ignore
/extra/ export-ignore
/tests/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpunit.xml.dist export-ignore
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
157 changes: 94 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: "CI"
on:
pull_request:
push:
branches:
- '3.x'

env:
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1
Expand All @@ -18,21 +16,17 @@ jobs:

runs-on: 'ubuntu-latest'

continue-on-error: ${{ matrix.experimental }}

strategy:
matrix:
php-version:
- '7.2.5'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
experimental: [false]
- '8.2'
- '8.3'
- '8.4'

steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
Expand All @@ -46,6 +40,11 @@ jobs:

- run: composer install

- name: "Switch use_yield to true on PHP ${{ matrix.php-version }}"
if: "matrix.php-version == '8.2'"
run: |
sed -i -e "s/'use_yield' => false/'use_yield' => true/" src/Environment.php

- name: "Install PHPUnit"
run: vendor/bin/simple-phpunit install

Expand All @@ -59,7 +58,7 @@ jobs:
needs:
- 'tests'

name: "${{ matrix.extension }} with PHP ${{ matrix.php-version }}"
name: "${{ matrix.extension }} PHP ${{ matrix.php-version }}"

runs-on: 'ubuntu-latest'

Expand All @@ -68,25 +67,23 @@ jobs:
strategy:
matrix:
php-version:
- '7.2.5'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
extension:
- 'extra/cache-extra'
- 'extra/cssinliner-extra'
- 'extra/html-extra'
- 'extra/inky-extra'
- 'extra/intl-extra'
- 'extra/markdown-extra'
- 'extra/string-extra'
- 'extra/twig-extra-bundle'
experimental: [false]
- 'cache-extra'
- 'cssinliner-extra'
- 'html-extra'
- 'inky-extra'
- 'intl-extra'
- 'markdown-extra'
- 'string-extra'
- 'twig-extra-bundle'

steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
Expand All @@ -98,52 +95,86 @@ jobs:
- name: "Add PHPUnit matcher"
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- run: composer install
- name: "Composer install Twig"
run: composer install

- name: "Install PHPUnit"
run: vendor/bin/simple-phpunit install

- name: "PHPUnit version"
run: vendor/bin/simple-phpunit --version

- name: "Composer install"
working-directory: ${{ matrix.extension}}
- name: "Prevent installing symfony/translation-contract 3.0"
if: "matrix.extension == 'twig-extra-bundle'"
working-directory: extra/${{ matrix.extension }}
run: "composer require --no-update 'symfony/translation-contracts:^1.1|^2.0'"

- name: "Composer install ${{ matrix.extension }}"
working-directory: extra/${{ matrix.extension }}
run: composer install

- name: "Run tests"
working-directory: ${{ matrix.extension}}
- name: "Switch use_yield to true"
if: "matrix.php-version == '8.2'"
run: |
sed -i -e "s/'use_yield' => false/'use_yield' => true/" extra/${{ matrix.extension }}/vendor/twig/twig/src/Environment.php

- name: "Run tests for ${{ matrix.extension }}"
working-directory: extra/${{ matrix.extension }}
run: ../../vendor/bin/simple-phpunit

#
# Drupal does not support Twig 3 now!
#
# integration-tests:
# needs:
# - 'tests'
#
# name: "Integration tests with PHP ${{ matrix.php-version }}"
#
# runs-on: 'ubuntu-20.04'
#
# continue-on-error: true
#
# strategy:
# matrix:
# php-version:
# - '7.3'
#
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v2
#
# - name: "Install PHP with extensions"
# uses: shivammathur/setup-php@2
# with:
# coverage: "none"
# extensions: "gd, pdo_sqlite"
# php-version: ${{ matrix.php-version }}
# ini-values: memory_limit=-1
# tools: composer:v2
#
# - run: bash ./tests/drupal_test.sh
# shell: "bash"
integration-tests:
needs:
- 'tests'

name: "Integration tests with PHP ${{ matrix.php-version }}"

runs-on: 'ubuntu-latest'

continue-on-error: true

strategy:
matrix:
php-version:
- '8.2'

steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "gd, pdo_sqlite, uuid"
php-version: ${{ matrix.php-version }}
ini-values: memory_limit=-1
tools: composer:v2

- run: bash ./tests/drupal_test.sh
shell: "bash"

phpstan:
name: "PHPStan"

runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version:
- '8.4'

steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: ${{ matrix.php-version }}
ini-values: memory_limit=-1

- run: composer install

- name: "Run tests"
run: vendor/bin/phpstan
13 changes: 5 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: "Documentation"
on:
pull_request:
push:
branches:
- '2.x'
- '3.x'

permissions:
contents: read
Expand All @@ -18,22 +15,22 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Set-up PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none
tools: "composer:v2"

- name: Get composer cache directory
id: composercache
working-directory: doc/_build
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -54,7 +51,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/fabbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CS

on:
pull_request:

permissions:
contents: read

jobs:
call-fabbot:
name: Fabbot
uses: symfony-tools/fabbot/.github/workflows/fabbot.yml@main
with:
package: Twig
11 changes: 10 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
'heredoc_to_nowdoc' => false,
'ordered_imports' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'],
'header_comment' => [
'header' => <<<EOF
This file is part of Twig.

(c) Fabien Potencier

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF
],
])
->setRiskyAllowed(true)
->setFinder((new PhpCsFixer\Finder())->in(__DIR__))
Expand Down
Loading