8000 [DoctrineBridge] Fix deprecation message/documentation of implementing UserProviderInterface using the entity provider by chalasr · Pull Request #20540 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DoctrineBridge] Fix deprecation message/documentation of implementing UserProviderInterface using the entity provider #20540

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE-2.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,3 +658,8 @@ Routing
// url generated in @router service
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
```

DoctrineBridge
--------------
* Deprecated using the entity provider with a Doctrine repository implementing `UserProviderInterface`.
Make it implement `UserLoaderInterface` instead.
3 changes: 3 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ UPGRADE FROM 2.x to 3.0
closures, but the closure is now resolved in the type instead of in the
loader.

* Using the entity provider with a Doctrine repository implementing `UserProviderInterface` is not supported anymore.
You should make the repository implement `UserLoaderInterface` instead.

### EventDispatcher

* The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface`
Expand Down
6 changes: 6 additions & 0 deletions src/Symfony/Bridge/Doctrine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

2.8.0
-----

* deprecated using the entity provider with a Doctrine repository implementing UserProviderInterface
* added UserLoaderInterface for loading users through Doctrine.

2.7.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function loadUserByUsername($username)
throw new \InvalidArgumentException(sprintf('You must either make the "%s" entity Doctrine Repository ("%s") implement "Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface" or set the "property" option in the corresponding entity provider configuration.', $this->classOrAlias, get_class($repository)));
}

@trigger_error('Implementing loadUserByUsername from Symfony\Component\Security\Core\User\UserProviderInterface is deprecated since version 2.8 and will be removed in 3.0. Implement the Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.', E_USER_DEPRECATED);
@trigger_error('Implementing Symfony\Component\Security\Core\User\UserProviderInterface in a Doctrine repository when using the entity provider is deprecated since version 2.8 and will not be supported in 3.0. Make the repository implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.', E_USER_DEPRECATED);
}

$user = $repository->loadUserByUsername($username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function testLoadUserByUsernameWithUserLoaderRepositoryAndWithoutProperty

/**
* @group legacy
* @expectedDeprecation Implementing Symfony\Component\Security\Core\User\UserProviderInterface in a Doctrine repository when using the entity provider is deprecated since version 2.8 and will not be supported in 3.0. Make the repository implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.
*/
public function testLoadUserByUsernameWithUserProviderRepositoryAndWithoutProperty()
{
Expand Down
0