diff --git a/UPGRADE-6.4.md b/UPGRADE-6.4.md index de9921cfa28d6..69530cdc44022 100644 --- a/UPGRADE-6.4.md +++ b/UPGRADE-6.4.md @@ -80,6 +80,11 @@ Serializer * Deprecate Doctrine annotations support in favor of native attributes * Deprecate passing an annotation reader to the constructor of `AnnotationLoader` +Templating +---------- + + * The component is deprecated and will be removed in 7.0. Use Twig instead. + Validator --------- diff --git a/src/Symfony/Component/Templating/CHANGELOG.md b/src/Symfony/Component/Templating/CHANGELOG.md index c627e669f25d6..3cd7923846f3d 100644 --- a/src/Symfony/Component/Templating/CHANGELOG.md +++ b/src/Symfony/Component/Templating/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.4 +--- + +* Deprecate the component, use Twig instead + 2.5.0 ----- diff --git a/src/Symfony/Component/Templating/DelegatingEngine.php b/src/Symfony/Component/Templating/DelegatingEngine.php index bbe500549aa28..8c3b783a97c15 100644 --- a/src/Symfony/Component/Templating/DelegatingEngine.php +++ b/src/Symfony/Component/Templating/DelegatingEngine.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', DelegatingEngine::class); + /** * DelegatingEngine selects an engine for a given template. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class DelegatingEngine implements EngineInterface, StreamingEngineInterface { diff --git a/src/Symfony/Component/Templating/EngineInterface.php b/src/Symfony/Component/Templating/EngineInterface.php index bfa0b8bb5e1d9..a743100504d29 100644 --- a/src/Symfony/Component/Templating/EngineInterface.php +++ b/src/Symfony/Component/Templating/EngineInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', EngineInterface::class); + /** * EngineInterface is the interface each engine must implement. * @@ -27,6 +29,8 @@ * the template. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ interface EngineInterface { diff --git a/src/Symfony/Component/Templating/Helper/Helper.php b/src/Symfony/Component/Templating/Helper/Helper.php index 537e8e584ce02..66f7a01a9bad4 100644 --- a/src/Symfony/Component/Templating/Helper/Helper.php +++ b/src/Symfony/Component/Templating/Helper/Helper.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Templating\Helper; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', Helper::class); + /** * Helper is the base class for all helper classes. * @@ -18,6 +20,8 @@ * class that exposes a read-only interface for templates. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ abstract class Helper implements HelperInterface { diff --git a/src/Symfony/Component/Templating/Helper/HelperInterface.php b/src/Symfony/Component/Templating/Helper/HelperInterface.php index 8377f1446734a..f0ed54bc57d46 100644 --- a/src/Symfony/Component/Templating/Helper/HelperInterface.php +++ b/src/Symfony/Component/Templating/Helper/HelperInterface.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating\Helper; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', HelperInterface::class); + /** * HelperInterface is the interface all helpers must implement. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ interface HelperInterface { diff --git a/src/Symfony/Component/Templating/Helper/SlotsHelper.php b/src/Symfony/Component/Templating/Helper/SlotsHelper.php index 358e5fc071222..3781ac1158c85 100644 --- a/src/Symfony/Component/Templating/Helper/SlotsHelper.php +++ b/src/Symfony/Component/Templating/Helper/SlotsHelper.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating\Helper; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', SlotsHelper::class); + /** * SlotsHelper manages template slots. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class SlotsHelper extends Helper { diff --git a/src/Symfony/Component/Templating/Loader/CacheLoader.php b/src/Symfony/Component/Templating/Loader/CacheLoader.php index c3b4613ed3d06..795024a79f723 100644 --- a/src/Symfony/Component/Templating/Loader/CacheLoader.php +++ b/src/Symfony/Component/Templating/Loader/CacheLoader.php @@ -15,6 +15,8 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', CacheLoader::class); + /** * CacheLoader is a loader that caches other loaders responses * on the filesystem. @@ -23,6 +25,8 @@ * All other mechanism would imply the use of `eval()`. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class CacheLoader extends Loader { diff --git a/src/Symfony/Component/Templating/Loader/ChainLoader.php b/src/Symfony/Component/Templating/Loader/ChainLoader.php index 936a75630b845..3520198cab513 100644 --- a/src/Symfony/Component/Templating/Loader/ChainLoader.php +++ b/src/Symfony/Component/Templating/Loader/ChainLoader.php @@ -14,10 +14,14 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', ChainLoader::class); + /** * ChainLoader is a loader that calls other loaders to load templates. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class ChainLoader extends Loader { diff --git a/src/Symfony/Component/Templating/Loader/FilesystemLoader.php b/src/Symfony/Component/Templating/Loader/FilesystemLoader.php index 6c06ed85c2a9e..6499e3040e3d0 100644 --- a/src/Symfony/Component/Templating/Loader/FilesystemLoader.php +++ b/src/Symfony/Component/Templating/Loader/FilesystemLoader.php @@ -15,10 +15,14 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', FilesystemLoader::class); + /** * FilesystemLoader is a loader that read templates from the filesystem. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class FilesystemLoader extends Loader { diff --git a/src/Symfony/Component/Templating/Loader/Loader.php b/src/Symfony/Component/Templating/Loader/Loader.php index 6df5cf2124d5b..42058cc87c9ed 100644 --- a/src/Symfony/Component/Templating/Loader/Loader.php +++ b/src/Symfony/Component/Templating/Loader/Loader.php @@ -13,10 +13,14 @@ use Psr\Log\LoggerInterface; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', Loader::class); + /** * Loader is the base class for all template loader classes. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ abstract class Loader implements LoaderInterface { diff --git a/src/Symfony/Component/Templating/Loader/LoaderInterface.php b/src/Symfony/Component/Templating/Loader/LoaderInterface.php index 531a1dff13818..2f7f670bf4ab2 100644 --- a/src/Symfony/Component/Templating/Loader/LoaderInterface.php +++ b/src/Symfony/Component/Templating/Loader/LoaderInterface.php @@ -14,10 +14,14 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', LoaderInterface::class); + /** * LoaderInterface is the interface all loaders must implement. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ interface LoaderInterface { diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index 0b158be9f2c34..3f437756b7bf2 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -17,12 +17,16 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\Storage\StringStorage; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', PhpEngine::class); + /** * PhpEngine is an engine able to render PHP templates. * * @implements \ArrayAccess * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class PhpEngine implements EngineInterface, \ArrayAccess { diff --git a/src/Symfony/Component/Templating/Storage/FileStorage.php b/src/Symfony/Component/Templating/Storage/FileStorage.php index 2ed61dbd17120..886a97e696b25 100644 --- a/src/Symfony/Component/Templating/Storage/FileStorage.php +++ b/src/Symfony/Component/Templating/Storage/FileStorage.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating\Storage; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', FileStorage::class); + /** * FileStorage represents a template stored on the filesystem. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class FileStorage extends Storage { diff --git a/src/Symfony/Component/Templating/Storage/Storage.php b/src/Symfony/Component/Templating/Storage/Storage.php index f17d24e877ad0..0a4505d35fff4 100644 --- a/src/Symfony/Component/Templating/Storage/Storage.php +++ b/src/Symfony/Component/Templating/Storage/Storage.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating\Storage; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', Storage::class); + /** * Storage is the base class for all storage classes. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ abstract class Storage { diff --git a/src/Symfony/Component/Templating/Storage/StringStorage.php b/src/Symfony/Component/Templating/Storage/StringStorage.php index be3a2a4f7ebf5..91537b334c281 100644 --- a/src/Symfony/Component/Templating/Storage/StringStorage.php +++ b/src/Symfony/Component/Templating/Storage/StringStorage.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating\Storage; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', StringStorage::class); + /** * StringStorage represents a template stored in a string. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class StringStorage extends Storage { diff --git a/src/Symfony/Component/Templating/StreamingEngineInterface.php b/src/Symfony/Component/Templating/StreamingEngineInterface.php index 539bcbce14ff1..8319f90c39152 100644 --- a/src/Symfony/Component/Templating/StreamingEngineInterface.php +++ b/src/Symfony/Component/Templating/StreamingEngineInterface.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', StreamingEngineInterface::class); + /** * StreamingEngineInterface provides a method that knows how to stream a template. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ interface StreamingEngineInterface { diff --git a/src/Symfony/Component/Templating/TemplateNameParser.php b/src/Symfony/Component/Templating/TemplateNameParser.php index dd68e4099181e..30e91fee6967d 100644 --- a/src/Symfony/Component/Templating/TemplateNameParser.php +++ b/src/Symfony/Component/Templating/TemplateNameParser.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', TemplateNameParser::class); + /** * TemplateNameParser is the default implementation of TemplateNameParserInterface. * @@ -18,6 +20,8 @@ * and the extension for the engine. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ class TemplateNameParser implements TemplateNameParserInterface { diff --git a/src/Symfony/Component/Templating/TemplateNameParserInterface.php b/src/Symfony/Component/Templating/TemplateNameParserInterface.php index f688c60dd70bd..b902716b1f247 100644 --- a/src/Symfony/Component/Templating/TemplateNameParserInterface.php +++ b/src/Symfony/Component/Templating/TemplateNameParserInterface.php @@ -11,11 +11,15 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', TemplateNameParserInterface::class); + /** * TemplateNameParserInterface converts template names to TemplateReferenceInterface * instances. * * @author Fabien Potencier + * + * @deprecated since Symfony 6.4, use Twig instead */ interface TemplateNameParserInterface { diff --git a/src/Symfony/Component/Templating/TemplateReference.php b/src/Symfony/Component/Templating/TemplateReference.php index e42f49a55460a..ff4ea7f2c8904 100644 --- a/src/Symfony/Component/Templating/TemplateReference.php +++ b/src/Symfony/Component/Templating/TemplateReference.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', TemplateReference::class); + /** * Internal representation of a template. * * @author Victor Berchet + * + * @deprecated since Symfony 6.4, use Twig instead */ class TemplateReference implements TemplateReferenceInterface { diff --git a/src/Symfony/Component/Templating/TemplateReferenceInterface.php b/src/Symfony/Component/Templating/TemplateReferenceInterface.php index f9fe8e16c47dd..c4ffa3ad78d3c 100644 --- a/src/Symfony/Component/Templating/TemplateReferenceInterface.php +++ b/src/Symfony/Component/Templating/TemplateReferenceInterface.php @@ -11,10 +11,14 @@ namespace Symfony\Component\Templating; +trigger_deprecation('symfony/templating', '6.4', '"%s" is deprecated since version 6.4 and will be removed in 7.0. Use Twig instead.', TemplateReferenceInterface::class); + /** * Interface to be implemented by all templates. * * @author Victor Berchet + * + * @deprecated since Symfony 6.4, use Twig instead */ interface TemplateReferenceInterface { diff --git a/src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php b/src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php index 112aff3537afa..f5e07445df962 100644 --- a/src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php +++ b/src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php @@ -16,6 +16,9 @@ use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\StreamingEngineInterface; +/** + * @group legacy + */ class DelegatingEngineTest extends TestCase { public function testRenderDelegatesToSupportedEngine() diff --git a/src/Symfony/Component/Templating/Tests/Helper/HelperTest.php b/src/Symfony/Component/Templating/Tests/Helper/HelperTest.php index e60ffc5e82619..a779cfc694fd9 100644 --- a/src/Symfony/Component/Templating/Tests/Helper/HelperTest.php +++ b/src/Symfony/Component/Templating/Tests/Helper/HelperTest.php @@ -14,6 +14,9 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Templating\Helper\Helper; +/** + * @group legacy + */ class HelperTest extends TestCase { public function testGetSetCharset() diff --git a/src/Symfony/Component/Templating/Tests/Helper/SlotsHelperTest.php b/src/Symfony/Component/Templating/Tests/Helper/SlotsHelperTest.php index ad4e8ecfe23ff..92a584e1919e8 100644 --- a/src/Symfony/Component/Templating/Tests/Helper/SlotsHelperTest.php +++ b/src/Symfony/Component/Templating/Tests/Helper/SlotsHelperTest.php @@ -14,6 +14,9 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Templating\Helper\SlotsHelper; +/** + * @group legacy + */ class SlotsHelperTest extends TestCase { public function testHasGetSet() diff --git a/src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php index da2dfc35417f6..0c1397eeefdc3 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php @@ -20,6 +20,9 @@ use Symfony\Component\Templating\TemplateReference; use Symfony\Component\Templating\TemplateReferenceInterface; +/** + * @group legacy + */ class CacheLoaderTest extends TestCase { public function testConstructor() diff --git a/src/Symfony/Component/Templating/Tests/Loader/ChainLoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/ChainLoaderTest.php index f9b4df2fa3bd1..008fddf2c13fd 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/ChainLoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/ChainLoaderTest.php @@ -16,6 +16,9 @@ use Symfony\Component\Templating\Loader\FilesystemLoader; use Symfony\Component\Templating\TemplateReference; +/** + * @group legacy + */ class ChainLoaderTest extends TestCase { protected FilesystemLoader $loader1; diff --git a/src/Symfony/Component/Templating/Tests/Loader/FilesystemLoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/FilesystemLoaderTest.php index 83cc32cb3bac9..4905cc7d17ece 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/FilesystemLoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/FilesystemLoaderTest.php @@ -17,6 +17,9 @@ use Symfony\Component\Templating\Storage\FileStorage; use Symfony\Component\Templating\TemplateReference; +/** + * @group legacy + */ class FilesystemLoaderTest extends TestCase { protected static string $fixturesPath; diff --git a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php index dc609b1742fa8..5e3ffd2d12570 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php @@ -17,6 +17,9 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\TemplateReferenceInterface; +/** + * @group legacy + */ class LoaderTest extends TestCase { public function testGetSetLogger() diff --git a/src/Symfony/Component/Templating/Tests/PhpEngineTest.php b/src/Symfony/Component/Templating/Tests/PhpEngineTest.php index a5cbdaa968135..3819326385eed 100644 --- a/src/Symfony/Component/Templating/Tests/PhpEngineTest.php +++ b/src/Symfony/Component/Templating/Tests/PhpEngineTest.php @@ -22,6 +22,9 @@ use Symfony\Component\Templating\TemplateReference; use Symfony\Component\Templating\TemplateReferenceInterface; +/** + * @group legacy + */ class PhpEngineTest extends TestCase { protected ProjectTemplateLoader $loader; diff --git a/src/Symfony/Component/Templating/Tests/Storage/FileStorageTest.php b/src/Symfony/Component/Templating/Tests/Storage/FileStorageTest.php index 043967e3a4392..8ea3c5e175ac0 100644 --- a/src/Symfony/Component/Templating/Tests/Storage/FileStorageTest.php +++ b/src/Symfony/Component/Templating/Tests/Storage/FileStorageTest.php @@ -15,6 +15,9 @@ use Symfony\Component\Templating\Storage\FileStorage; use Symfony\Component\Templating\Storage\Storage; +/** + * @group legacy + */ class FileStorageTest extends TestCase { public function testGetContent() diff --git a/src/Symfony/Component/Templating/Tests/Storage/StorageTest.php b/src/Symfony/Component/Templating/Tests/Storage/StorageTest.php index 8734886ac9936..39976321a7b14 100644 --- a/src/Symfony/Component/Templating/Tests/Storage/StorageTest.php +++ b/src/Symfony/Component/Templating/Tests/Storage/StorageTest.php @@ -14,6 +14,9 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Templating\Storage\Storage; +/** + * @group legacy + */ class StorageTest extends TestCase { public function testMagicToString() diff --git a/src/Symfony/Component/Templating/Tests/Storage/StringStorageTest.php b/src/Symfony/Component/Templating/Tests/Storage/StringStorageTest.php index d86d65a2aa525..ca0e71261af8a 100644 --- a/src/Symfony/Component/Templating/Tests/Storage/StringStorageTest.php +++ b/src/Symfony/Component/Templating/Tests/Storage/StringStorageTest.php @@ -15,6 +15,9 @@ use Symfony\Component\Templating\Storage\Storage; use Symfony\Component\Templating\Storage\StringStorage; +/** + * @group legacy + */ class StringStorageTest extends TestCase { public function testGetContent() diff --git a/src/Symfony/Component/Templating/Tests/TemplateNameParserTest.php b/src/Symfony/Component/Templating/Tests/TemplateNameParserTest.php index 81bbb838b1fbc..9a8730db66180 100644 --- a/src/Symfony/Component/Templating/Tests/TemplateNameParserTest.php +++ b/src/Symfony/Component/Templating/Tests/TemplateNameParserTest.php @@ -15,6 +15,9 @@ use Symfony\Component\Templating\TemplateNameParser; use Symfony\Component\Templating\TemplateReference; +/** + * @group legacy + */ class TemplateNameParserTest extends TestCase { protected TemplateNameParser $parser; diff --git a/src/Symfony/Component/Templating/composer.json b/src/Symfony/Component/Templating/composer.json index cd402b2451e5a..02d2b2158a9a7 100644 --- a/src/Symfony/Component/Templating/composer.json +++ b/src/Symfony/Component/Templating/composer.json @@ -17,6 +17,7 @@ ], "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8" }, "require-dev": {