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

Mark all classes as readonly #1091

Open
wants to merge 4 commits into
base: 6.0.x
Choose a base branch
from

Conversation

Slamdunk
Copy link
Collaborator

@Slamdunk Slamdunk commented Dec 4, 2024

Fix #1086

This PR needs a new 6.0.x branch

@Slamdunk Slamdunk added this to the 6.0.0 milestone Dec 4, 2024
@lcobucci lcobucci changed the base branch from 5.5.x to 6.0.x December 4, 2024 19:46
src/Configuration.php Outdated Show resolved Hide resolved
@@ -15,7 +15,7 @@
* Serves like a small DI container to simplify the creation and usage
* of the objects.
*/
final class Configuration
final readonly class Configuration
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to open a discussion about this component... its design is a bit too convoluted for me.
I'll post something soon...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious

Comment on lines +34 to 37
public static function new(Encoder $encoder, ClaimsFormatter $claimFormatter): self
{
return new self($encoder, $claimFormatter);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something that we'll need to coordinate in v5.5 the migration path for...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration API added in #1092

Copy link
Owner

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are good, thanks.

I personally don't like the factory method Builder::new() but it's a necessary evil to ensure that we don't have people injecting crazy stuff there.

@Slamdunk
Copy link
Collaborator Author

Slamdunk commented Dec 5, 2024

I personally don't like the factory method Builder::new()

This concern is easy to address with new Headers, Header, Claims, RegisteredClaims, UnregisteredClaim, RegisteredClaim objects and so on, but it would probabily be a bit overkill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Token\Builder really readonly
2 participants