From 8b32136ecebd046d3be4a823c2bc0a28f29b8064 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:38:50 +0100 Subject: [PATCH 01/14] [Composer] Bumped Symfony packages requirements to ^6.4 --- composer.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 6c253ce..de436a3 100644 --- a/composer.json +++ b/composer.json @@ -26,19 +26,19 @@ "ibexa/core": "~5.0.x-dev", "ibexa/notifications": "~5.0.x-dev", "jms/translation-bundle": "^1.5", - "symfony/config": "^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/event-dispatcher": "^5.0", - "symfony/form": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^5.0", - "symfony/options-resolver": "^5.0", - "symfony/routing": "^5.0", - "symfony/security-core": "^5.0", - "symfony/security-http": "^5.0", - "symfony/translation": "^5.0", - "symfony/validator": "^5.0", + "symfony/config": "^6.4", + "symfony/dependency-injection": "^6.4", + "symfony/event-dispatcher": "^6.4", + "symfony/form": "^6.4", + "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", + "symfony/intl": "^6.4", + "symfony/options-resolver": "^6.4", + "symfony/routing": "^6.4", + "symfony/security-core": "^6.4", + "symfony/security-http": "^6.4", + "symfony/translation": "^6.4", + "symfony/validator": "^6.4", "twig/twig": "^3.0" }, "require-dev": { @@ -55,8 +55,8 @@ "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-symfony": "^1.3", "phpunit/phpunit": "^9.6", - "symfony/phpunit-bridge": "^5.3", - "symfony/proxy-manager-bridge": "^5.0" + "symfony/phpunit-bridge": "^6.4", + "symfony/proxy-manager-bridge": "^6.4" }, "scripts": { "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", From a386a2b3ef04d748a9e7dc8db8c07d36e4c691eb Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 14:46:04 +0100 Subject: [PATCH 02/14] [Composer] Bumped jms/translation-bundle to ^2.4 for Symfony 6 compat. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index de436a3..a892769 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "ibexa/content-forms": "~5.0.x-dev", "ibexa/core": "~5.0.x-dev", "ibexa/notifications": "~5.0.x-dev", - "jms/translation-bundle": "^1.5", + "jms/translation-bundle": "^2.4", "symfony/config": "^6.4", "symfony/dependency-injection": "^6.4", "symfony/event-dispatcher": "^6.4", From 20ca33fd66343430954968f9f783ec6fa8912235 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:03:00 +0100 Subject: [PATCH 03/14] Aligned Symfony Bundle extension points code with Symfony 6 --- .../Compiler/UserSetting/FormMapperPass.php | 2 +- .../Compiler/UserSetting/ValueDefinitionPass.php | 2 +- src/bundle/DependencyInjection/IbexaUserExtension.php | 5 +---- src/bundle/IbexaUserBundle.php | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/bundle/DependencyInjection/Compiler/UserSetting/FormMapperPass.php b/src/bundle/DependencyInjection/Compiler/UserSetting/FormMapperPass.php index d45e437..ff4ab20 100644 --- a/src/bundle/DependencyInjection/Compiler/UserSetting/FormMapperPass.php +++ b/src/bundle/DependencyInjection/Compiler/UserSetting/FormMapperPass.php @@ -25,7 +25,7 @@ class FormMapperPass implements CompilerPassInterface * @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException * @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException; */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition(FormMapperRegistry::class)) { return; diff --git a/src/bundle/DependencyInjection/Compiler/UserSetting/ValueDefinitionPass.php b/src/bundle/DependencyInjection/Compiler/UserSetting/ValueDefinitionPass.php index 072b704..cf93223 100644 --- a/src/bundle/DependencyInjection/Compiler/UserSetting/ValueDefinitionPass.php +++ b/src/bundle/DependencyInjection/Compiler/UserSetting/ValueDefinitionPass.php @@ -29,7 +29,7 @@ class ValueDefinitionPass implements CompilerPassInterface * @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException * @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition(ValueDefinitionRegistry::class)) { return; diff --git a/src/bundle/DependencyInjection/IbexaUserExtension.php b/src/bundle/DependencyInjection/IbexaUserExtension.php index bffebe4..0ab0d46 100644 --- a/src/bundle/DependencyInjection/IbexaUserExtension.php +++ b/src/bundle/DependencyInjection/IbexaUserExtension.php @@ -17,7 +17,7 @@ class IbexaUserExtension extends Extension implements PrependExtensionInterface { /** - * {@inheritdoc} + * @throws \Exception */ public function load(array $configs, ContainerBuilder $container): void { @@ -34,9 +34,6 @@ public function load(array $configs, ContainerBuilder $container): void } } - /** - * {@inheritdoc} - */ public function prepend(ContainerBuilder $container): void { $this->prependJMSTranslation($container); diff --git a/src/bundle/IbexaUserBundle.php b/src/bundle/IbexaUserBundle.php index f05f9b9..2edd4a3 100644 --- a/src/bundle/IbexaUserBundle.php +++ b/src/bundle/IbexaUserBundle.php @@ -24,10 +24,7 @@ class IbexaUserBundle extends Bundle { - /** - * {@inheritdoc} - */ - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { /** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $core */ $core = $container->getExtension('ibexa'); From b28d40d7953bf21173c8f1993b5dcbe99d82db8d Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:03:34 +0100 Subject: [PATCH 04/14] Refactored Legacy naming for Ibexa Core default settings --- src/bundle/IbexaUserBundle.php | 2 +- ...m_default_settings.yaml => ibexa_core_default_settings.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/bundle/Resources/config/{ezplatform_default_settings.yaml => ibexa_core_default_settings.yaml} (100%) diff --git a/src/bundle/IbexaUserBundle.php b/src/bundle/IbexaUserBundle.php index 2edd4a3..4e92ddd 100644 --- a/src/bundle/IbexaUserBundle.php +++ b/src/bundle/IbexaUserBundle.php @@ -44,6 +44,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new UserSetting\FormMapperPass()); $container->addCompilerPass(new SecurityPass()); - $core->addDefaultSettings(__DIR__ . '/Resources/config', ['ezplatform_default_settings.yaml']); + $core->addDefaultSettings(__DIR__ . '/Resources/config', ['ibexa_core_default_settings.yaml']); } } diff --git a/src/bundle/Resources/config/ezplatform_default_settings.yaml b/src/bundle/Resources/config/ibexa_core_default_settings.yaml similarity index 100% rename from src/bundle/Resources/config/ezplatform_default_settings.yaml rename to src/bundle/Resources/config/ibexa_core_default_settings.yaml From d3ea3e6288dfb982cc17ad5c401b3ab4d742b6f0 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:04:36 +0100 Subject: [PATCH 05/14] [Composer] Dropped cyclic dependency on ibexa/fieldtype-richtext --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index a892769..19f932f 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,6 @@ "twig/twig": "^3.0" }, "require-dev": { - "ibexa/ci-scripts": "^0.2@dev", "ibexa/code-style": "~2.0.0", "ibexa/design-engine": "~5.0.x-dev", "ibexa/doctrine-schema": "~5.0.x-dev", From 78aac3dd535e4f0738b522d29a85d7ac32b3f382 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:14:32 +0100 Subject: [PATCH 06/14] [Security] Aligned DefaultAuthenticationFailureHandler with Symfony 6 --- .../Authentication/DefaultAuthenticationFailureHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bundle/Security/Authentication/DefaultAuthenticationFailureHandler.php b/src/bundle/Security/Authentication/DefaultAuthenticationFailureHandler.php index 971de72..ee0b03b 100644 --- a/src/bundle/Security/Authentication/DefaultAuthenticationFailureHandler.php +++ b/src/bundle/Security/Authentication/DefaultAuthenticationFailureHandler.php @@ -10,12 +10,13 @@ use Ibexa\Contracts\Core\Repository\Exceptions\PasswordInUnsupportedFormatException; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler as HttpDefaultAuthenticationFailureHandler; final class DefaultAuthenticationFailureHandler extends HttpDefaultAuthenticationFailureHandler { - public function onAuthenticationFailure(Request $request, AuthenticationException $exception) + public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response { if ($exception instanceof PasswordInUnsupportedFormatException) { $resetPasswordUrl = $this->httpUtils->generateUri($request, 'ibexa.user.forgot_password.migration'); From fbb160d4b5cefcdf3c611b5b0c00cce07a161742 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:15:46 +0100 Subject: [PATCH 07/14] Upgraded Symfony Forms extension point code to Symfony 6 --- .../Loader/AvailableLocaleChoiceLoader.php | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/lib/Form/ChoiceList/Loader/AvailableLocaleChoiceLoader.php b/src/lib/Form/ChoiceList/Loader/AvailableLocaleChoiceLoader.php index bdb4bbc..5f7a9ee 100644 --- a/src/lib/Form/ChoiceList/Loader/AvailableLocaleChoiceLoader.php +++ b/src/lib/Form/ChoiceList/Loader/AvailableLocaleChoiceLoader.php @@ -10,6 +10,7 @@ use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; +use Symfony\Component\Form\ChoiceList\ChoiceListInterface; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; use Symfony\Component\Intl\Locales; use Symfony\Component\Validator\Constraints\Locale; @@ -17,22 +18,21 @@ class AvailableLocaleChoiceLoader implements ChoiceLoaderInterface { - // Acholi dialect is used by In-Context translation - // and should not be present on the list of available translations. - private const EXCLUDED_TRANSLATIONS = ['ach']; + /** + * @var string[] + * + * Acholi dialect is used by In-Context translation and should not be present on the list of available translations. + */ + private const array EXCLUDED_TRANSLATIONS = ['ach']; - /** @var \Symfony\Component\Validator\Validator\ValidatorInterface */ - private $validator; + private ValidatorInterface $validator; - /** @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface */ - private $configResolver; + private ConfigResolverInterface $configResolver; /** @var string[] */ - private $availableTranslations; + private array $availableTranslations; /** - * @param \Symfony\Component\Validator\Validator\ValidatorInterface $validator - * @param \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface $configResolver * @param string[] $availableTranslations */ public function __construct( @@ -45,6 +45,9 @@ public function __construct( $this->configResolver = $configResolver; } + /** + * @return array + */ public function getChoiceList(): array { $choices = []; @@ -62,12 +65,12 @@ public function getChoiceList(): array return $choices; } - public function loadChoiceList($value = null) + public function loadChoiceList(?callable $value = null): ChoiceListInterface { return new ArrayChoiceList($this->getChoiceList(), $value); } - public function loadChoicesForValues(array $values, $value = null) + public function loadChoicesForValues(array $values, ?callable $value = null): array { // Optimize $values = array_filter($values); @@ -78,7 +81,7 @@ public function loadChoicesForValues(array $values, $value = null) return $this->loadChoiceList($value)->getChoicesForValues($values); } - public function loadValuesForChoices(array $choices, $value = null) + public function loadValuesForChoices(array $choices, ?callable $value = null): array { // Optimize $choices = array_filter($choices); From c9c4e7e1d272c8fb80ecc5388cbd5a3ce93d38b2 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:16:26 +0100 Subject: [PATCH 08/14] Improved DateTime Formatter code quality --- src/lib/UserSetting/DateTimeFormat/Formatter.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/lib/UserSetting/DateTimeFormat/Formatter.php b/src/lib/UserSetting/DateTimeFormat/Formatter.php index d719879..3af4902 100644 --- a/src/lib/UserSetting/DateTimeFormat/Formatter.php +++ b/src/lib/UserSetting/DateTimeFormat/Formatter.php @@ -13,14 +13,8 @@ class Formatter implements FormatterInterface { - /** @var \IntlDateFormatter */ - private $formatter; - - /** - * @param string $locale - * @param string $timezone - * @param string $format - */ + private IntlDateFormatter $formatter; + public function __construct(string $locale, string $timezone, string $format) { $this->formatter = new IntlDateFormatter( @@ -33,9 +27,6 @@ public function __construct(string $locale, string $timezone, string $format) ); } - /** - * {@inheritdoc} - */ public function format(DateTimeInterface $datetime, string $timezone = null): string { if ($timezone) { @@ -44,6 +35,9 @@ public function format(DateTimeInterface $datetime, string $timezone = null): st } $result = $this->formatter->format($datetime); + if (false === $result) { + throw new \LogicException('Failed to format date time'); + } if ($timezone) { $this->formatter->setTimeZone($currentTimezone); From 8854309c27dcff2122c56cd654d75a8076ee7842 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:16:56 +0100 Subject: [PATCH 09/14] Aligned Symfony Validator extension point code with Symfony 6 --- src/lib/Validator/Constraints/PasswordValidator.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/Validator/Constraints/PasswordValidator.php b/src/lib/Validator/Constraints/PasswordValidator.php index 2db3492..e5a3ebd 100644 --- a/src/lib/Validator/Constraints/PasswordValidator.php +++ b/src/lib/Validator/Constraints/PasswordValidator.php @@ -16,15 +16,19 @@ class PasswordValidator extends ConstraintValidator { - /** @var \Ibexa\Contracts\Core\Repository\UserService */ - private $userService; + private UserService $userService; public function __construct(UserService $userService) { $this->userService = $userService; } - public function validate($value, Constraint $constraint): void + /** + * @param \Ibexa\User\Validator\Constraints\Password $constraint + * + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException + */ + public function validate(mixed $value, Constraint $constraint): void { if (!\is_string($value) || empty($value)) { return; From 4436ba70326f285195a66c5d591c198531c4ef65 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:18:53 +0100 Subject: [PATCH 10/14] [PHPStan] Removed resolved issues from the baseline --- phpstan-baseline.neon | 70 ------------------------------------------- 1 file changed, 70 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e7981c9..e6f2a29 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -85,16 +85,6 @@ parameters: count: 1 path: src/bundle/Controller/UserSettingsController.php - - - message: "#^Method Ibexa\\\\Bundle\\\\User\\\\DependencyInjection\\\\Compiler\\\\UserSetting\\\\FormMapperPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/UserSetting/FormMapperPass.php - - - - message: "#^Method Ibexa\\\\Bundle\\\\User\\\\DependencyInjection\\\\Compiler\\\\UserSetting\\\\ValueDefinitionPass\\:\\:process\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/DependencyInjection/Compiler/UserSetting/ValueDefinitionPass.php - - message: "#^Method Ibexa\\\\Bundle\\\\User\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\ChangePassword\\:\\:addSemanticConfig\\(\\) has no return type specified\\.$#" count: 1 @@ -195,11 +185,6 @@ parameters: count: 1 path: src/bundle/DependencyInjection/Configuration/Parser/UserRegistration.php - - - message: "#^Method Ibexa\\\\Bundle\\\\User\\\\IbexaUserBundle\\:\\:build\\(\\) has no return type specified\\.$#" - count: 1 - path: src/bundle/IbexaUserBundle.php - - message: "#^Method Ibexa\\\\Contracts\\\\User\\\\Invitation\\\\Persistence\\\\Gateway\\:\\:getInvitation\\(\\) has no return type specified\\.$#" count: 1 @@ -280,11 +265,6 @@ parameters: count: 1 path: src/lib/ExceptionHandler/NullActionResultHandler.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\ChoiceList\\\\Loader\\\\AvailableLocaleChoiceLoader\\:\\:getChoiceList\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Form/ChoiceList/Loader/AvailableLocaleChoiceLoader.php - - message: "#^Method Ibexa\\\\User\\\\Form\\\\ChoiceList\\\\Loader\\\\UserGroupsChoiceLoader\\:\\:loadChoices\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -505,11 +485,6 @@ parameters: count: 1 path: src/lib/Form/Type/Invitation/UserInvitationType.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\Invitation\\\\UserInvitationType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Form/Type/Invitation/UserInvitationType.php - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordChangeType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 @@ -520,21 +495,11 @@ parameters: count: 1 path: src/lib/Form/Type/UserPasswordForgotType.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordForgotType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Form/Type/UserPasswordForgotType.php - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordForgotWithLoginType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 path: src/lib/Form/Type/UserPasswordForgotWithLoginType.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordForgotWithLoginType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Form/Type/UserPasswordForgotWithLoginType.php - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordResetType\\:\\:buildForm\\(\\) has no return type specified\\.$#" count: 1 @@ -545,11 +510,6 @@ parameters: count: 1 path: src/lib/Form/Type/UserRegisterType.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserRegisterType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Form/Type/UserRegisterType.php - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserRegisterType\\:\\:getName\\(\\) has no return type specified\\.$#" count: 1 @@ -560,11 +520,6 @@ parameters: count: 1 path: src/lib/Form/Type/UserSettingUpdateType.php - - - message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserSettingUpdateType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Form/Type/UserSettingUpdateType.php - - message: "#^Method Ibexa\\\\User\\\\Invitation\\\\DomainMapper\\:\\:mapRoleLimitation\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" count: 1 @@ -675,11 +630,6 @@ parameters: count: 1 path: src/lib/Templating/Twig/DateTimeExtension.php - - - message: "#^Method Ibexa\\\\User\\\\UserSetting\\\\DateTimeFormat\\\\Formatter\\:\\:format\\(\\) should return string but returns bool\\|string\\.$#" - count: 1 - path: src/lib/UserSetting/DateTimeFormat/Formatter.php - - message: "#^Cannot call method getDateFormat\\(\\) on Ibexa\\\\User\\\\UserSetting\\\\Setting\\\\Value\\\\DateTimeFormat\\|null\\.$#" count: 1 @@ -850,26 +800,11 @@ parameters: count: 1 path: src/lib/Validator/Constraints/EmailInvitationValidator.php - - - message: "#^Method Ibexa\\\\User\\\\Validator\\\\Constraints\\\\EmailInvitationValidator\\:\\:validate\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Validator/Constraints/EmailInvitationValidator.php - - message: "#^Method Ibexa\\\\User\\\\Validator\\\\Constraints\\\\Password\\:\\:getTargets\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 path: src/lib/Validator/Constraints/Password.php - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Validator\\\\Constraint\\:\\:\\$contentType\\.$#" - count: 1 - path: src/lib/Validator/Constraints/PasswordValidator.php - - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Validator\\\\Constraint\\:\\:\\$user\\.$#" - count: 1 - path: src/lib/Validator/Constraints/PasswordValidator.php - - message: "#^Property Ibexa\\\\User\\\\Validator\\\\Constraints\\\\UserPassword\\:\\:\\$message has no type specified\\.$#" count: 1 @@ -890,11 +825,6 @@ parameters: count: 1 path: src/lib/Validator/Constraints/UserPasswordValidator.php - - - message: "#^Method Ibexa\\\\User\\\\Validator\\\\Constraints\\\\UserPasswordValidator\\:\\:validate\\(\\) has no return type specified\\.$#" - count: 1 - path: src/lib/Validator/Constraints/UserPasswordValidator.php - - message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#" count: 1 From c12f31a54889b4c92c559d9e3df5b3639d18691d Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:55:47 +0100 Subject: [PATCH 11/14] [DI] Autoconfigured controllers for Symfony 6 --- src/bundle/Resources/config/services/controllers.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bundle/Resources/config/services/controllers.yaml b/src/bundle/Resources/config/services/controllers.yaml index a382e57..7d4cdd6 100644 --- a/src/bundle/Resources/config/services/controllers.yaml +++ b/src/bundle/Resources/config/services/controllers.yaml @@ -28,6 +28,7 @@ services: Ibexa\Bundle\User\Controller\UserRegisterController: autowire: true + autoconfigure: true arguments: $userActionDispatcher: '@Ibexa\ContentForms\Form\ActionDispatcher\UserDispatcher' tags: [controller.service_arguments] @@ -47,4 +48,5 @@ services: Ibexa\Bundle\User\Controller\UserInvitationController: autowire: true + autoconfigure: true tags: [ controller.service_arguments ] From 6739beb20b40b957e40fef2ebffa56ca16805ee8 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 15:57:39 +0100 Subject: [PATCH 12/14] [PHPUnit] Migrated configuration from a deprecated schema --- phpunit.xml | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index f4fda88..9258b3b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,11 +1,17 @@ - + + + + + src + + + tests/bundle/ + tests/lib/ + + tests/bundle/ @@ -18,19 +24,10 @@ - - + + - - - src - - tests/bundle/ - tests/lib/ - - - From c074fa875df7c92f1b66af05bc8e2a21d142a511 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Thu, 16 Jan 2025 14:45:29 +0100 Subject: [PATCH 13/14] fixed container injection into controllers, as more services are marked as private --- .../config/services/controllers.yaml | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/bundle/Resources/config/services/controllers.yaml b/src/bundle/Resources/config/services/controllers.yaml index 7d4cdd6..655bf16 100644 --- a/src/bundle/Resources/config/services/controllers.yaml +++ b/src/bundle/Resources/config/services/controllers.yaml @@ -1,52 +1,40 @@ services: + _defaults: + autowire: true + autoconfigure: true + tags: + - controller.service_arguments + - container.service_subscriber Ibexa\Bundle\User\Controller\: resource: "../../Controller/*" exclude: "../../Controller/{Controller}" parent: Ibexa\Bundle\User\Controller\Controller + tags: + - controller.service_arguments + - container.service_subscriber Ibexa\Bundle\User\Controller\Controller: calls: - - [setContainer, ["@service_container"]] + - [setContainer , ['@Psr\Container\ContainerInterface']] - [performAccessCheck, []] - tags: [controller.service_arguments] Ibexa\Bundle\User\Controller\PasswordResetController: - autowire: true calls: - - [setContainer, ['@service_container']] - tags: [controller.service_arguments] + - [setContainer , ['@Psr\Container\ContainerInterface']] Ibexa\Bundle\User\Controller\PasswordChangeController: - autowire: true arguments: $siteAccessGroups: '%ibexa.site_access.groups%' - calls: - - [setContainer, ['@service_container']] - - [performAccessCheck, []] - tags: [controller.service_arguments] Ibexa\Bundle\User\Controller\UserRegisterController: - autowire: true - autoconfigure: true arguments: $userActionDispatcher: '@Ibexa\ContentForms\Form\ActionDispatcher\UserDispatcher' - tags: [controller.service_arguments] - Ibexa\Bundle\User\Controller\UserSettingsController: - autowire: true - calls: - - [ setContainer, [ '@service_container' ] ] - - [performAccessCheck, []] - tags: [controller.service_arguments] + Ibexa\Bundle\User\Controller\UserSettingsController: ~ Ibexa\Bundle\User\Controller\DefaultProfileImageController: - autowire: true calls: - - [ setContainer, [ '@service_container' ] ] - tags: [controller.service_arguments] + - [setContainer , ['@Psr\Container\ContainerInterface']] - Ibexa\Bundle\User\Controller\UserInvitationController: - autowire: true - autoconfigure: true - tags: [ controller.service_arguments ] + Ibexa\Bundle\User\Controller\UserInvitationController: ~ From 71374fceafa90da02cdf268e009fdfc8a86561a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Tue, 4 Feb 2025 15:21:06 +0100 Subject: [PATCH 14/14] Updated phpstan baseline --- phpstan-baseline.neon | 5 +++++ src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e6f2a29..741463d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -590,6 +590,11 @@ parameters: count: 1 path: src/lib/Invitation/Persistence/Mapper.php + - + message: "#^Method Ibexa\\\\User\\\\Pagination\\\\Pagerfanta\\\\UserSettingsAdapter\\:\\:getNbResults\\(\\) should return int\\<0, max\\> but returns int\\.$#" + count: 1 + path: src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php + - message: "#^Method Ibexa\\\\User\\\\Pagination\\\\Pagerfanta\\\\UserSettingsAdapter\\:\\:getSlice\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php b/src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php index cef1809..79a17a3 100644 --- a/src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php +++ b/src/lib/Pagination/Pagerfanta/UserSettingsAdapter.php @@ -11,6 +11,9 @@ use Ibexa\User\UserSetting\UserSettingService; use Pagerfanta\Adapter\AdapterInterface; +/** + * @phpstan-implements \Pagerfanta\Adapter\AdapterInterface<\Ibexa\User\UserSetting\UserSetting> + */ class UserSettingsAdapter implements AdapterInterface { /** @var \Ibexa\User\UserSetting\UserSettingService */