plan2net/webp

V4.3 breaks with syntax error on PHP < 8.1

Closed this issue · 1 comments

Hi,
The 4.x tags claim to support PHP versions >= 7.2, see

"php": ">=7.2.0",

The change in 899fe99 however uses a language construct ("First class callable") introduced in PHP 8.1

So this change breaks

  1. the PHP requirements
  2. semantic versioning
    and has already been reported in #98 (comment)

The solution is to create a real closure like this:

private function parseStripColorProfileCommand(): mixed
    {
        return $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand'] ??
            implode(
                ' ',
                array_map(
                    \Closure::fromCallable([CommandUtility::class, 'escapeShellArgument']),
                    $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileParameters'] ?? [],
                ),
            );
    }

I'll provide a PR

Added PR #100