8000 [Templating] added more deprecation · symfony/symfony@7169f4d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7169f4d

Browse files
committed
[Templating] added more deprecation
1 parent 224c891 commit 7169f4d

File tree

13 files changed

+51
-42
lines changed

13 files changed

+51
-42
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder;
3333
use Symfony\Component\Security\Core\User\UserProviderInterface;
3434
use Symfony\Component\Security\Http\Controller\UserValueResolver;
35+
use Symfony\Component\Templating\PhpEngine;
3536

3637
/**
3738
* SecurityExtension.
@@ -97,7 +98,9 @@ public function load(array $configs, ContainerBuilder $container)
9798
$loader->load('security.xml');
9899
$loader->load('security_listeners.xml');
99100
$loader->load('security_rememberme.xml');
100-
$loader->load('templating_php.xml');
101+
if (class_exists(PhpEngine::class)) {
102+
$loader->load('templating_php.xml');
103+
}
101104
$loader->load('templating_twig.xml');
102105
$loader->load('collectors.xml');
103106
$loader->load('guard.xml');

src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
<service id="templating.helper.logout_url" class="Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper">
1111
<tag name="templating.helper" alias="logout_url" />
1212
<argument type="service" id="security.logout_url_generator" />
13+
14+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.3 and will be removed in 5.0.</deprecated>
1315
</service>
1416

1517
<service id="templating.helper.security" class="Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper">
1618
<tag name="templating.helper" alias="security" />
1719
<argument type="service" id="security.authorization_checker" on-invalid="ignore" />
20+
21+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.3 and will be removed in 5.0.</deprecated>
1822
</service>
1923
</services>
2024
</container>

src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Templating\Helper;
1313

14+
@trigger_error('The '.LogoutUrlHelper::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
1517
use Symfony\Component\Templating\Helper\Helper;
1618

1719
/**
1820
* LogoutUrlHelper provides generator functions for the logout URL.
1921
*
2022
* @author Jeremy Mikola <jmikola@gmail.com>
23+
*
24+
* @deprecated since version 4.3, to be removed in 5.0; use Twig instead.
2125
*/
2226
class LogoutUrlHelper extends Helper
2327
{

src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Templating\Helper;
1313

14+
@trigger_error('The '.SecurityHelper::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Security\Acl\Voter\FieldVote;
1517
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1618
use Symfony\Component\Templating\Helper\Helper;
@@ -19,6 +21,8 @@
1921
* SecurityHelper provides read-only access to the security checker.
2022
*
2123
* @author Fabien Potencier <fabien@symfony.com>
24+
*
25+
* @deprecated since version 4.3, to be removed in 5.0; use Twig instead.
2226
*/
2327
class SecurityHelper extends Helper
2428
{

src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\Loader;
1313

14+
@trigger_error('The '.FilesystemLoader::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig notation for templates instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Config\FileLocatorInterface;
1517
use Symfony\Component\Templating\TemplateNameParserInterface;
1618
use Symfony\Component\Templating\TemplateReferenceInterface;
@@ -22,6 +24,8 @@
2224
* to work with the Symfony paths and template references.
2325
*
2426
* @author Fabien Potencier <fabien@symfony.com>
27+
*
28+
* @deprecated since version 4.3, to be removed in 5.0; use Twig notation for templates instead.
2529
*/
2630
class FilesystemLoader extends BaseFilesystemLoader
2731
{

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ public function stopwatchExtensionAvailabilityProvider()
280280
];
281281
}
282282

283+
/**
284+
* @group legacy
285+
*/
283286
public function testRuntimeLoader()
284287
{
285288
$container = $this->createContainer();

src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Templating;
1313

14+
@trigger_error('The '.TemplatingExtension::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper;
1517
use Symfony\Component\Form\AbstractExtension;
1618
use Symfony\Component\Form\FormRenderer;
@@ -21,6 +23,8 @@
2123
* Integrates the Templating component with the Form library.
2224
*
2325
* @author Bernhard Schussek <bschussek@gmail.com>
26+
*
27+
* @deprecated since version 4.3, to be removed in 5.0; use Twig instead.
2428
*/
2529
class TemplatingExtension extends AbstractExtension
2630
{

src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111

1212
namespace Symfony\Component\Form\Extension\Templating;
1313

14+
@trigger_error('The '.TemplatingRendererEngine::class.' class is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\AbstractRendererEngine;
1517
use Symfony\Component\Form\FormView;
1618
use Symfony\Component\Templating\EngineInterface;
1719

1820
/**
1921
* @author Bernhard Schussek <bschussek@gmail.com>
22+
*
23+
* @deprecated since version 4.3, to be removed in 5.0; use Twig instead.
2024
*/
2125
class TemplatingRendererEngine extends AbstractRendererEngine
2226
{

src/Symfony/Component/Form/Forms.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,6 @@
6060
* ->addExtension(new ValidatorExtension($validator))
6161
* ->getFormFactory();
6262
*
63-
* Support for the Templating component is provided by TemplatingExtension.
64-
* This extension needs a PhpEngine object for rendering forms. As second
65-
* argument you should pass the names of the default themes. Here is an
66-
* example for using the default layout with "<div>" tags:
67-
*
68-
* use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
69-
*
70-
* $formFactory = Forms::createFormFactoryBuilder()
71-
* ->addExtension(new TemplatingExtension($engine, null, [
72-
* 'FrameworkBundle:Form',
73-
* ]))
74-
* ->getFormFactory();
75-
*
76-
* The next example shows how to include the "<table>" layout:
77-
*
78-
* use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
79-
*
80-
* $formFactory = Forms::createFormFactoryBuilder()
81-
* ->addExtension(new TemplatingExtension($engine, null, [
82-
* 'FrameworkBundle:Form',
83-
* 'FrameworkBundle:FormTable',
84-
* ]))
85-
* ->getFormFactory();
86-
*
8763
* @author Bernhard Schussek <bschussek@gmail.com>
8864
*/
8965
final class Forms

src/Symfony/Component/Form/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
"suggest": {
4949
"symfony/validator": "For form validation.",
5050
"symfony/security-csrf": "For protecting forms against CSRF attacks.",
51-
"symfony/twig-bridge": "For templating with Twig.",
52-
"symfony/framework-bundle": "For templating with PHP."
51+
"symfony/twig-bridge": "For templating with Twig."
5352
},
5453
"autoload": {
5554
"psr-4": { "Symfony\\Component\\Form\\": "" },

0 commit comments

Comments
 (0)
0