Project

General

Profile

Actions

Bug #91184

closed

Hook minifyJavaScript triggers deprecated warning

Added by Robert Vock over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2020-04-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using the Hook `minifyJavaScript`, you will get a Deprecated Warning in TYPO3 v10:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'][] = \Example\Extension\Hooks\JavascriptOptimization::class . '->jsMinify';

This happens because GeneralUtility::minifyJavaScript calls the callUserFunction method with as third parameter:

GeneralUtility.php#L1694

$fakeThis = false;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'] ?? [] as $hookMethod) {
    try {
        $parameters = ['script' => $script];
        $script = static::callUserFunction($hookMethod, $parameters, $fakeThis);

which triggers the deprecation:
GeneralUtility.php#L3306


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #90377: Deprecate $ref param types of method callUserFunctionClosedAlexander Schnitzler2020-02-15

Actions
Actions

Also available in: Atom PDF