diff --git a/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php b/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php index b57048a63434c2cec9de4b2bdcc9f66867dbd288..5a2f78faa178e33be523af4f3d03d375e815e40b 100644 --- a/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php +++ b/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php @@ -197,7 +197,8 @@ class FrontendLoginController extends AbstractPlugin ]; foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'] ?? [] as $_funcRef) { if ($_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } } \TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->redirectUrl); @@ -208,7 +209,8 @@ class FrontendLoginController extends AbstractPlugin $_params = [ 'content' => $content ]; - $content = GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + $content = GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } return $this->conf['wrapContentInBaseClass'] ? $this->pi_wrapInBaseClass($content) : $content; } @@ -830,7 +832,8 @@ class FrontendLoginController extends AbstractPlugin foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed'] ?? [] as $_funcRef) { $_params = []; if ($_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } } switch ($redirMethod) { diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index 587b49f0545b01593fbdc6ac5efd7cccfa666052..81f52ad356297e83e5bea1b3b841f2a55bdade04 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -2898,7 +2898,8 @@ class ContentObjectRenderer implements LoggerAwareInterface 'lifetime' => $lifetime, 'tags' => $tags ]; - GeneralUtility::callUserFunction($_funcRef, $params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + GeneralUtility::callUserFunction($_funcRef, $params, $ref); } $cacheFrontend->set($key, $content, $tags, $lifetime); return $content; @@ -4716,7 +4717,8 @@ class ContentObjectRenderer implements LoggerAwareInterface if (!$hookObject instanceof ContentObjectGetDataHookInterface) { throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetDataHookInterface::class, 1195044480); } - $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $ref); } } return $retVal; @@ -5125,7 +5127,8 @@ class ContentObjectRenderer implements LoggerAwareInterface 'tagAttributes' => &$tagAttributes ]; foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc'] ?? [] as $_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } // If flag "returnLastTypoLinkUrl" set, then just return the latest URL made: diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index e6794af3ab5c8e9ac8093536b899d754a43b9069..aa3165932e0d24ec5f09a0855822fa50d74b7634 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -2155,7 +2155,8 @@ class TypoScriptFrontendController implements LoggerAwareInterface { $_params = []; foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'] ?? [] as $_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } // Rendering charset of HTML page. diff --git a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php index 06d37ef9a075bd5197074601efdf0b737b3b7d22..9040b8a4117a39c5baecbb11b0074bdf0d46859f 100644 --- a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php +++ b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php @@ -125,7 +125,8 @@ class GifBuilder extends GraphicalFunctions // line as TEXT obj, see extension julle_gifbconf foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_gifbuilder.php']['gifbuilder-ConfPreProcess'] ?? [] as $_funcRef) { $_params = $this->setup; - $this->setup = GeneralUtility::callUserFunction($_funcRef, $_params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + $this->setup = GeneralUtility::callUserFunction($_funcRef, $_params, $ref); } // Initializing global Char Range Map $this->charRangeMap = []; diff --git a/typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php b/typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php index 1a5d86696b3d81fe7063bedd483d606b9d46065a..3c377b1fdc73733aae3e8670dc1143eb318e3c63 100644 --- a/typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php +++ b/typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php @@ -234,7 +234,8 @@ class CrawlerHook $hookObj = GeneralUtility::makeInstance($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['crawler'][$cfgRec['type']]); $this->pObj = $pObj; // For addQueueEntryForHook() - $hookObj->indexOperation($cfgRec, $session_data, $params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + $hookObj->indexOperation($cfgRec, $session_data, $params, $ref); } } // Save process data which might be modified: diff --git a/typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php b/typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php index 58630eea31b8af216259b5f473604ef0536f7fe5..ef246de3329c37812f15d88c9ac6bc42bfe218ca 100644 --- a/typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php +++ b/typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php @@ -443,7 +443,8 @@ class ValidatorTask extends AbstractTask 'pObj' => &$this, 'markerArray' => $markerArray ]; - $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this); + $ref = $this; // introduced for phpstan to not lose type information when passing $this into callUserFunction + $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $ref); if (is_array($newMarkers)) { $markerArray = $newMarkers + $markerArray; }