Skip to content

Conversation

@sumaiazaman
Copy link
Contributor

This PR adds missing @throws annotations to the Encrypter class methods that throw exceptions but were missing proper documentation.

Changes Made

  • ensureTagIsValid() method: Added @throws \Illuminate\Contracts\Encryption\DecryptException annotation
  • previousKeys() method: Added @throws \RuntimeException annotation

Why This Matters

These methods throw exceptions in their implementation but were missing the proper @throws annotations in their docblocks. This improvement:

  • Enhances IDE support and autocomplete functionality
  • Improves static analysis capabilities (PHPStan, Psalm, etc.)
  • Provides better documentation for developers using these methods
  • Maintains consistency with Laravel's documentation standards

Testing

No functional changes were made - only documentation improvements. The existing test suite should continue to pass without modification.

- Add @throws DecryptException to ensureTagIsValid() method
- Add @throws RuntimeException to previousKeys() method

These methods throw exceptions but were missing proper @throws annotations in their docblocks.
@taylorotwell taylorotwell merged commit 96e5773 into laravel:12.x Oct 20, 2025
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants