Skip to content

Fix on FetchMode getting lost between instances#183

Merged
TCB13 merged 5 commits intousmanhalalit:masterfrom
vikkio88:master
Apr 11, 2018
Merged

Fix on FetchMode getting lost between instances#183
TCB13 merged 5 commits intousmanhalalit:masterfrom
vikkio88:master

Conversation

@vikkio88
Copy link
Copy Markdown
Contributor

@vikkio88 vikkio88 commented Apr 6, 2018

this should fix #185

this would fix the issues on fallback fetchMode if set
@vikkio88 vikkio88 changed the title small fix on wrong link in docs Fix on FetchMode getting lost between instances Apr 11, 2018
@vikkio88
Copy link
Copy Markdown
Contributor Author

hi @TCB13 this Pr started as a change on a readme, now is doing that plus the FetchMode changes.
Which changes do you think I should isolate? I dont understand

@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

@vikkio88 forget my comment.

@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

@vikkio88 do you have any comments on the reviews above?

@vikkio88
Copy link
Copy Markdown
Contributor Author

@TCB13 I dont see any review

@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

@vikkio88 you're replaced \Pixie\Exception by Exception and remove the global space at line 50.

@vikkio88
Copy link
Copy Markdown
Contributor Author

@TCB13 sure thing, let me fix that, is most likely something due to phpstorm autofixing the coding style.

/**
* @param null|\Pixie\Connection $connection
*
* @throws \Pixie\Exception
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you mean this @TCB13 ?
this is because you are using use Pixie\Exception, this will be automatically inferred to be a Pixie one

* @var array
*/
protected $fetchParameters = array(\PDO::FETCH_OBJ);
protected $fetchParameters = array(PDO::FETCH_OBJ);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@TCB13 and this is the same thing, as you are using use PDO the trailing \ is not required

@vikkio88
Copy link
Copy Markdown
Contributor Author

@TCB13 as I commented those changes were done automatically by phpstorm as it realizes that \ are unnecessary due to the using directives.
Do you still want me to change them?

adding required changes on the PR
@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

hi @vikkio88 you've a point there. You can keep it without the \ and with Exception. Anyway can you add some tests to check if the FetchMode is now kept between instances? Looks ready to merge!

@vikkio88
Copy link
Copy Markdown
Contributor Author

sure thing I will add some tests too.

*
* @throws \Pixie\Exception
* @param int $fetchMode
* @throws Exception
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why replace \Pixie\Exception by Exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

use is already specifying that the Exception in here is \Pixie\

* @var array
*/
protected $fetchParameters = array(\PDO::FETCH_OBJ);
protected $fetchParameters = array(PDO::FETCH_OBJ);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@usmanhalalit need your view in there. This can potentially break some setups.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it will not, as use PDO; on this file make \PDO and PDO the same thing

adding regression tests
@vikkio88
Copy link
Copy Markdown
Contributor Author

fix on regression test
@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

Everything looks great, many thanks for your time. 🥇

@TCB13 TCB13 merged commit 220b920 into usmanhalalit:master Apr 11, 2018
@vikkio88
Copy link
Copy Markdown
Contributor Author

thank you for this project, let me know when you are planning to do a release

@TCB13
Copy link
Copy Markdown

TCB13 commented Apr 11, 2018

@vikkio88 that is something only @usmanhalalit can answer. I use myself master in various production/real-world scenarios without issues.

@vikkio88 vikkio88 mentioned this pull request Apr 11, 2018
@usmanhalalit
Copy link
Copy Markdown
Owner

Thanks @vikkio88 and @TCB13. Release is not ready yet, but you can use master anyway as @TCB13 suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specifying FetchMode with options

3 participants