Skip to content

AC-282: Fix deprecation messages for Symfony 6#16

Merged
borilyordanov merged 4 commits intopaysera:masterfrom
Okspen:AC-282-void-typehint
Mar 5, 2025
Merged

AC-282: Fix deprecation messages for Symfony 6#16
borilyordanov merged 4 commits intopaysera:masterfrom
Okspen:AC-282-void-typehint

Conversation

@Okspen
Copy link
Contributor

@Okspen Okspen commented Mar 3, 2025

  1. A void typehint for PayseraApiBundle::build was added to fix the deprecation message:

PHP Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Paysera\Bundle\ApiBundle\PayseraApiBundle" now to avoid errors or add an explicit @return annotation to suppress this message. in /home/app/src/vendor/symfony/error-handler/DebugClassLoader.php on line 339

  1. Annotations get deprecated completely and AttributeClassLoader doesn't have $reader property anymore.

Symfony 6.4 - https://github.com/symfony/routing/blob/6.4/Loader/AttributeClassLoader.php#L83
Symfony 7.2 - https://github.com/symfony/routing/blob/7.2/Loader/AttributeClassLoader.php#L54

But it's called inside Paysera\Bundle\ApiBundle\Service\RoutingLoader\RoutingAttributeLoader causing error Call to a member function getClassAnnotations() on null.

A check was added not to call the $reader if it doesn't exist of is not an instance of Doctrine\Common\Annotations\Reader.

@Okspen Okspen force-pushed the AC-282-void-typehint branch from 142e345 to 10e380d Compare March 3, 2025 20:05
@Okspen Okspen force-pushed the AC-282-void-typehint branch from 10e380d to d14dfda Compare March 3, 2025 20:09
@Okspen Okspen changed the title AC-282: add void typehint AC-282: add void typehint and fix Symfony 6 support Mar 5, 2025
@Okspen Okspen force-pushed the AC-282-void-typehint branch from 0c05c5d to dfbc22c Compare March 5, 2025 11:29
@borilyordanov borilyordanov changed the title AC-282: add void typehint and fix Symfony 6 support AC-282: Fix deprecation messages for Symfony 6 Mar 5, 2025
@borilyordanov borilyordanov merged commit 08835fb into paysera:master Mar 5, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments