Skip to content
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

hide deprecation warning #492

Closed
wants to merge 1 commit into from

Conversation

adeptofvoltron
Copy link

@adeptofvoltron adeptofvoltron commented Mar 28, 2023

with symfony 6.1 I got such warning:

2023-03-28T12:23:12+02:00 [info] User 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 "Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle" now to avoid errors or add an explicit @return annotation to suppress this message.

such change repair it

@@ -14,7 +14,7 @@
*/
class DoctrineMigrationsBundle extends Bundle
{
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
Copy link
Member

@greg0ire greg0ire Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is not final, so this is technically a breaking change. You should use a phpdoc annotation instead:

Suggested change
public function build(ContainerBuilder $container): void
/** @return void */
public function build(ContainerBuilder $container)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also suggest adding @final since 3.3.0 (or 3.4.0 depending on what is the next minor version) on that class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next minor version should be 3.3.0.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @greg0ire said, we cannot add a return type to a non-final method in a minor release.

@nicolas-grekas
Copy link
Member

@adeptofvoltron up to do the suggested changes?

@mickverm
Copy link
Contributor

mickverm commented May 2, 2023

#494 has been merged.

@derrabus
Copy link
Member

derrabus commented May 2, 2023

Thanks. Let's close this one then.

@derrabus derrabus closed this May 2, 2023
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.

None yet

6 participants