db
db copied to clipboard
Replace `object` type for constraint name with `Stringable`
https://github.com/yiisoft/db/blob/c5aa0b150aa2ba176a4660049ff6d98a2a92f067/src/Constraint/Constraint.php#L53
object|string|null → Stringable|string|null
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.
Why should it accept Stringable objects?
Just use it as $constraint->name((string) $stringable) and accept string|null $value only
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?
For internal initialization string is enough.
Some class instances are initialized only in the package.