Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Fixed issues
Missing Files
1. No composer.json
2. No .gitignore
3. No .cspell.json
4. No .gitlab-ci.yml
5. No config/schema/loginnotification.schema.yml
---
loginnotification.info.yml
6. core_version_requirement: ^10 || ^11 → ^10.3 || ^11
7. Missing package key
---
loginnotification.module
8. Missing declare(strict_types=1)
9. @file description is Module file. — too generic, needs a real description
10. hook_help(), hook_user_login(), hook_mail() should be migrated to
src/Hook/LoginNotificationHooks.php with #[Hook] attributes
11. \Drupal::service(), \Drupal::config(), \Drupal::currentUser(),
\Drupal::logger(), \Drupal::languageManager(), \Drupal::time() static calls in
hooks — services should be injected
12. \Drupal::logger('type') — wrong logger channel, should be
'loginnotification'
13. $fieldValue[0]['value'] == 1 — loose comparison, should be === 1
14. loginnotification_generate_user_logout_link() has trailing }; (semicolon
after closing brace)
15. loginnotification_user_hash() — $timestamp parameter missing PHP type hint
---
loginnotification.install
16. Missing declare(strict_types=1)
17. Empty line after opening brace in loginnotification_uninstall()
18. if ($key == 'loginnotification') — loose comparison, should be ===
---
src/Controller/LoginNotificationController.php
19. Missing declare(strict_types=1)
20. Class docblock LoginNotificationController Controller definition. —
"Controller" repeated
21. logoutUser() missing return type
22. create() missing return type (: static)
23. logoutUser() parameters $uid, $timestamp, $hash missing PHP type hints
24. Property $serviceSession is poorly named — should be $sessionManager
---
src/Form/LoginNotificationConfigurationForm.php
25. Missing declare(strict_types=1)
26. @file docblock is placed after the namespace declaration — must come
before namespace
27. @file description Contains Drupal\loginnotification\Form\... — wrong
pattern, should be descriptive
28. Class docblock Initialization Class LoginNotificationConfigurationForm. —
poor description
29. Missing return types on all methods
30. drupal_flush_all_caches() in submitForm() — unnecessary in a config form,
should not be there
---
config/install/loginnotification.settings.yml
31. notification_mail_body stored as a plain string, but the code accesses
$config->get('notification_mail_body')['value'] — the default should match the
text_format widget structure: {value: '...', format: 'full_html'}
---
config/schema/loginnotification.schema.yml (missing)
32. No schema file — needs to define loginnotification.settings mapping with
notification_mail_body and notification_mail_body_format fields