-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Removed support for PHP templating everywhere #31800
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
Conversation
@yceruto Some tests are broken with this PR. |
5f88db9
to
07020d0
Compare
Tests are green now. |
|
||
public function __construct(Environment $twig = null, EngineInterface $templating = null) | ||
public function __construct(Environment $twig = null) |
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.
I feel like twig should not be optional in this class. And when twig is not installed, the TemplateController should be removed from DI.
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.
I agree, but for DX point of view it's better as is, because you'll get a good error message:
You can not use the TemplateController if the Twig Bundle is not available.
vs
"Too few arguments to function Symfony\Bundle\FrameworkBundle\Controller\TemplateController::__construct(), 0 passed in ...
WDYT?
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.
I agree it's a little better for DX. But IMO it's not the responsiblity of the Controller do provide that.
We could just catch the instantiation error in
return $this->configureController(parent::instantiateController($class), $class); |
src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
Outdated
Show resolved
Hide resolved
Requires #31821 Status: Needs Work |
Rebase unlocked. |
9686ff3
to
116be1f
Compare
116be1f
to
d5be373
Compare
(Rebased) Status: Needs Review |
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.
Fine for me. https://github.com/symfony/symfony/pull/31800/files#r290086885 can be done in a separate PR.
if (!$this->container->has('twig')) { | ||
throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".'); | ||
throw new \LogicException('You can not use the "renderView" method if the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".'); |
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.
is not available
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.
Thank you @yceruto. |
This PR was merged into the 5.0-dev branch. Discussion ---------- Removed support for PHP templating everywhere | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Ref: #21035 and 7169f4d **TODO:** Missing deprecations in 4.4 (#31800): - [x] `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` 2nd argument. - [x] `Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer` class and service. **Labels:** `FrameworkBundle`, `TwigBundle`, `TwigBridge`, `SecurityBundle`, `Form`, `HttpKernel` Friendly ping @fabpot and @dunglas Commits ------- d5be373 Removed support for PHP templating everywhere
…ion (xabbuh) This PR was merged into the 4.3 branch. Discussion ---------- [FrameworkBundle] deprecate the framework.templating option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #32120 | License | MIT | Doc PR | The config node has already been removed in the `master` branch in #31800. For DX it would have been better to have this deprecation in 4.3 (see e.g. #32120), but it's probably too late to ship this as a bugfix. Commits ------- ba241ce deprecate the framework.templating option
Ref: #21035 and 7169f4d
TODO:
Missing deprecations in 4.4 (#31800):
Symfony\Bundle\FrameworkBundle\Controller\TemplateController
2nd argument.Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer
class and service.Labels:
FrameworkBundle
,TwigBundle
,TwigBridge
,SecurityBundle
,Form
,HttpKernel
Friendly ping @fabpot and @dunglas