Skip to content

Commit 289ce2d

Browse files
authored
Merge pull request #3076 from stof/prepare_major_version
Prepare the major version
2 parents ae4ce46 + 5ead80e commit 289ce2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+44
-334
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"extra": {
6464
"branch-alias": {
65-
"dev-master": "3.x-dev"
65+
"dev-master": "4.x-dev"
6666
}
6767
},
6868
"autoload": {

docs/index.rst

+3-41
Original file line numberDiff line numberDiff line change
@@ -216,44 +216,6 @@ this to start:
216216
}
217217
}
218218
219-
c) CouchDB User class
220-
.....................
221-
222-
.. note::
223-
Support for the CouchDB ODM is deprecated as the Doctrine CouchDB ODM is unmaintained.
224-
225-
If you're persisting your users via the Doctrine CouchDB ODM, then your ``User``
226-
class should live in the ``CouchDocument`` namespace of your bundle and look
227-
like this to start:
228-
229-
.. code-block:: php
230-
231-
<?php
232-
// src/AppBundle/CouchDocument/User.php
233-
234-
namespace AppBundle\CouchDocument;
235-
236-
use FOS\UserBundle\Model\User as BaseUser;
237-
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;
238-
239-
/**
240-
* @CouchDB\Document
241-
*/
242-
class User extends BaseUser
243-
{
244-
/**
245-
* @CouchDB\Id
246-
*/
247-
protected $id;
248-
249-
public function __construct()
250-
{
251-
parent::__construct();
252-
// your own logic
253-
}
254-
}
255-
256-
257219
Step 4: Configure your application's security.yml
258220
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259221

@@ -351,7 +313,7 @@ of datastore you are using.
351313
352314
# app/config/config.yml
353315
fos_user:
354-
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'custom'
316+
db_driver: orm # other valid values are 'mongodb' and 'custom'
355317
firewall_name: main
356318
user_class: AppBundle\Entity\User
357319
from_email:
@@ -362,7 +324,7 @@ of datastore you are using.
362324
363325
<!-- app/config/config.xml -->
364326
365-
<!-- other valid 'db-driver' values are 'mongodb', 'couchdb' and 'custom' -->
327+
<!-- other valid 'db-driver' values are 'mongodb' and 'custom' -->
366328
<fos_user:config
367329
db-driver="orm"
368330
firewall-name="main"
@@ -371,7 +333,7 @@ of datastore you are using.
371333
372334
Only four configuration's nodes are required to use the bundle:
373335

374-
* The type of datastore you are using (``orm``, ``mongodb``, ``couchdb`` or ``custom```).
336+
* The type of datastore you are using (``orm``, ``mongodb`` or ``custom```).
375337
* The firewall name which you configured in Step 4.
376338
* The fully qualified class name (FQCN) of the ``User`` class which you created in Step 3.
377339
* The default email address to use when the bundle send a registration confirmation to the user.

docs/user_manager.rst

-8
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ of ``FOS\UserBundle\Doctrine\UserManager``.
1313
If you configure the ``db_driver`` option to ``mongodb``, this service is an
1414
instance of ``FOS\UserBundle\Doctrine\UserManager``.
1515

16-
If you configure the ``db_driver`` option to ``couchdb``, this service is an
17-
instance of ``FOS\UserBundle\Doctrine\UserManager``.
18-
1916
Accessing the User Manager service
2017
----------------------------------
2118

@@ -148,8 +145,3 @@ SecurityBundle integration
148145

149146
The bundle provides several implementation of ``Symfony\Component\Security\Core\UserProviderInterface``
150147
on top of the ``UserManagerInterface``.
151-
152-
Although the built-in user managers also implement
153-
``Symfony\Component\Security\Core\User\UserProviderInterface``, using the
154-
UserManager as user provider is deprecated and will tbe removed in future
155-
versions. Use ``FOS\UserBundle\Security\UserProvider`` instead.

