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

Replace object type for constraint name with Stringable #738

Open
vjik opened this issue Aug 8, 2023 · 4 comments
Open

Replace object type for constraint name with Stringable #738

vjik opened this issue Aug 8, 2023 · 4 comments
Labels
status:ready for adoption Feel free to implement this issue.
Milestone

Comments

@vjik
Copy link
Member

vjik commented Aug 8, 2023

public function name(object|string|null $value): static

object|string|nullStringable|string|null

@vjik vjik added this to the 2.0.0 milestone Aug 8, 2023
@samdark
Copy link
Member

samdark commented Aug 8, 2023

The reason it is like this now is that we've started DB for PHP 7.4 and \Stringable is available only since 8.0.

@samdark samdark added the status:ready for adoption Feel free to implement this issue. label Aug 8, 2023
@arogachev arogachev changed the title Repalce type object for constraint name to Stringable Replace object type for constraint name with Stringable Aug 13, 2023
@Tigrov
Copy link
Member

Tigrov commented Aug 20, 2023

Why should it accept Stringable objects?
Just use it as $constraint->name((string) $stringable) and accept string|null $value only

@vjik
Copy link
Member Author

vjik commented Sep 26, 2023

Agree with @Tigrov. Seems, in all cases to name() pass string value.

Moreover. Seems, not need pass null to name(), because this method use for configure constraint once, right?

@Tigrov
Copy link
Member

Tigrov commented Oct 7, 2023

For internal initialization string is enough.

Some class instances are initialized only in the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants