Commit 46844b35 authored by Benni Mack's avatar Benni Mack Committed by Stefan Neufeind
Browse files

[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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent b93845f4
......@@ -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);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment