diff --git a/jsonapi_user_resources.info.yml b/jsonapi_user_resources.info.yml index 5a37ace8eaed8fb3125888a68abba4a114550764..e981de30aa0142ca6be3be39b972098b81b74559 100644 --- a/jsonapi_user_resources.info.yml +++ b/jsonapi_user_resources.info.yml @@ -1,6 +1,6 @@ name: 'JSON:API User Resources' description: 'Provides JSON:API resources for users, such as registration.' -core_version_requirement: ^9 || ^10 +core_version_requirement: ^8.8 || ^9 || ^10 || ^11 type: module dependencies: - drupal:jsonapi diff --git a/src/EventSubscriber/PasswordResetSubscriber.php b/src/EventSubscriber/PasswordResetSubscriber.php index deb1fcb4c8b7d25a1901644045bf082d1910a245..b498c6d6b1302cfbdd03aa6d90729450967499f8 100644 --- a/src/EventSubscriber/PasswordResetSubscriber.php +++ b/src/EventSubscriber/PasswordResetSubscriber.php @@ -15,7 +15,7 @@ final class PasswordResetSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ - public static function getSubscribedEvents() { + public static function getSubscribedEvents(): array { return [ UserResourcesEvents::PASSWORD_RESET => 'onPasswordReset', ]; diff --git a/src/EventSubscriber/UserRegistrationSubscriber.php b/src/EventSubscriber/UserRegistrationSubscriber.php index 68a3e4a747132cd96fcc6412ed57c266019b62e0..25e05e66e31b58da0b380c744399e77b3382b872 100644 --- a/src/EventSubscriber/UserRegistrationSubscriber.php +++ b/src/EventSubscriber/UserRegistrationSubscriber.php @@ -33,7 +33,7 @@ final class UserRegistrationSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ - public static function getSubscribedEvents() { + public static function getSubscribedEvents(): array { return [ UserResourcesEvents::REGISTRATION_COMPLETE => 'sendEmailNotifications', ]; diff --git a/src/Resource/PasswordUpdate.php b/src/Resource/PasswordUpdate.php index 2906a862641dfeff8f165232dad4427987eb150b..990b74ccec6b9145af98f1e32254856c5a4528e9 100644 --- a/src/Resource/PasswordUpdate.php +++ b/src/Resource/PasswordUpdate.php @@ -88,7 +88,7 @@ final class PasswordUpdate extends EntityResourceBase implements ContainerInject throw new UnprocessableEntityHttpException(sprintf('Missing required property "%s".', $required_property)); } } - $timestamp = $resource_object->getField('timestamp'); + $timestamp = (int) $resource_object->getField('timestamp'); // Time out, in seconds, until reset URL expires. $timeout = $this->userSettings->get('password_reset_timeout'); $current = $this->time->getRequestTime(); diff --git a/tests/modules/jsonapi_user_resources_test/jsonapi_user_resources_test.info.yml b/tests/modules/jsonapi_user_resources_test/jsonapi_user_resources_test.info.yml index bc0b01ea7a7b79c19cd50656590366e417a849bf..51f1f50f68e983866ef2f888fe497f472445a66d 100644 --- a/tests/modules/jsonapi_user_resources_test/jsonapi_user_resources_test.info.yml +++ b/tests/modules/jsonapi_user_resources_test/jsonapi_user_resources_test.info.yml @@ -1,5 +1,5 @@ name: 'JSON:API User Resources Test' -core_version_requirement: ^8.8 || ^9 || ^10 type: module +package: Testing dependencies: - jsonapi_user_resources:jsonapi_user_resources diff --git a/tests/modules/jsonapi_user_resources_test/src/EventSubscriber/RegistrationSubscriber.php b/tests/modules/jsonapi_user_resources_test/src/EventSubscriber/RegistrationSubscriber.php index b2e97f351ee2d20988db9388aa79ad77df9e347c..1fe7b737605a1e758a3ce8dde178d1120b019623 100644 --- a/tests/modules/jsonapi_user_resources_test/src/EventSubscriber/RegistrationSubscriber.php +++ b/tests/modules/jsonapi_user_resources_test/src/EventSubscriber/RegistrationSubscriber.php @@ -15,7 +15,7 @@ final class RegistrationSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ - public static function getSubscribedEvents() { + public static function getSubscribedEvents(): array { return [ UserResourcesEvents::REGISTRATION_COMPLETE => ['onUserRegistration'], ]; diff --git a/tests/src/Functional/PasswordResetTest.php b/tests/src/Functional/PasswordResetTest.php index 423763f1dfa797fffca61fcc4d695a6ae2c3446f..e0e4d670a3f6798dd5827b388e78f741ba767e26 100644 --- a/tests/src/Functional/PasswordResetTest.php +++ b/tests/src/Functional/PasswordResetTest.php @@ -125,7 +125,7 @@ final class PasswordResetTest extends BrowserTestBase { * @return \Generator * The test data. */ - public function validationDataProvider(): \Generator { + public static function validationDataProvider(): \Generator { yield [ [], FALSE, @@ -159,7 +159,7 @@ final class PasswordResetTest extends BrowserTestBase { * @return \Generator * The test data. */ - public function passwordResetDataProvider(): \Generator { + public static function passwordResetDataProvider(): \Generator { yield [['name' => 'sut']]; yield [['mail' => 'sut@example.com']]; } diff --git a/tests/src/Functional/PasswordUpdateTest.php b/tests/src/Functional/PasswordUpdateTest.php index 28c76ccf12453079957e0c483402410f579eabb4..d80d96b35eb977cb0c435922d13feb56928cd728 100644 --- a/tests/src/Functional/PasswordUpdateTest.php +++ b/tests/src/Functional/PasswordUpdateTest.php @@ -132,7 +132,7 @@ final class PasswordUpdateTest extends BrowserTestBase { * @return \Generator * The test data. */ - public function validationDataProvider(): \Generator { + public static function validationDataProvider(): \Generator { yield [ [], FALSE, diff --git a/tests/src/Functional/RegistrationTest.php b/tests/src/Functional/RegistrationTest.php index 1a55ae0fd3792ca0611ebabccdfa039a32bc04b8..0e6cc3cb9839cf75b57c192012bf9a321af79b7e 100644 --- a/tests/src/Functional/RegistrationTest.php +++ b/tests/src/Functional/RegistrationTest.php @@ -322,7 +322,7 @@ final class RegistrationTest extends BrowserTestBase { /** * Data provider for the registration tests. */ - public function dataRegistrationProvider(): \Generator { + public static function dataRegistrationProvider(): \Generator { yield [ UserInterface::REGISTER_ADMINISTRATORS_ONLY, FALSE,