-
Notifications
You must be signed in to change notification settings - Fork 37
Add status constants and extension point for flexible user status management #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: alxndr-w <[email protected]>
… callable Co-authored-by: alxndr-w <[email protected]>
…tests Co-authored-by: alxndr-w <[email protected]>
…ension point Co-authored-by: alxndr-w <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a flexible approach to managing YCom user status options by introducing status constants, a callable method with an extension point, and comprehensive documentation.
- Added status constants to replace magic numbers in code
- Implemented
getStatusOptions()method withYCOM_USER_STATUS_OPTIONSextension point - Updated YForm table definition to use callable for dynamic status options
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lib/ycom_user.php |
Added status constants, default options array, and getStatusOptions() method with extension point |
install/tablesets/yform_user.json |
Updated choices field to use callable instead of hardcoded string |
tests/unit/user_status_test.php |
Added comprehensive unit tests for new status functionality |
docs/12_status_examples.md |
Created new documentation with usage examples and status table |
docs/05_passwords.md |
Enhanced existing documentation with status constants and extension examples |
docs/03_login_logout_profile_register.md |
Added informational note about status constants for form usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| ##### Status-Konstanten | ||
|
|
||
| Seit Version X.X werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder 'X.X' should be replaced with the actual version number when this feature is released.
| Seit Version X.X werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: | |
| Seit Version 2.7 werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: |
Co-authored-by: Copilot <[email protected]>
AWqxKAWERbXo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Von meiner Seite aus so vorbereitet, wie ich denke, dass es eine Verbesserung ist.
Overview
This PR implements a more flexible approach to managing YCom user status options by introducing status constants, a callable method, and an extension point for project-specific customization.
Problem
Previously, status options were hardcoded as a long string in the YForm table definition:
This made it difficult to:
Solution
Following the pattern from FriendsOfREDAXO/warehouse, this PR adds:
1. Status Constants
2. Status Options Method with Extension Point
3. Callable in YForm Definition
Usage Examples
Using constants in code:
Extending status options via extension point:
Benefits
Changes
rex_ycom_userclassgetStatusOptions()method withYCOM_USER_STATUS_OPTIONSextension pointdocs/12_status_examples.md)Testing
Unit tests verify:
DEFAULT_STATUS_OPTIONScontains all expected entriesgetStatusOptions()returns proper array structureFixes #XXX
/cc @j4ceee
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #524
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.