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

Pdo sqlite keep bc since php81 #320

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

hungtrinh
Copy link

@hungtrinh hungtrinh commented Feb 6, 2023

@hungtrinh
Copy link
Author

Mr @glensc could you please review this PR, thanks you!

@glensc
Copy link
Collaborator

glensc commented Feb 6, 2023

@hungtrinh can you move phpunit change to separate PR?

@hungtrinh hungtrinh marked this pull request as draft February 6, 2023 08:07
@hungtrinh
Copy link
Author

hungtrinh commented Feb 6, 2023

Waiting #321 merged then rebase from master, so back PR to Draft

@glensc
Copy link
Collaborator

glensc commented Feb 6, 2023

@hungtrinh you should apply all my suggestions. i.e to use short array.

@hungtrinh
Copy link
Author

Yep, i will apply it

@hungtrinh hungtrinh force-pushed the pdo-sqlite-keep-bc-since-php81 branch 2 times, most recently from 64f3404 to 4311fb9 Compare February 6, 2023 16:14
@hungtrinh hungtrinh marked this pull request as ready for review February 6, 2023 16:46
@hungtrinh
Copy link
Author

Rebase from master. Applied all suggestions.

@glensc
Copy link
Collaborator

glensc commented Feb 6, 2023

Can you squash the suggestions to single commit and put meaningful commit message there (Use short array and coalesce language features)?

@hungtrinh
Copy link
Author

Yep let me do it

@hungtrinh hungtrinh force-pushed the pdo-sqlite-keep-bc-since-php81 branch from 4311fb9 to 633163b Compare February 7, 2023 04:38
@hungtrinh
Copy link
Author

Can you squash the suggestions to single commit and put meaningful commit message there (Use short array and coalesce language features)?

It's done Mr @glensc

@@ -269,7 +269,7 @@ public function testAdapterQuoteNullByteCharacter()
public function testAdapterZendConfigEmptyDriverOptions()
{
$params = $this->_util->getParams();
$params['driver_options'] = '';
$params['driver_options'] = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why null? looking at other code in this PR, looks logical to use []

Copy link
Author

Choose a reason for hiding this comment

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

Yep look logical to use []

why null not keep empty string ''?

To verify case use Null Coalescing Operator after apply your suggestion

library/Zend/Db/Adapter/Pdo/Sqlite.php

- $config['driver_options'] = empty($config['driver_options']) ? array() : $config['driver_options'];
+ $config['driver_options'] = $config['driver_options'] ?? [];

Copy link
Collaborator

Choose a reason for hiding this comment

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

[] would work for ?? as well.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, it's work

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make the change then? :)

Copy link
Author

Choose a reason for hiding this comment

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

Can you make the change then? :)

it's done Mr @glensc

Just for fun:
Before replace empty string '' by null in test case, i predicted we would have a conversation about it, i am a prophet :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hungtrinh that is good. no way can slip in extra hidden changes! you should have committed it separately with an explanation in the commit message body, then wouldn't have to discuss it in the review notes. i.e more transparent change. because it doesn't match the commit message it's committed under now.

Copy link
Author

Choose a reason for hiding this comment

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

Mr @glensc please merge this PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was hoping you split the commit. I guess not then.

Co-authored-by: Elan Ruusamäe <glen@pld-linux.org>
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.

3 participants