src/Command/ActivateUserCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
* @author Antoine Hérault <[email protected]>
2525
*
2626
* @internal
27-
*
28-
* @final
2927
*/
3028
#[AsCommand(name: 'fos:user:activate', description: 'Activate a user')]
31-
class ActivateUserCommand extends Command
29+
final class ActivateUserCommand extends Command
3230
{
3331
// BC with Symfony <5.3
3432
protected static $defaultName = 'fos:user:activate';

src/Command/ChangePasswordCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222

2323
/**
2424
* @internal
25-
*
26-
* @final
2725
*/
2826
#[AsCommand(name: 'fos:user:change-password', description: 'Change the password of a user.')]
29-
class ChangePasswordCommand extends Command
27+
final class ChangePasswordCommand extends Command
3028
{
3129
// BC with Symfony <5.3
3230
protected static $defaultName = 'fos:user:change-password';

src/Command/CreateUserCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@
2727
* @author Luis Cordova <[email protected]>
2828
*
2929
* @internal
30-
*
31-
* @final
3230
*/
3331
#[AsCommand(name: 'fos:user:create', description: 'Create a user.')]
34-
class CreateUserCommand extends Command
32+
final class CreateUserCommand extends Command
3533
{
3634
// BC with Symfony <5.3
3735
protected static $defaultName = 'fos:user:create';

src/Command/DeactivateUserCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
* @author Antoine Hérault <[email protected]>
2525
*
2626
* @internal
27-
*
28-
* @final
2927
*/
3028
#[AsCommand(name: 'fos:user:deactivate', description: 'Deactivate a user')]
31-
class DeactivateUserCommand extends Command
29+
final class DeactivateUserCommand extends Command
3230
{
3331
// BC with Symfony <5.3
3432
protected static $defaultName = 'fos:user:deactivate';

src/Command/DemoteUserCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
* @author Lenar Lõhmus <[email protected]>
2121
*
2222
* @internal
23-
*
24-
* @final
2523
*/
2624
#[AsCommand(name: 'fos:user:demote', description: 'Demote a user by removing a role')]
27-
class DemoteUserCommand extends RoleCommand
25+
final class DemoteUserCommand extends RoleCommand
2826
{
2927
// BC with Symfony <5.3
3028
protected static $defaultName = 'fos:user:demote';

src/Command/PromoteUserCommand.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
* @author Lenar Lõhmus <[email protected]>
2323
*
2424
* @internal
25-
*
26-
* @final
2725
*/
2826
#[AsCommand(name: 'fos:user:promote', description: 'Promotes a user by adding a role')]
29-
class PromoteUserCommand extends RoleCommand
27+
final class PromoteUserCommand extends RoleCommand
3028
{
3129
// BC with Symfony <5.3
3230
protected static $defaultName = 'fos:user:promote';

src/Controller/ChangePasswordController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
*
3232
* @author Thibault Duplessis <[email protected]>
3333
* @author Christophe Coevoet <[email protected]>
34-
*
35-
* @final
3634
*/
37-
class ChangePasswordController extends AbstractController
35+
final class ChangePasswordController extends AbstractController
3836
{
3937
private $eventDispatcher;
4038
private $formFactory;

src/Controller/ProfileController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
* Controller managing the user profile.
3131
*
3232
* @author Christophe Coevoet <[email protected]>
33-
*
34-
* @final
3533
*/
36-
class ProfileController extends AbstractController
34+
final class ProfileController extends AbstractController
3735
{
3836
private $eventDispatcher;
3937
private $formFactory;

src/Controller/RegistrationController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
*
3434
* @author Thibault Duplessis <[email protected]>
3535
* @author Christophe Coevoet <[email protected]>
36-
*
37-
* @final
3836
*/
39-
class RegistrationController extends AbstractController
37+
final class RegistrationController extends AbstractController
4038
{
4139
private $eventDispatcher;
4240
private $formFactory;

src/Controller/ResettingController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@
3232
*
3333
* @author Thibault Duplessis <[email protected]>
3434
* @author Christophe Coevoet <[email protected]>
35-
*
36-
* @final
3735
*/
38-
class ResettingController extends AbstractController
36+
final class ResettingController extends AbstractController
3937
{
4038
private $eventDispatcher;
4139
private $formFactory;

src/Controller/SecurityController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
*
2222
* @author Thibault Duplessis <[email protected]>
2323
* @author Christophe Coevoet <[email protected]>
24-
*
25-
* @final
2624
*/
27-
class SecurityController extends AbstractController
25+
final class SecurityController extends AbstractController
2826
{
2927
private $authenticationUtils;
3028
private $tokenManager;

src/DependencyInjection/Compiler/CheckForSessionPass.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
* @author Ryan Weaver <[email protected]>
2222
*
2323
* @internal
24-
*
25-
* @final
2624
*/
27-
class CheckForSessionPass implements CompilerPassInterface
25+
final class CheckForSessionPass implements CompilerPassInterface
2826
{
2927
public function process(ContainerBuilder $container): void
3028
{

src/DependencyInjection/Compiler/CheckForSwiftMailerPass.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
* @author Ryan Weaver <[email protected]>
2222
*
2323
* @internal
24-
*
25-
* @final
2624
*/
27-
class CheckForSwiftMailerPass implements CompilerPassInterface
25+
final class CheckForSwiftMailerPass implements CompilerPassInterface
2826
{
2927
public function process(ContainerBuilder $container): void
3028
{

src/DependencyInjection/Compiler/InjectRememberMeServicesPass.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
* @author Vasily Khayrulin <[email protected]>
2222
*
2323
* @internal
24-
*
25-
* @final
2624
*/
27-
class InjectRememberMeServicesPass implements CompilerPassInterface
25+
final class InjectRememberMeServicesPass implements CompilerPassInterface
2826
{
2927
public function process(ContainerBuilder $container): void
3028
{

src/DependencyInjection/Compiler/InjectUserCheckerPass.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
* @author Gocha Ossinkine <[email protected]>
2222
*
2323
* @internal
24-
*
25-
* @final
2624
*/
27-
class InjectUserCheckerPass implements CompilerPassInterface
25+
final class InjectUserCheckerPass implements CompilerPassInterface
2826
{
2927
public function process(ContainerBuilder $container): void
3028
{

src/DependencyInjection/Compiler/ValidationPass.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
* @author Christophe Coevoet <[email protected]>
2121
*
2222
* @internal
23-
*
24-
* @final
2523
*/
26-
class ValidationPass implements CompilerPassInterface
24+
final class ValidationPass implements CompilerPassInterface
2725
{
2826
public function process(ContainerBuilder $container): void
2927
{

src/DependencyInjection/Configuration.php

+2-12
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@
2525
* @author Christophe Coevoet <[email protected]>
2626
*
2727
* @internal
28-
*
29-
* @final
3028
*/
31-
class Configuration implements ConfigurationInterface
29+
final class Configuration implements ConfigurationInterface
3230
{
3331
public function getConfigTreeBuilder(): TreeBuilder
3432
{
3533
$treeBuilder = new TreeBuilder('fos_user');
3634
$rootNode = $treeBuilder->getRootNode();
3735

38-
$supportedDrivers = ['orm', 'mongodb', 'couchdb', 'custom'];
36+
$supportedDrivers = ['orm', 'mongodb', 'custom'];
3937

4038
$rootNode
4139
->children()
@@ -44,14 +42,6 @@ public function getConfigTreeBuilder(): TreeBuilder
4442
->ifNotInArray($supportedDrivers)
4543
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode($supportedDrivers))
4644
->end()
47-
->validate()
48-
->ifInArray(['couchdb'])
49-
->then(function ($v) {
50-
trigger_deprecation('friendsofsymfony/user-bundle', '3.3.0', 'The CouchDB ODM integration is deprecated because the CouchDB ODM itself is unmaintained.');
51-
52-
return $v;
53-
})
54-
->end()
5545
->cannotBeOverwritten()
5646
->isRequired()
5747
->cannotBeEmpty()

src/DependencyInjection/FOSUserExtension.php

+3-13
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616
use Symfony\Component\Config\FileLocator;
1717
use Symfony\Component\DependencyInjection\Alias;
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
19+
use Symfony\Component\DependencyInjection\Extension\Extension;
1920
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2021
use Symfony\Component\DependencyInjection\Reference;
21-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2222

2323
/**
2424
* @internal
25-
*
26-
* @final
2725
*/
28-
class FOSUserExtension extends Extension
26+
final class FOSUserExtension extends Extension
2927
{
3028
/**
31-
* @var array<string, array{registry: string, tag: string, listener_class?: string}>
29+
* @var array<string, array{registry: string, tag: string}>
3230
*/
3331
private static $doctrineDrivers = [
3432
'orm' => [
@@ -39,11 +37,6 @@ class FOSUserExtension extends Extension
3937
'registry' => 'doctrine_mongodb',
4038
'tag' => 'doctrine_mongodb.odm.event_listener',
4139
],
42-
'couchdb' => [
43-
'registry' => 'doctrine_couchdb',
44-
'tag' => 'doctrine_couchdb.event_listener',
45-
'listener_class' => 'FOS\UserBundle\Doctrine\CouchDB\UserListener',
46-
],
4740
];
4841

4942
private bool $mailerNeeded = false;
@@ -99,9 +92,6 @@ public function load(array $configs, ContainerBuilder $container): void
9992
$listenerDefinition = $container->getDefinition('fos_user.user_listener');
10093
$listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag'], ['event' => 'prePersist']);
10194
$listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag'], ['event' => 'preUpdate']);
102-
if (isset(self::$doctrineDrivers[$config['db_driver']]['listener_class'])) {
103-
$listenerDefinition->setClass(self::$doctrineDrivers[$config['db_driver']]['listener_class']);
104-
}
10595
}
10696

10797
if ($config['use_username_form_type']) {

0 commit comments

Comments
 (0)