Issue Bug Resolved

#110828Extension scanner: first-class callable syntax crashes the argument matchers

Georg Tiefenbrunn 09/29/26, 07:17 updated 09/30/26, 09:45

Description

A static call in first-class callable syntax makes the extension scanner fail on the file that contains it.

AbstractCoreMatcher::isArgumentUnpackingUsed() reads $arg->unpack on every argument. For Foo::bar(...) the only argument is a PhpParser\Node\VariadicPlaceholder, which has no unpack property. Under the default SYS/exceptionalErrors the warning becomes an exception.

MethodArgumentDroppedStaticMatcher and MethodArgumentRequiredStaticMatcher call the method for every static call, so every static first-class callable is affected. The other matchers that use it are affected when the method name matches a rule.

Affected: 14.3.7 and main. 13.4 and 12.4 have the same code.

Steps to reproduce

Put this file into an extension:

<?php
namespace Vendor\Ext;

use TYPO3\CMS\Core\Utility\GeneralUtility;

final class Example
{
    public function run(): array
    {
        return array_map(GeneralUtility::underscoredToUpperCamelCase(...), ['a_b']);
    }
}

Then scan the extension in Admin Tools > Upgrade > Scan Extension Files.

Expected

The file is scanned. A first-class callable has no arguments to count, so the argument matchers do not report it.

Actual

The scan request for the file answers HTTP 500. The log shows TYPO3\CMS\Core\Error\Exception, code 1476107295:

PHP Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack
in typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/AbstractCoreMatcher.php line 170

Possible fix

Treat a VariadicPlaceholder like argument unpacking in isArgumentUnpackingUsed(). A patch follows on Gerrit.

Reviews 2

History 24

  1. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-30T09:45:10+00:00" > 09/30/26, 09:45 </span>

    Applied in changeset commit:555e522f842de655a5833bea1be15a6b6ca7106b.