Skip to content
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

feat: Add Revoke Achievmenet #90

Merged
merged 4 commits into from
Nov 10, 2024
Merged

feat: Add Revoke Achievmenet #90

merged 4 commits into from
Nov 10, 2024

Conversation

cjmellor
Copy link
Owner

Description

This pull request introduces a new feature allowing achievements to be revoked from users. It includes updates to the documentation, the addition of a new event, and corresponding tests to ensure the functionality works as expected.

New Feature: Achievement Revocation

  • Documentation Update:

    • Added a new section in README.md explaining how to revoke achievements using the revokeAchievement method.
    • Documented the AchievementRevoked event in README.md.
  • Code Changes:

    • Added the AchievementRevoked event to src/Concerns/HasAchievements.php.
    • Implemented the revokeAchievement method in src/Concerns/HasAchievements.php, which detaches the achievement from the user and dispatches the AchievementRevoked event.
  • Event Addition:

    • Created a new AchievementRevoked event class in src/Events/AchievementRevoked.php.
  • Testing:

    • Updated tests in tests/Concerns/HasAchievementsTest.php to cover scenarios such as revoking an achievement, ensuring the event is dispatched, and handling errors when revoking unearned achievements. [1] [2]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Related Issues and Pull Requests

Testing

Please provide a passing test where possible. This package uses PestPHP

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation [OPTIONAL]

@cjmellor cjmellor added the enhancement New feature or request label Nov 10, 2024
@cjmellor cjmellor self-assigned this Nov 10, 2024
@cjmellor cjmellor merged commit 2a46856 into main Nov 10, 2024
@cjmellor cjmellor deleted the feat/revoke-achievment branch November 10, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant