From e682ce9d2e29a96eaa14a0f6c3f5fd329b7abed2 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Wed, 6 Nov 2024 14:02:27 +0100 Subject: [PATCH] IBX-8805: Dropped deprecated Twig Functions&Filters --- .../Twig/Extension/ContentExtension.php | 56 ------------------- .../Extension/DataAttributesExtension.php | 9 --- .../Extension/FieldRenderingExtension.php | 20 ------- .../Twig/Extension/FileSizeExtension.php | 8 --- .../Twig/Extension/ImageExtension.php | 18 ------ .../Extension/QueryRenderingExtension.php | 18 ------ .../Twig/Extension/RenderContentExtension.php | 9 --- .../Twig/Extension/RenderExtension.php | 9 --- .../Extension/RenderLocationExtension.php | 9 --- .../Twig/Extension/RoutingExtension.php | 26 --------- 10 files changed, 182 deletions(-) diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php index 781c6db17c..b064af4def 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php @@ -62,50 +62,18 @@ public function __construct( public function getFunctions() { return [ - new TwigFunction( - 'ez_content_name', - [$this, 'getTranslatedContentName'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_name', - ] - ), new TwigFunction( 'ibexa_content_name', [$this, 'getTranslatedContentName'] ), - new TwigFunction( - 'ez_field_value', - [$this, 'getTranslatedFieldValue'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_value', - ] - ), new TwigFunction( 'ibexa_field_value', [$this, 'getTranslatedFieldValue'] ), - new TwigFunction( - 'ez_field', - [$this, 'getTranslatedField'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field', - ] - ), new TwigFunction( 'ibexa_field', [$this, 'getTranslatedField'] ), - new TwigFunction( - 'ez_field_is_empty', - [$this, 'isFieldEmpty'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_is_empty', - ] - ), new TwigFunction( 'ibexa_has_field', [$this, 'hasField'] @@ -114,26 +82,10 @@ public function getFunctions() 'ibexa_field_is_empty', [$this, 'isFieldEmpty'] ), - new TwigFunction( - 'ez_field_name', - [$this, 'getTranslatedFieldDefinitionName'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_name', - ] - ), new TwigFunction( 'ibexa_field_name', [$this, 'getTranslatedFieldDefinitionName'] ), - new TwigFunction( - 'ez_field_description', - [$this, 'getTranslatedFieldDefinitionDescription'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_description', - ] - ), new TwigFunction( 'ibexa_field_description', [$this, 'getTranslatedFieldDefinitionDescription'] @@ -142,14 +94,6 @@ public function getFunctions() 'ibexa_field_group_name', [$this, 'getFieldGroupName'] ), - new TwigFunction( - 'ez_content_field_identifier_first_filled_image', - [$this, 'getFirstFilledImageFieldIdentifier'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_field_identifier_first_filled_image', - ] - ), new TwigFunction( 'ibexa_content_field_identifier_first_filled_image', [$this, 'getFirstFilledImageFieldIdentifier'] diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php index 6fd90f50ad..c059f7797c 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php @@ -24,15 +24,6 @@ class DataAttributesExtension extends AbstractExtension public function getFilters(): array { return [ - new TwigFilter( - 'ez_data_attributes_serialize', - [$this, 'serializeDataAttributes'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_data_attributes_serialize', - ] - ), new TwigFilter( 'ibexa_data_attributes_serialize', [$this, 'serializeDataAttributes'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php index ea2820c699..4e07c87018 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php @@ -64,31 +64,11 @@ public function getFunctions() }; return [ - new TwigFunction( - 'ez_render_field', - $renderFieldCallable, - [ - 'is_safe' => ['html'], - 'needs_environment' => true, - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_field', - ] - ), new TwigFunction( 'ibexa_render_field', $renderFieldCallable, ['is_safe' => ['html'], 'needs_environment' => true] ), - new TwigFunction( - 'ez_render_field_definition_settings', - $renderFieldDefinitionSettingsCallable, - [ - 'is_safe' => ['html'], - 'needs_environment' => true, - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_field_definition_settings', - ] - ), new TwigFunction( 'ibexa_render_field_definition_settings', $renderFieldDefinitionSettingsCallable, diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php index 10ec36c376..e097aac4a7 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php @@ -75,14 +75,6 @@ private function getLocale() public function getFilters() { return [ - new TwigFilter( - 'ez_file_size', - [$this, 'sizeFilter'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_file_size', - ] - ), new TwigFilter( 'ibexa_file_size', [$this, 'sizeFilter'] diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php index 86ef0ab649..113aeee275 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php @@ -34,29 +34,11 @@ public function __construct(VariationHandler $imageVariationService, AssetMapper public function getFunctions() { return [ - new TwigFunction( - 'ez_image_alias', - [$this, 'getImageVariation'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_image_alias', - ] - ), new TwigFunction( 'ibexa_image_alias', [$this, 'getImageVariation'], ['is_safe' => ['html']] ), - new TwigFunction( - 'ez_content_field_identifier_image_asset', - [$this, 'getImageAssetContentFieldIdentifier'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_field_identifier_image_asset', - ] - ), new TwigFunction( 'ibexa_content_field_identifier_image_asset', [$this, 'getImageAssetContentFieldIdentifier'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php index 8e4e53cbf2..5f3d465192 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php @@ -46,29 +46,11 @@ public function getFunctions(): array }; return [ - new TwigFunction( - 'ez_render_*_query', - $typeCallable, - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_*_query', - ] - ), new TwigFunction( 'ibexa_render_*_query', $typeCallable, ['is_safe' => ['html']] ), - new TwigFunction( - 'ez_render_*_query_*', - $typeAndRendererCallable, - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_*_query_', - ] - ), new TwigFunction( 'ibexa_render_*_query_*', $typeAndRendererCallable, diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php index 25ae6de87e..cbd9fd8056 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php @@ -38,15 +38,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render_content', - [$this, 'renderContent'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_content', - ] - ), new TwigFunction( 'ibexa_render_content', [$this, 'renderContent'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php index 13421a3d31..d5a9086cc9 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php @@ -39,15 +39,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render', - [$this, 'render'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render', - ] - ), new TwigFunction( 'ibexa_render', [$this, 'render'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php index c0b838ddb3..f81b67ef15 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php @@ -38,15 +38,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render_location', - [$this, 'renderLocation'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_location', - ] - ), new TwigFunction( 'ibexa_render_location', [$this, 'renderLocation'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php index a759af0cb5..82b6ef46ff 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php @@ -43,27 +43,10 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_route', - [$this, 'getRouteReference'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_route', - ] - ), new TwigFunction( 'ibexa_route', [$this, 'getRouteReference'] ), - new TwigFunction( - 'ez_path', - [$this, 'getPath'], - [ - 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_path', - ] - ), new TwigFunction( 'ibexa_path', [$this, 'getPath'], @@ -71,15 +54,6 @@ public function getFunctions(): array 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], ] ), - new TwigFunction( - 'ez_url', - [$this, 'getUrl'], - [ - 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_url', - ] - ), new TwigFunction( 'ibexa_url', [$this, 'getUrl'],