From 46844b356dbd609c0219873147dc4ede2096c2dd Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Thu, 17 Nov 2016 12:07:14 +0100 Subject: [PATCH] [TASK] Clarify code comments in GeneralUtility::getUserObj() The method GeneralUtility::getUserObj() already shows that it will be exactly the same as makeInstance(), thus it will be deprecated in TYPO3 v9.0, so the comments can be changed accordingly already. Resolves: #78734 Releases: master Change-Id: I5487e8bc0d1c140110d30098e656f5205750c0f2 Reviewed-on: https://review.typo3.org/50694 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> --- typo3/sysext/core/Classes/Utility/GeneralUtility.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index 6176565b5847..8ace260c8cf1 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -3806,7 +3806,8 @@ class GeneralUtility } /** - * This method should be avoided, as it will be deprecated soon. Instead use makeInstance() directly. + * This method should be avoided, as it will be deprecated completely in TYPO3 v9, and will be removed in TYPO3 v10. + * Instead use makeInstance() directly. * * Creates and returns reference to a user defined object. * This function can return an object reference if you like. @@ -3829,19 +3830,16 @@ class GeneralUtility self::deprecationLog('Using file references to resolve "' . $classRef . '" has been deprecated in TYPO3 v8 ' . 'when calling GeneralUtility::getUserObj(), make sure the class is available via the class loader. ' . 'This functionality will be removed in TYPO3 v9.'); - list($file, $class) = self::revExplode(':', $classRef, 2); + list($file, $classRef) = self::revExplode(':', $classRef, 2); $requireFile = self::getFileAbsFileName($file); if ($requireFile) { require_once $requireFile; } - } else { - $class = $classRef; } // Check if class exists: - if (class_exists($class)) { - $classObj = self::makeInstance($class); - return $classObj; + if (class_exists($classRef)) { + return self::makeInstance($classRef); } } -- GitLab