Skip to content

Commit 77c3e6f

Browse files
authored
EZP-30570: Upgrade ezsystems/ezplatform-user to use Symfony 4 components (#37)
* EZP-30570: Upgrade `ezsystems/ezplatform-user` to use Symfony 4 components * EZP-30570: Renamed all *.yml files to *.yaml * Added required tags to Controller service definitions * Aligned unit tests to PHPUnit 8 * Bumped PHPUnit version to 8.2
1 parent 9f2e275 commit 77c3e6f

File tree

14 files changed

+41
-20
lines changed

14 files changed

+41
-20
lines changed

composer.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,28 @@
1818
"minimum-stability": "dev",
1919
"prefer-stable": true,
2020
"require": {
21-
"php": ">=7.1",
22-
"symfony/symfony": "^3.4",
23-
"jms/translation-bundle": "^1.3.2",
21+
"php": "^7.3",
2422
"ezsystems/ezpublish-kernel": "^8.0@dev",
2523
"ezsystems/ezplatform-admin-ui": "^2.0@dev",
26-
"symfony/swiftmailer-bundle": "^3.0"
24+
"jms/translation-bundle": "^1.4",
25+
"symfony/dependency-injection": "^4.3",
26+
"symfony/http-kernel": "^4.3",
27+
"symfony/translation": "^4.3",
28+
"symfony/security": "^4.3",
29+
"symfony/http-foundation": "^4.3",
30+
"symfony/config": "^4.3",
31+
"symfony/options-resolver": "^4.3",
32+
"symfony/event-dispatcher": "^4.3",
33+
"symfony/intl": "^4.3",
34+
"symfony/validator": "^4.3",
35+
"symfony/form": "^4.3",
36+
"symfony/routing": "^4.3",
37+
"symfony/swiftmailer-bundle": "^3.2",
38+
"twig/twig": "^2.11"
2739
},
2840
"require-dev": {
29-
"phpunit/phpunit": "^7.0",
30-
"friendsofphp/php-cs-fixer": "~2.7.1"
41+
"friendsofphp/php-cs-fixer": "^2.15",
42+
"phpunit/phpunit": "^8.2"
3143
},
3244
"scripts": {
3345
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"

src/bundle/Controller/PasswordResetController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use eZ\Publish\API\Repository\UserService;
2626
use eZ\Publish\API\Repository\Values\User\UserTokenUpdateStruct;
2727
use Swift_Mailer;
28-
use Twig_Environment;
2928
use DateTime;
3029
use DateInterval;
3130
use Swift_Message;
31+
use Twig\Environment;
3232

3333
class PasswordResetController extends Controller
3434
{
@@ -41,7 +41,7 @@ class PasswordResetController extends Controller
4141
/** @var Swift_Mailer */
4242
private $mailer;
4343

44-
/** @var Twig_Environment */
44+
/** @var \Twig\Environment */
4545
private $twig;
4646

4747
/** @var string */
@@ -60,7 +60,7 @@ class PasswordResetController extends Controller
6060
* @param \EzSystems\EzPlatformUser\Form\Factory\FormFactory $formFactory
6161
* @param \eZ\Publish\API\Repository\UserService $userService
6262
* @param Swift_Mailer $mailer
63-
* @param Twig_Environment $twig
63+
* @param \Twig\Environment $twig
6464
* @param \EzSystems\EzPlatformAdminUi\Notification\TranslatableNotificationHandlerInterface $notificationHandler
6565
* @param \eZ\Publish\API\Repository\PermissionResolver $permissionResolver
6666
* @param string $tokenIntervalSpec
@@ -70,7 +70,7 @@ public function __construct(
7070
FormFactory $formFactory,
7171
UserService $userService,
7272
Swift_Mailer $mailer,
73-
Twig_Environment $twig,
73+
Environment $twig,
7474
TranslatableNotificationHandlerInterface $notificationHandler,
7575
PermissionResolver $permissionResolver,
7676
string $tokenIntervalSpec,

src/bundle/DependencyInjection/EzPlatformUserExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function load(array $configs, ContainerBuilder $container): void
2626
new FileLocator(__DIR__ . '/../Resources/config')
2727
);
2828

29-
$loader->load('services.yml');
29+
$loader->load('services.yaml');
3030
}
3131

3232
/**

src/bundle/EzPlatformUserBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function build(ContainerBuilder $container)
3636
$container->addCompilerPass(new UserSetting\FormMapperPass());
3737
$container->addCompilerPass(new UserSetting\ViewBuilderRegistryPass());
3838

39-
$core->addDefaultSettings(__DIR__ . '/Resources/config', ['ezplatform_default_settings.yml']);
39+
$core->addDefaultSettings(__DIR__ . '/Resources/config', ['ezplatform_default_settings.yaml']);
4040
}
4141
}

src/bundle/Resources/config/ezplatform_default_settings.yml renamed to src/bundle/Resources/config/ezplatform_default_settings.yaml

File renamed without changes.
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
imports:
2-
- { resource: services/controllers.yml }
3-
- { resource: services/validators.yml }
4-
- { resource: services/user_settings.yml }
5-
- { resource: services/forms.yml }
2+
- { resource: services/controllers.yaml }
3+
- { resource: services/validators.yaml }
4+
- { resource: services/user_settings.yaml }
5+
- { resource: services/forms.yaml }
66

77
services:
88
_defaults:
@@ -41,6 +41,10 @@ services:
4141
calls:
4242
- [setParam, ["contentTypeIdentifier", "%ezrepoforms.user_content_type_identifier%"]]
4343

44+
# Default implementations
45+
EzSystems\EzPlatformUser\ConfigResolver\RegistrationGroupLoader: '@EzSystems\EzPlatformUser\ConfigResolver\ConfigurableRegistrationGroupLoader'
46+
EzSystems\EzPlatformUser\ConfigResolver\RegistrationContentTypeLoader: '@EzSystems\EzPlatformUser\ConfigResolver\ConfigurableRegistrationContentTypeLoader'
47+
4448
EzSystems\EzPlatformUser\Form\DataMapper\UserRegisterMapper:
4549
calls:
4650
- [setParam, ["language", "@=service('ezpublish.config.resolver').getParameter('languages', null, null)[0]"]]

src/bundle/Resources/config/services/controllers.yml renamed to src/bundle/Resources/config/services/controllers.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ services:
66
parent: EzSystems\EzPlatformUserBundle\Controller\Controller
77

88
EzSystems\EzPlatformUserBundle\Controller\Controller:
9-
tags: [controller.service_arguments]
109
calls:
1110
- [setContainer, ["@service_container"]]
1211
- [performAccessCheck, []]
12+
tags: [controller.service_arguments]
1313

1414
EzSystems\EzPlatformUserBundle\Controller\PasswordResetController:
15-
tags: [controller.service_arguments]
1615
autowire: true
1716
calls:
1817
- [setContainer, ['@service_container']]
1918
arguments:
2019
$tokenIntervalSpec: '$security.token_interval_spec$'
2120
$forgotPasswordMail: '$user_forgot_password.templates.mail$'
21+
tags: [controller.service_arguments]
2222

2323
EzSystems\EzPlatformUserBundle\Controller\PasswordChangeController:
2424
autowire: true
@@ -27,13 +27,16 @@ services:
2727
calls:
2828
- [setContainer, ['@service_container']]
2929
- [performAccessCheck, []]
30+
tags: [controller.service_arguments]
3031

3132
EzSystems\EzPlatformUserBundle\Controller\UserRegisterController:
3233
autowire: true
3334
arguments:
3435
$userActionDispatcher: '@ezrepoforms.action_dispatcher.user'
36+
tags: [controller.service_arguments]
3537

3638
EzSystems\EzPlatformUserBundle\Controller\UserSettingsController:
3739
parent: EzSystems\EzPlatformAdminUiBundle\Controller\Controller
3840
arguments:
3941
$defaultPaginationLimit: '$pagination.user_settings_limit$'
42+
tags: [controller.service_arguments]

src/bundle/Resources/config/services/forms.yml renamed to src/bundle/Resources/config/services/forms.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
EzSystems\EzPlatformUser\Form\Type\:
88
resource: "../../../lib/Form/Type/*"
99

10+
EzSystems\EzPlatformUser\Form\Factory\FormFactory: ~
11+
1012
EzSystems\EzPlatformUser\Form\ChoiceList\Loader\AvailableLocaleChoiceLoader:
1113
arguments:
1214
$availableTranslations: '%available_translations%'

src/bundle/Resources/config/services/user_settings.yml renamed to src/bundle/Resources/config/services/user_settings.yaml

File renamed without changes.

0 commit comments

Comments
 (0)