From 70e3aa20d16d8bc886b261e94f0df8a60297560a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 8 Aug 2020 14:01:14 +0200 Subject: [PATCH] 1.4.0 --- CHANGELOG.md | 44 +++++++++++++++++++ .../Symfony/Bundle/SonataTwigBundle.php | 2 +- .../DependencyInjection/Configuration.php | 2 +- src/Bridge/Symfony/Resources/config/twig.xml | 2 +- src/Extension/DeprecatedTemplateExtension.php | 2 +- src/Extension/StatusRuntime.php | 2 +- src/FlashMessage/FlashManager.php | 8 ++-- src/Node/DeprecatedTemplateNode.php | 2 +- .../DeprecatedTemplateTokenParser.php | 4 +- 9 files changed, 56 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ff3182..edb3a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,50 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.4.0](https://github.com/sonata-project/twig-extensions/compare/1.3.1...1.4.0) - 2020-08-08 +### Added +- [[#90](https://github.com/sonata-project/twig-extensions/pull/90)] Add + `Sonata\Twig\FlashMessage\FlashManager::addFlash(string $type, string +$message): void` to add flash message directly by FlashManager +([@wbloszyk](https://github.com/wbloszyk)) +- [[#90](https://github.com/sonata-project/twig-extensions/pull/90)] Add + `Sonata\Twig\FlashMessage\FlashManagerInterface` to allow create custom +FlashManager ([@wbloszyk](https://github.com/wbloszyk)) +- [[#90](https://github.com/sonata-project/twig-extensions/pull/90)] Add twig + function `sonata_flashmessage_class` - get css class from flash message type +in Twig ([@wbloszyk](https://github.com/wbloszyk)) +- [[#100](https://github.com/sonata-project/twig-extensions/pull/100)] Added + `Sonata\Twig\Bridge\Symfony\SonataTwigSymfonyBundle`. +([@phansys](https://github.com/phansys)) + +### Changed +- [[#101](https://github.com/sonata-project/twig-extensions/pull/101)] Bump + Symfony to version 5.1 ([@franmomu](https://github.com/franmomu)) +- [[#99](https://github.com/sonata-project/twig-extensions/pull/99)] Bump Twig + to 2.6. ([@franmomu](https://github.com/franmomu)) + +### Deprecated +- [[#99](https://github.com/sonata-project/twig-extensions/pull/99)] Deprecated + `sonata_template_deprecate` twig tag and +`sonata.twig.deprecated_template_extension` service. +([@franmomu](https://github.com/franmomu)) +- [[#99](https://github.com/sonata-project/twig-extensions/pull/99)] Deprecated + `DeprecatedTemplateExtension`, `DeprecatedTemplateNode` and +`DeprecatedTemplateTokenParser` classes. +([@franmomu](https://github.com/franmomu)) + +### Fixed +- [[#90](https://github.com/sonata-project/twig-extensions/pull/90)] Fix + working `FlashManager` as `StatusClassRenderer` +([@wbloszyk](https://github.com/wbloszyk)) +- [[#100](https://github.com/sonata-project/twig-extensions/pull/100)] Fixed + Flex recipe implementation through `SonataTwigSymfonyBundle` alias. +([@phansys](https://github.com/phansys)) + +### Removed +- [[#101](https://github.com/sonata-project/twig-extensions/pull/101)] Remove + support of Symfony < 3.4 and < 4.4 ([@franmomu](https://github.com/franmomu)) + ## [1.3.1](https://github.com/sonata-project/twig-extensions/compare/1.3.0...1.3.1) - 2020-06-29 ### Fixed - [[#92](https://github.com/sonata-project/twig-extensions/pull/92)] Fix diff --git a/src/Bridge/Symfony/Bundle/SonataTwigBundle.php b/src/Bridge/Symfony/Bundle/SonataTwigBundle.php index c9999e3..66c4174 100644 --- a/src/Bridge/Symfony/Bundle/SonataTwigBundle.php +++ b/src/Bridge/Symfony/Bundle/SonataTwigBundle.php @@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; @trigger_error(sprintf( - 'The %s\SonataTwigBundle class is deprecated since version 1.x, to be removed in 2.0. Use %s instead.', + 'The %s\SonataTwigBundle class is deprecated since version 1.4, to be removed in 2.0. Use %s instead.', __NAMESPACE__, SonataTwigBundle::class ), E_USER_DEPRECATED); diff --git a/src/Bridge/Symfony/DependencyInjection/Configuration.php b/src/Bridge/Symfony/DependencyInjection/Configuration.php index 51d5515..c47453c 100644 --- a/src/Bridge/Symfony/DependencyInjection/Configuration.php +++ b/src/Bridge/Symfony/DependencyInjection/Configuration.php @@ -63,7 +63,7 @@ private function addFlashMessageSection(ArrayNodeDefinition $node): void ->children() ->scalarNode('domain') ->defaultValue('SonataTwigBundle') - ->setDeprecated('The child node "%node%" at path "%path%" is deprecated since sonata-project/twig-extensions 1.x and will be removed in 2.0 version. Translate you message before add it to session flash.') + ->setDeprecated('The child node "%node%" at path "%path%" is deprecated since sonata-project/twig-extensions 1.4 and will be removed in 2.0 version. Translate you message before add it to session flash.') ->end() ->end() ->end() diff --git a/src/Bridge/Symfony/Resources/config/twig.xml b/src/Bridge/Symfony/Resources/config/twig.xml index 959c9af..670051a 100644 --- a/src/Bridge/Symfony/Resources/config/twig.xml +++ b/src/Bridge/Symfony/Resources/config/twig.xml @@ -13,7 +13,7 @@ - The "%service_id%" service is deprecated since sonata-project/twig-extensions 1.x. + The "%service_id%" service is deprecated since sonata-project/twig-extensions 1.4. diff --git a/src/Extension/DeprecatedTemplateExtension.php b/src/Extension/DeprecatedTemplateExtension.php index 8a8b444..d8b7768 100644 --- a/src/Extension/DeprecatedTemplateExtension.php +++ b/src/Extension/DeprecatedTemplateExtension.php @@ -21,7 +21,7 @@ * * NEXT_MAJOR: Remove this class. * - * @deprecated since sonata-project/twig-extensions 1.x, to be removed in 2.0. + * @deprecated since sonata-project/twig-extensions 1.4, to be removed in 2.0. */ final class DeprecatedTemplateExtension extends AbstractExtension { diff --git a/src/Extension/StatusRuntime.php b/src/Extension/StatusRuntime.php index d3d0588..2234475 100644 --- a/src/Extension/StatusRuntime.php +++ b/src/Extension/StatusRuntime.php @@ -57,7 +57,7 @@ public function statusClass($object, $statusType = null, string $default = ''): } @trigger_error(sprintf( - 'Passing other type than object or string as argument 1 for "%s()" is deprecated since sonata-project/twig-extensions 1.x' + 'Passing other type than object or string as argument 1 for "%s()" is deprecated since sonata-project/twig-extensions 1.4' .' and will throw an exception in 2.0.', __METHOD__ ), E_USER_DEPRECATED); diff --git a/src/FlashMessage/FlashManager.php b/src/FlashMessage/FlashManager.php index 33fa392..f32b80b 100644 --- a/src/FlashMessage/FlashManager.php +++ b/src/FlashMessage/FlashManager.php @@ -52,7 +52,7 @@ public function __construct(SessionInterface $session, array $types, array $cssC /** * Tells if class may handle $object for status class rendering. * - * @deprecated since sonata-project/twig-extensions 1.x, will be removed in 2.0. Use handlesType() instead. + * @deprecated since sonata-project/twig-extensions 1.4, will be removed in 2.0. Use handlesType() instead. * * NEXT_MAJOR: remove this method * @@ -64,7 +64,7 @@ public function __construct(SessionInterface $session, array $types, array $cssC public function handlesObject($object, ?string $statusName = null) { @trigger_error(sprintf( - 'The "%s()" method is deprecated since sonata-project/twig-extensions 1.x' + 'The "%s()" method is deprecated since sonata-project/twig-extensions 1.4' .' and will be removed in version 2.0. Use "%s" instead.', __METHOD__, 'handlesType()' @@ -87,7 +87,7 @@ public function handlesObject($object, ?string $statusName = null) /** * Returns the status CSS class for $object. * - * @deprecated since sonata-project/twig-extensions 1.x, will be removed in 2.0. Use getRenderedHtmlClassAttribute() instead. + * @deprecated since sonata-project/twig-extensions 1.4, will be removed in 2.0. Use getRenderedHtmlClassAttribute() instead. * * NEXT_MAJOR: remove this method * @@ -100,7 +100,7 @@ public function handlesObject($object, ?string $statusName = null) public function getStatusClass($object, ?string $statusName = null, string $default = '') { @trigger_error(sprintf( - 'The "%s()" method is deprecated since sonata-project/twig-extensions 1.x' + 'The "%s()" method is deprecated since sonata-project/twig-extensions 1.4' .' and will be removed in 2.0. Use "%s" instead.', __METHOD__, 'getRenderedHtmlClassAttribute()' diff --git a/src/Node/DeprecatedTemplateNode.php b/src/Node/DeprecatedTemplateNode.php index 3fb8e2a..d5cde8f 100644 --- a/src/Node/DeprecatedTemplateNode.php +++ b/src/Node/DeprecatedTemplateNode.php @@ -22,7 +22,7 @@ * * NEXT_MAJOR: Remove this class. * - * @deprecated since sonata-project/twig-extensions 1.x, to be removed in 2.0. + * @deprecated since sonata-project/twig-extensions 1.4, to be removed in 2.0. */ final class DeprecatedTemplateNode extends Node { diff --git a/src/TokenParser/DeprecatedTemplateTokenParser.php b/src/TokenParser/DeprecatedTemplateTokenParser.php index cb615cb..a1ed7a9 100644 --- a/src/TokenParser/DeprecatedTemplateTokenParser.php +++ b/src/TokenParser/DeprecatedTemplateTokenParser.php @@ -22,14 +22,14 @@ * * NEXT_MAJOR: Remove this class. * - * @deprecated since sonata-project/twig-extensions 1.x, to be removed in 2.0. Use "deprecated" tag instead. + * @deprecated since sonata-project/twig-extensions 1.4, to be removed in 2.0. Use "deprecated" tag instead. */ final class DeprecatedTemplateTokenParser extends AbstractTokenParser { public function parse(Token $token): DeprecatedTemplateNode { @trigger_error( - 'The "sonata_template_deprecate" tag is deprecated since sonata-project/twig-extensions 1.x' + 'The "sonata_template_deprecate" tag is deprecated since sonata-project/twig-extensions 1.4' .' and will be removed in version 2.0. Use "deprecated" tag instead.', E_USER_DEPRECATED );