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

Wrap pdo instances #3544

Closed
wants to merge 4 commits into from
Closed

Conversation

lcobucci
Copy link
Member

Q A
Type improvement
BC Break no (based on our doc blocks)
Related issues #3487

Summary

This is an alternative of #3543 created by @alcaeus and @nicolas-grekas.

I'm not really happy naming-wise and am open for suggestions.

@lcobucci lcobucci added this to the 2.10.0 milestone May 10, 2019
@lcobucci lcobucci requested review from morozov and alcaeus May 10, 2019 21:33
@lcobucci lcobucci force-pushed the wrap-pdo-instances branch from 2bcf0f4 to 8970af9 Compare May 10, 2019 21:42
@@ -189,7 +190,7 @@ public function __construct(
$this->params = $params;

if (isset($params['pdo'])) {
$this->_conn = $params['pdo'];
$this->_conn = WrappedPDOConnection::fromInstance($params['pdo']);
Copy link
Member

Choose a reason for hiding this comment

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

It still would be a breaking change since it's no longer a PDO instance (won't match a type hint, can't call PDO-specific methods, etc).

Copy link
Member Author

Choose a reason for hiding this comment

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

Not according to our docblocks...

Copy link
Member Author

Choose a reason for hiding this comment

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

We never expect to handle raw PDO connection in the internals

Copy link
Member

Choose a reason for hiding this comment

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

True. I didn't notice it was about the internal API. But still, even if we can afford introducing this class, I don't think we should. Having two PDO connections which share most of the code is not a proper solution. I'd like to propose #3549 instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

@morozov I'm fine with not adding this adapter 😄 I'd suggest to port the tests to your PR, just to ensure that the basic stuff works fine.

use function assert;
use function func_get_args;

final class WrappedPDOConnection implements Connection, ServerInfoAwareConnection
Copy link
Member

Choose a reason for hiding this comment

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

I'm not really happy naming-wise and am open for suggestions.

PDOConnectionAdapter?

@lcobucci
Copy link
Member Author

Closed as per #3544 (comment)

@lcobucci lcobucci closed this May 22, 2019
@lcobucci lcobucci deleted the wrap-pdo-instances branch May 22, 2019 11:31
@morozov morozov removed this from the 2.10.0 milestone Jun 7, 2019
@morozov morozov added the PDO label Jun 7, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants