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

[8.x] Use contract encrypt and decrypt methods #36573

Closed
wants to merge 1 commit into from

Conversation

driesvints
Copy link
Member

Alternative to #36566

These changes will make use of the Illuminate\Contracts\Encryption\Encrypter contract's methods so people can still roll their own implementations without running into problems with some framework usages of a concrete implementation. This prevents us from having to widen the contract for no real reason.

@deleugpn
Copy link
Contributor

Widening the contract still offers a better DX, though. The reason Laravel's Crypto Facade have those methods are better DX. I just want to keep that DX when I roll my own.

@driesvints
Copy link
Member Author

driesvints commented Mar 12, 2021

I don't agree, sorry. Contracts should be kept as small as possible. The methods you refer to are just DX methods like you say. They don't add anything to what the contract actually represents. They're just convenience methods. You can do the exact same things with the current methods. In general, a contract should offer ways to do something and not duplicate them with extra methods.

@taylorotwell
Copy link
Member

I don't like to use encrypt or decrypt really. They use serialization and therefore more overhead.

@driesvints driesvints deleted the use-contract-method branch March 12, 2021 16:42
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.

4 participants