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

Fix SF62 / SF63 deprecations (doctrine subscriber deprecated) #738

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raziel057
Copy link
Contributor

@raziel057 raziel057 commented Aug 8, 2023

Fix deprecation raised when using doctrine/doctrine-bundle starting from v2.10 (see doctrine/DoctrineBundle@656beec).

On my test suite (~400 tests) the deprecation is raised 7497x:

Remaining indirect deprecation notices (7497x)

833x: Since symfony/doctrine-bridge 6.3: Registering "Knp\DoctrineBehaviors\EventSubscriber\BlameableEventSubscriber" as a Doctrine subscriber is deprecated. Regisr it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.
...
833x: Since symfony/doctrine-bridge 6.3: Registering "Knp\DoctrineBehaviors\EventSubscriber\LoggableEventSubscriber" as a Doctrine subscriber is deprecated. Regisr it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.
...
833x: Since symfony/doctrine-bridge 6.3: Registering "Knp\DoctrineBehaviors\EventSubscriber\SluggableEventSubscriber" as a Doctrine subscriber is deprecated. Regisr it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.
Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead

The test suite have been run locally after the change and I could fix :

image

Fix first part of #737

@raziel057 raziel057 changed the title Fix SF63 deprecations (doctrine subscriber deprecated) Fix SF62 / SF63 deprecations (doctrine subscriber deprecated) Aug 10, 2023
@SimonVanacco
Copy link

Is there any plans to merge this PR? The code looks good and it would prevent an issue with Symfony 7 in november !

If there's anything to do to help let me know

@raziel057
Copy link
Contributor Author

@SimonVanacco Hello, while waiting for the integration of PR for the fixes of deprecations on PHP 8.2 and SF6.3 you can try to reference my repository. Let me know if all is fine:

"repositories" : [{
	"type" : "vcs",
	"url" : "https://github.com/raziel057/DoctrineBehaviors"
}],
"require" : {
    ...
    "knplabs/doctrine-behaviors": "dev-master",
    ....
}

@tacman
Copy link

tacman commented Sep 15, 2023

Thanks, @raziel057, the deprecation errors were filling the logs and making it difficult to see the important errors.

BTW, here's a CLI way of using your fork.

composer config repositories.doctrine_behaviors '{"type": "vcs", "url": "https://github.com/raziel057/DoctrineBehaviors"}'
composer req knplabs/doctrine-behaviors:dev-master

@SimonVanacco
Copy link

@SimonVanacco Hello, while waiting for the integration of PR for the fixes of deprecations on PHP 8.2 and SF6.3 you can try to reference my repository. Let me know if all is fine:

"repositories" : [{
	"type" : "vcs",
	"url" : "https://github.com/raziel057/DoctrineBehaviors"
}],
"require" : {
    ...
    "knplabs/doctrine-behaviors": "dev-master",
    ....
}

I tested a bit and had zero issues so far - and the deprecations were indeed gone ! Nice work !

@tonyaxo
Copy link

tonyaxo commented Dec 7, 2023

@TomasVotruba could you please review and merge this PR?

@garak
Copy link
Contributor

garak commented Feb 9, 2024

Gentle bump

@benoit-outsourcify
Copy link

Hi, any news?

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