Closed jokaorgua closed 2 years ago
This problem should already be fixed by https://github.com/php-imagine/Imagine/pull/768 because we added #[\ReturnTypeWillChange]
attributes there.
@jokaorgua Can you please verify if these deprecation messages are gone in the current dev-develop
version?
@ausi I've tried dev-develop version and deprecation messages still exist
ReturnTypeWillChange was introduced in 8.1 and I'm using 8.0.13. I think that is the problem.
This might be a bug in Symfony 5.4 then I think. The Symfony ErrorHandler Component should not report a deprecation for the return type if the attribute #[\ReturnTypeWillChange]
is present (even in PHP 8.0).
@ausi I can not find a code in ErrorHandler component which should react to ReturnTypeWillChange
could you provide a link where it is said that Symfony 5.4 on PHP prior to 8.1 must not trigger a deprecation message?
could you provide a link where it is said that Symfony 5.4 on PHP prior to 8.1 must not trigger a deprecation message?
This is just my opinion, but I think Symfony might agree that a deprecation does not make sense in this case.
That code where the attributes schould be handled is somewhere aroud here I think: https://github.com/symfony/symfony/blob/dcf09d6c0a194f5f36ec963eb6fef92d573db576/src/Symfony/Component/ErrorHandler/DebugClassLoader.php#L563
I didn’t notice that adding the return types via PHPDoc (in contrast to real return types) also fixes the issue, so your PR is correct IMO. Thank you!
@ausi symfony thinks that [#\ReturnTypeWillChange] is not enough and phpdoc must be added
symfony thinks that [#\ReturnTypeWillChange] is not enough and phpdoc must be added
Makes sense! 👍
@ausi will this be merged into master and new release created?
We'd first fix these issues: https://github.com/php-imagine/Imagine/milestone/1
@jokaorgua I assume so, see #814
Regarding release, see https://github.com/php-imagine/Imagine/pull/768#issuecomment-1011083965
Fixed.
Issue description
Deprecation messages when using symfony 5.4
What version of Imagine are you using?
1.2.4
What's the PHP version you are using?
8.0.13
What's the imaging library you are using [gd/imagick/gmagick/any]?
gd
What's the imaging library configuration
does not matter
Minimal PHP code to reproduce the error:
run any tests