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

Impossible to profile LoadDataFixturesDoctrineCommand #442

Open
garak opened this issue May 8, 2024 · 2 comments
Open

Impossible to profile LoadDataFixturesDoctrineCommand #442

garak opened this issue May 8, 2024 · 2 comments

Comments

@garak
Copy link
Contributor

garak commented May 8, 2024

Symfony 6.4.7
DoctrineBundle 2.12.0
FixturesBundle 3.6.0
ORM 3.1.3

When I try to run bin/console do:fi:lo --profile -v I get the following:

[Error]
Call to protected method Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand::execute() from scope Symfony\Component\Console\Command\TraceableCommand

trace:

at /myproject/vendor/symfony/console/Command/TraceableCommand.php:331
Symfony\Component\Console\Command\TraceableCommand->execute() at /myproject/vendor/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at /myproject/vendor/symfony/console/Command/TraceableCommand.php:286
Symfony\Component\Console\Command\TraceableCommand->run() at /myproject/vendor/symfony/console/Application.php:1096
Symfony\Component\Console\Application->doRunCommand() at /myproject/vendor/symfony/framework-bundle/Console/Application.php:126
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /myproject/vendor/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at /myproject/vendor/symfony/framework-bundle/Console/Application.php:80
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /myproject/vendor/symfony/console/Application.php:175

The command is working properly without the --profile flag.

@garak
Copy link
Contributor Author

garak commented Jun 21, 2024

It seems that the problem is linked to using the CommandCompatibility trait. If I remove it, the profiling doesn't throw an exception anymore.
I see that trait was introduced in PR #402 by @derrabus but I can't understand its purpose... the covariance allows us to add the return type, without the need for a check.

@derrabus
Copy link
Member

I can't understand its purpose... the covariance allows us to add the return type, without the need for a check.

Adding a return type to a non-final class is a breaking change. On 4.0.x, the trait is gone already.

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

No branches or pull requests

2 participants