-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs: remove useless @return BaseConnection|ConnectionInterface on BaseBuilder::db() #8701
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
Conversation
…aseBuilder::db()
Ready to merge 👍 |
Why? In fact, the Or |
The problem with including the interface itself in the union make all other type already valid as child of it. The current usage is incorrect imo, if union type to be used, both should be a class that implement the interface, eg, for param which valid: /** @param SomeClass|SomeClass2 $param */
public function run(SomeInterface $param)
{
echo $param->prop;
} which both |
The another solution is mark as BaseConnection instead: /** @return BaseConnection */
public function db(): ConnectionInterface |
@samsonasik Yes, after all, our code is incorrect. /** @return BaseConnection */
public function db(): ConnectionInterface Because devs expect BaseConnection instead of ConnectionInterface. |
done 👍 |
Thank you @kenjis for the review. |
Description
BaseConnection
is implementsConnectionInterface
so it can be removed from@return
doc. Detected by run latest"rector/rector": "dev-main"
Checklist: