Review main Merged

74828[BUGFIX] Work around type issues in Fluid

crell CR +2 V +2 Easy +2 −12 updated 07/07/22, 19:51

Commit message

Fluid's TagBuilder::getAttribute() is doc-typed as returning `string`,
but the description says it returns `?string`.  That meant PHPStan
believes the `$file !== null` check is unnecessary, when it actually is.
The TagBuilder class is not in core, though, but in the typo3fluid
vendored package, so it cannot be corrected from here.

However, the `$attributes` array is already requested above, and then
href/src is removed from it anyway because it's the same piece of data.
So just reading off of the array we already have and doing missing-value
handling there ourselves resolves the PHPStan issue, is slightly more
consistent with what the next line does (the unset() call), and is ever
so slightly faster as it skips a method call.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 3