-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation messages in symfony 5.4 #809
Comments
This problem should already be fixed by #768 because we added @jokaorgua Can you please verify if these deprecation messages are gone in the current |
@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 |
@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? |
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 |
Fixes the following deprecations reported by Symfony: ``` Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "IteratorAggregate::getIterator()" might add "\Traversable" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. ``` References: - php-imagine#809
I created a PR to add the missing types. |
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 |
Fixes the following deprecations reported by Symfony: ``` Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "IteratorAggregate::getIterator()" might add "\Traversable" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. ``` References: - php-imagine#809
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 #768 (comment) |
Fixes the following deprecations reported by Symfony: ``` Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "IteratorAggregate::getIterator()" might add "\Traversable" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Image\Metadata\MetadataBag" now to avoid errors or add an explicit @return annotation to suppress this message. ``` References: - php-imagine#809
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
The text was updated successfully, but these errors were encountered: