refactor: organize app constants in Application#1030
Conversation
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
PHP Code CoverageCoverage after merging refactor/organize-app-consts into release/2.11 will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Centralizes app-wide constants (auth methods, OIDC provider types/labels, scopes, minimum supported app versions) into lib/AppInfo/Application.php, replacing duplicated/scattered definitions in OpenProjectAPIService and SettingsService, and updates all backend code and tests to reference the new locations.
Changes:
- Adds
AUTH_METHOD_*,NEXTCLOUD_HUB_OIDC_PROVIDER_TYPE/LABEL,EXTERNAL_OIDC_PROVIDER_TYPE, andMIN_SUPPORTED_*_VERSIONconstants toApplication, removing them from the service classes. - Updates all production references (
SettingsService,OpenProjectAPIService,ConfigController,Admin, listeners,TokenEventFactory, migration) to useApplication::.... - Updates all corresponding tests to use the new
Application::constant names.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/AppInfo/Application.php | Adds centralized constants; minor cleanup using self::APP_ID in registerNavigation. |
| lib/Service/SettingsService.php | Removes duplicated constants; uses Application:: constants in validation. |
| lib/Service/OpenProjectAPIService.php | Removes duplicated constants; switches all references to Application::. |
| lib/Controller/ConfigController.php | Replaces service-class constants with Application:: constants. |
| lib/Settings/Admin.php | Uses Application:: constants for auth method and minimum versions. |
| lib/Listener/LoadAdditionalScriptsListener.php | Uses Application::AUTH_METHOD_OIDC. |
| lib/Listener/OpenProjectReferenceListener.php | Uses Application::AUTH_METHOD_OIDC. |
| lib/TokenEventFactory.php | Uses Application::NEXTCLOUD_HUB_OIDC_PROVIDER_TYPE; drops unused import. |
| lib/Migration/Version2900Date20250718065820.php | Uses Application::AUTH_METHOD_OAUTH. |
| tests/lib/Controller/ConfigControllerTest.php | Test data updated to new constants. |
| tests/lib/Controller/OpenProjectAPIControllerTest.php | Test data updated; adds Application import. |
| tests/lib/Controller/OpenProjectControllerTest.php | Test data updated to new constants. |
| tests/lib/Listener/LoadSidebarScriptTest.php | Test data updated to new constants. |
| tests/lib/Service/OpenProjectAPIServiceTest.php | Test data updated across many cases. |
| tests/lib/Service/SettingsServiceTest.php | Test data updated to new constants. |
| tests/lib/Settings/AdminTest.php | Test data updated; drops SettingsService import. |
| tests/lib/Settings/PersonalTest.php | Test data updated to new constants. |
| tests/lib/TokenEventFactoryTest.php | Test data updated; drops unused import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Description
Related Issue or Workpackage
Types of changes
Checklist:
CHANGELOG.mdfile