-
Notifications
You must be signed in to change notification settings - Fork 93
feat: drop twig 2 #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
feat: drop twig 2 #513
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,11 @@ | |
use Twig\Environment; | ||
use Twig\Node\Expression\ArrayExpression; | ||
use Twig\Node\Expression\Binary\EqualBinary; | ||
use Twig\Node\Expression\ConditionalExpression; | ||
use Twig\Node\Expression\ConstantExpression; | ||
use Twig\Node\Expression\FilterExpression; | ||
use Twig\Node\Expression\Ternary\ConditionalTernary; | ||
use Twig\Node\Node; | ||
use Twig\NodeVisitor\AbstractNodeVisitor; | ||
use Twig\NodeVisitor\NodeVisitorInterface; | ||
|
||
/** | ||
* Applies the value of the "desc" filter if the "trans" filter has no | ||
|
@@ -29,7 +29,7 @@ | |
* | ||
* @author Johannes M. Schmitt <[email protected]> | ||
*/ | ||
final class DefaultApplyingNodeVisitor extends AbstractNodeVisitor | ||
final class DefaultApplyingNodeVisitor implements NodeVisitorInterface | ||
{ | ||
/** | ||
* @var bool | ||
|
@@ -41,7 +41,7 @@ public function setEnabled(bool $bool): void | |
$this->enabled = $bool; | ||
} | ||
|
||
public function doEnterNode(Node $node, Environment $env): Node | ||
public function enterNode(Node $node, Environment $env): Node | ||
{ | ||
if (!$this->enabled) { | ||
return $node; | ||
|
@@ -103,7 +103,7 @@ public function doEnterNode(Node $node, Environment $env): Node | |
); | ||
} | ||
|
||
$condition = new ConditionalExpression( | ||
$condition = new ConditionalTernary( | ||
new EqualBinary($testNode, $transNode->getNode('node'), $wrappingNode->getTemplateLine()), | ||
$defaultNode, | ||
clone $wrappingNode, | ||
|
@@ -114,7 +114,7 @@ public function doEnterNode(Node $node, Environment $env): Node | |
return $node; | ||
} | ||
|
||
public function doLeaveNode(Node $node, Environment $env): Node | ||
public function leaveNode(Node $node, Environment $env): Node | ||
{ | ||
return $node; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just dropped v2, I think it would be cool to keep the min available version of v3 for a while, WDYT? Or do we use something new that is available since 3.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that
3.12
mostly adds a lot of deprecations in preparation of4.x
: https://github.com/twigphp/Twig/blob/3.x/CHANGELOG#L71There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the
twig_callable
was added with twig 3.12 twigphp/Twig@3156d80So to fix the mass deprecations we must set the minimum to 3.12