Fluid icon indicating copy to clipboard operation
Fluid copied to clipboard

Avoid output of deprecations?

Open s2b opened this issue 1 year ago • 3 comments

Other widespread PHP libraries seem to use the silencing operator @ when triggering exceptions. We should probably do the same in Fluid v4. We should check how this affects TYPO3's deprecation logs and test suite.

Related links:

  • https://docs.phpunit.de/en/10.5/error-handling.html
  • https://symfony.com/doc/current/components/phpunit_bridge.html
  • https://stackoverflow.com/questions/41545682/what-is-the-purpose-of-silence-operator-at-sign-before-trigger-error

s2b avatar Aug 21 '24 21:08 s2b

core does this: https://github.com/TYPO3/typo3/commit/8140ec47928543e2c28c1974f77852a361b26246 the code was moved around a bit over time, but it's still same strategy: log deprecations, even if it has the STFU operator.

lolli42 avatar Aug 22 '24 07:08 lolli42

I just tested this with phpunit's default error handler: The deprecation with STFU operator in fact is ignored by phpunit. TYPO3 on the other hand logs both kinds of deprecations.

So I would argue to only add the operator to deprecations that are added after a major release and to leave those for Fluid v4 without the operator.

What do you think?

s2b avatar Sep 02 '24 07:09 s2b

Sounds like a good trade-off. Let's see if we can manage to stick to this ;)

lolli42 avatar Sep 09 '24 12:09 lolli42