CacheLifetimeCalculator::getFirstTimeValueForRecord() destructured the
"tablename:pid" argument with a list assignment and guarded the result
with "isset($pid)". PHPStan 2.2.7 reworked certainty handling for
isset(), empty() and the null coalescing operators, and now derives a
defined, non-nullable string for $pid from the list return type of
GeneralUtility::trimExplode(). The guard is therefore reported as
always true, which fails the nightly "phpstan ... max" job.
The analyser is optimistic here: a list type carries no length, so
$pid really is undefined at runtime whenever the argument contains no
colon - exactly the malformed input the guard rejects. The guard has
to stay and is instead written in a form the analyser can follow, by
reading both parts with a null coalescing default and comparing them
explicitly.
Runtime behaviour is unchanged, including the empty() check on the
already trimmed table name, which can only be empty as an empty
string.
The minimum required version of phpstan/phpstan is raised to 2.2.7
along with it, so locked pre-merge runs analyse with the same version
that uncovered this. The code change itself is version neutral and
reports no error with either version.
The component is declared only once, as a development requirement in
the root manifest, and 14.3 and 13.4 currently declare the very same
constraint, so this part applies unmodified to both backports. The
touched class is byte identical on all three branches; 13.4 has no
integrity stage in its nightly, so the raise is preventive there.
Used command(s):
composer require --dev "phpstan/phpstan:^2.2.7"