diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-95005-ExtbaseEmptyView.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-95005-ExtbaseEmptyView.rst new file mode 100644 index 0000000000000000000000000000000000000000..137a4ecb99cb0f179b8935d845999589af724289 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-95005-ExtbaseEmptyView.rst @@ -0,0 +1,41 @@ +.. include:: ../../Includes.txt + +======================================= +Deprecation: #95005 - Extbase EmptyView +======================================= + +See :issue:`95005` + +Description +=========== + +To further clean up and streamline fluid view related functionality, +extbase related view class :php:`TYPO3\CMS\Extbase\Mvc\View\EmptyView` +has been deprecated. + + +Impact +====== + +Using :php:`EmptyView` has been deprecated and logs a deprecation +level error upon use. + + +Affected Installations +====================== + +The class has been unused within TYPO3 core since its introduction in 4.5. +It is rather unlikely instances have extensions using the class. The extension +scanner finds usages with a strong match. + + +Migration +========= + +If rendering "nothing" by a view instance is needed for whatever reason, the +same result can be achieved with a :php:`TYPO3\CMS\Fluid\View\StandaloneView` +view instance by setting :php:`$view->setTemplateSource('')` and calling +:php:`$view->render()`. But it's of course quicker to simply not render +anything at all. + +.. index:: PHP-API, FullyScanned, ext:extbase diff --git a/typo3/sysext/extbase/Classes/Mvc/View/EmptyView.php b/typo3/sysext/extbase/Classes/Mvc/View/EmptyView.php index 453095da8fd46b20aee57e88cf05c9c0ceb3fa86..a980ecbe433469143a82b097b18f05e07e581868 100644 --- a/typo3/sysext/extbase/Classes/Mvc/View/EmptyView.php +++ b/typo3/sysext/extbase/Classes/Mvc/View/EmptyView.php @@ -19,9 +19,16 @@ use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext; /** * An empty view - a special case. + * + * @deprecated since v11, will be removed with 12. */ class EmptyView implements ViewInterface { + public function __construct() + { + trigger_error('Class ' . __CLASS__ . ' has been deprecated in v11 and will be removed with v12.'); + } + /** * Dummy method to satisfy the ViewInterface * diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 8d17caa32685f555f6d7a14a1010f7d366d06fde..39539a6cd0ba3597fc21dd6c56a3eee6ab3d4fd2 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -1779,4 +1779,9 @@ return [ 'Deprecation-94991-ExtbaseAbstractView.rst', ], ], + 'TYPO3\CMS\Extbase\Mvc\View\EmptyView' => [ + 'restFiles' => [ + 'Deprecation-95005-ExtbaseEmptyView.rst', + ], + ], ];