From c932a2ef02b410ddbbdf6d5edfb9f6fe5af78aca Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 22 Nov 2024 23:12:21 +0000 Subject: [PATCH] Deprecate navigation view helpers for removal in 3.0 Signed-off-by: George Steel --- docs/book/v2/migration/preparing-for-v3.md | 1 + psalm-baseline.xml | 142 ++++++++++++++++++ src/Helper/Navigation.php | 2 + src/Helper/Navigation/AbstractHelper.php | 2 + src/Helper/Navigation/Breadcrumbs.php | 2 + src/Helper/Navigation/HelperInterface.php | 2 + src/Helper/Navigation/Links.php | 2 + .../Navigation/Listener/AclListener.php | 2 + src/Helper/Navigation/Menu.php | 2 + src/Helper/Navigation/PluginManager.php | 2 + src/Helper/Navigation/Sitemap.php | 2 + 11 files changed, 161 insertions(+) diff --git a/docs/book/v2/migration/preparing-for-v3.md b/docs/book/v2/migration/preparing-for-v3.md index 17f8dd7b0..1939d555b 100644 --- a/docs/book/v2/migration/preparing-for-v3.md +++ b/docs/book/v2/migration/preparing-for-v3.md @@ -52,3 +52,4 @@ The impact of this future removal will affect templates that use a regular short The following view helpers are deprecated and will be removed in version 3.0 of `laminas-view`. - The [Json View Helper](../helpers/json.md) +- The Navigation View Helper and all associated helpers, `Links`, `Menu`, `Sitemap`, `Breadcrumbs` along with its dedicated plugin manager will be removed in 3.0. These view helpers have been copied to the `laminas-navigation` component, and you can prepare for their removal by altering the namespace in your code from, for example `Laminas\View\Helper\Navigation\Menu` to `Laminas\Navigation\View\Helper\Menu` diff --git a/psalm-baseline.xml b/psalm-baseline.xml index db1a2e15c..c26a5f56e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -541,6 +541,21 @@ + + + + + + getServiceLocator())]]> + + + + + + + + + @@ -565,6 +580,12 @@ + + + + + + minDepth)]]> @@ -660,6 +681,12 @@ + + + + + + @@ -736,6 +763,13 @@ + + + + + + + @@ -826,6 +860,12 @@ + + + + + + @@ -945,11 +985,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1373,6 +1439,9 @@ + + + @@ -2201,6 +2270,10 @@ + + + + @@ -2221,10 +2294,15 @@ + getDependencyConfig())]]> + + + + @@ -2237,6 +2315,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2378,6 +2481,10 @@ + + + + @@ -2403,6 +2510,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + errorHandlerMessage = $message; @@ -2441,14 +2574,23 @@ + + + [ 'default' => [], ], ])]]> + + + + + + diff --git a/src/Helper/Navigation.php b/src/Helper/Navigation.php index 5331f5986..627bfa52b 100644 --- a/src/Helper/Navigation.php +++ b/src/Helper/Navigation.php @@ -20,6 +20,8 @@ /** * Proxy helper for retrieving navigational helpers and forwarding calls * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 + * * @method Navigation\Breadcrumbs breadcrumbs($container = null) * @method Navigation\Links links($container = null) * @method Navigation\Menu menu($container = null) diff --git a/src/Helper/Navigation/AbstractHelper.php b/src/Helper/Navigation/AbstractHelper.php index 68451c8c3..9a5b83e2b 100644 --- a/src/Helper/Navigation/AbstractHelper.php +++ b/src/Helper/Navigation/AbstractHelper.php @@ -44,6 +44,8 @@ * Base class for navigational helpers. * * Duck-types against Laminas\I18n\Translator\TranslatorAwareInterface. + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ abstract class AbstractHelper extends View\Helper\AbstractHtmlElement implements EventManagerAwareInterface, diff --git a/src/Helper/Navigation/Breadcrumbs.php b/src/Helper/Navigation/Breadcrumbs.php index f2a2960e4..122db9099 100644 --- a/src/Helper/Navigation/Breadcrumbs.php +++ b/src/Helper/Navigation/Breadcrumbs.php @@ -18,6 +18,8 @@ /** * Helper for printing breadcrumbs. + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ class Breadcrumbs extends AbstractHelper { diff --git a/src/Helper/Navigation/HelperInterface.php b/src/Helper/Navigation/HelperInterface.php index 4abdd4317..02fa249df 100644 --- a/src/Helper/Navigation/HelperInterface.php +++ b/src/Helper/Navigation/HelperInterface.php @@ -11,6 +11,8 @@ /** * Interface for navigational helpers + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ interface HelperInterface extends BaseHelperInterface { diff --git a/src/Helper/Navigation/Links.php b/src/Helper/Navigation/Links.php index abc682d62..e608d02d5 100644 --- a/src/Helper/Navigation/Links.php +++ b/src/Helper/Navigation/Links.php @@ -37,6 +37,8 @@ /** * Helper for printing elements + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ class Links extends AbstractHelper { diff --git a/src/Helper/Navigation/Listener/AclListener.php b/src/Helper/Navigation/Listener/AclListener.php index 268287684..ddc6b9b99 100644 --- a/src/Helper/Navigation/Listener/AclListener.php +++ b/src/Helper/Navigation/Listener/AclListener.php @@ -8,6 +8,8 @@ /** * Default Access Control Listener + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ class AclListener { diff --git a/src/Helper/Navigation/Menu.php b/src/Helper/Navigation/Menu.php index f3744ab51..c4d7e080f 100644 --- a/src/Helper/Navigation/Menu.php +++ b/src/Helper/Navigation/Menu.php @@ -27,6 +27,8 @@ /** * Helper for rendering menus from navigation containers. + * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 */ class Menu extends AbstractHelper { diff --git a/src/Helper/Navigation/PluginManager.php b/src/Helper/Navigation/PluginManager.php index b166f4d50..b1a715d8e 100644 --- a/src/Helper/Navigation/PluginManager.php +++ b/src/Helper/Navigation/PluginManager.php @@ -16,6 +16,8 @@ * Navigation\HelperInterface. Additionally, it registers a number of default * helpers. * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 + * * @template InstanceType of HelperInterface|AbstractHelper * @psalm-import-type ServiceManagerConfiguration from ServiceManager * @extends HelperPluginManager diff --git a/src/Helper/Navigation/Sitemap.php b/src/Helper/Navigation/Sitemap.php index aa0551102..e4abb943d 100644 --- a/src/Helper/Navigation/Sitemap.php +++ b/src/Helper/Navigation/Sitemap.php @@ -30,6 +30,8 @@ /** * Helper for printing sitemaps * + * @deprecated This class has been moved to the `Laminas\Navigation` component and will be removed in 3.0 + * * @link http://www.sitemaps.org/protocol.php */ class Sitemap extends AbstractHelper