8000 [DoctrineBridge] Fix deprecation message/documentation of implementin… · symfony/symfony@80d818f · GitHub
[go: up one dir, main page]

Skip to content

Commit 80d818f

Browse files
committed
[DoctrineBridge] Fix deprecation message/documentation of implementing UserProviderInterface using the entity provider
1 parent 9b9f1be commit 80d818f

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

UPGRADE-2.8.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,3 +658,8 @@ Routing
658658
// url generated in @router service
659659
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
660660
```
661+
662+
DoctrineBridge
663+
--------------
664+
* Deprecated using the entity provider with a Doctrine repository implementing `UserProviderInterface`.
665+
Make it implement `UserLoaderInterface` instead.

UPGRADE-3.0.md

Lines changed: 3 additions & 0 deletions
< 10000 td data-grid-cell-id="diff-a6640463107144149796f7d99fcc93f86a3b991be137b4b691de5b2819f3183c-207-210-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">207
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ UPGRADE FROM 2.x to 3.0
202202
closures, but the closure is now resolved in the type instead of in the
203203
loader.
204204

205+
* Using the entity provider with a Doctrine repository implementing `UserProviderInterface` is not supported anymore.
206+
You should make the repository implement `UserLoaderInterface` instead.
207+
205208
### EventDispatcher
206209

210
* The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface`

src/Symfony/Bridge/Doctrine/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
2.8.0
5+
-----
6+
7+
* deprecated using the entity provider with a Doctrine repository implementing UserProviderInterface
8+
* added UserLoaderInterface for loading users through Doctrine.
9+
410
2.7.0
511
-----
612

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function loadUserByUsername($username)
5555
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)));
5656
}
5757

58-
@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);
58+
@trigger_error('Having a Doctrine repository implementing Symfony\Component\Security\Core\User\UserProviderInterface for loading users is deprecated since version 2.8 and will not work in 3.0. Make the repository implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.', E_USER_DEPRECATED);
5959
}
6060

6161
$user = $repository->loadUserByUsername($username);

src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function testLoadUserByUsernameWithUserLoaderRepositoryAndWithoutProperty
8181

8282
/**
8383
* @group legacy
84+
* @expectedDeprecation Having a Doctrine repository implementing Symfony\Component\Security\Core\User\UserProviderInterface for loading users is deprecated since version 2.8 and will not work in 3.0. Make the repository implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.
8485
*/
8586
public function testLoadUserByUsernameWithUserProviderRepositoryAndWithoutProperty()
8687
{

0 commit comments

Comments
 (0)
0