Skip to content

feat(hashing): implement Contracts\Hashing\Hasher, add info(), BC alias (task 2.11) - #46

Open
agissept wants to merge 2 commits into
migration/3.9-encryption-filesystem-contractsfrom
migration/2.11-hashing-contracts
Open

agissept wants to merge 2 commits into
migration/3.9-encryption-filesystem-contractsfrom
migration/2.11-hashing-contracts

Conversation

@agissept

Copy link
Copy Markdown
Member

Task 2.11 — Hashing → Contracts L13

Changes

  • BcryptHasher: implements Illuminate\Contracts\Hashing\Hasher, tambah method info()
  • HasherInterface.php: BC bridge via class_alias
  • DatabaseUserProvider / EloquentUserProvider: type-hint Contracts\Hashing\Hasher
  • Container alias hashContracts\Hashing\Hasher
  • Tests: update mocks ke Contracts\Hashing\Hasher

Verification

  • ✅ Full suite 1644 hijau
  • ✅ BcryptHasher instanceof contract & old interface
  • ✅ Auth providers resolve via type-hint baru

Stacked on: #45 (3.9)

@agissept agissept self-assigned this Sep 14, 2026
…task 2.11)

The class_alias bridge in HasherInterface.php covers use/typehint/instanceof/catch
but NOT container make()/autowiring: aliases are a separate string map. Moving the
'hash' core alias to Contracts\Hashing\Hasher left Illuminate\Hashing\HasherInterface
unbound, so App::make(HasherInterface::class) and autowired 'HasherInterface $hasher'
params throw BindingResolutionException (interface not instantiable) downstream —
hitting live paths (ApplicationGateway -> API V1 auth, UserPasswordUpdateSpecification
-> password-update route) plus two integration tests. Escaped CI because no L42x test
resolved the old name via the container.

Add the container BC alias, mirroring the log (3.5) and encrypter (2.9) precedent in
the same method. Regression test asserts both the contract name and the legacy
interface name resolve to a Hasher. Full suite 1645 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant