Skip to content

Conversation

@xtremevision
Copy link

Fixed array notation curly brackets

}

return $this->_conn->real_escape_string($str);
return $this->_conn->real_escape_string($str ?? '');
Copy link
Contributor

@aik099 aik099 Jan 23, 2025

Choose a reason for hiding this comment

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

NOTE: Please do this place and similar places in this PR, where ?? is used.

Usage of the null coalescing operator (??) on the PHP < 7.0 would result in a syntax error.

Please adjust the code to also work on PHP 5.x (according to composer.json this library supports PHP 5.x).

For this particular place maybe it's better to return NULL, when $str === null, but since there are no automated tests, this might break things :(

Copy link
Author

Choose a reason for hiding this comment

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

Please check now.

Copy link
Author

Choose a reason for hiding this comment

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

I used isset() ? : instead...

@aik099
Copy link
Contributor

aik099 commented Jan 23, 2025

Please also remove // MM PHP 8 compatibility fix comments from the code. It's always possible to review the cause of these changes through GitHub instead of explaining them across the code base.

@xtremevision
Copy link
Author

Please also remove // MM PHP 8 compatibility fix comments from the code. It's always possible to review the cause of these changes through GitHub instead of explaining them across the code base.

Done.

@aik099
Copy link
Contributor

aik099 commented Jan 23, 2025

Looks perfect to me.

@xtremevision , Have you tested these changes in a production environment (e.g. in a project that runs on PHP 8.1+, where this library is used)?

@xtremevision
Copy link
Author

Tbh I can't remember. A lot of time has passed since I placed this PR. I can't remember if I used it and/or where. I'll check.

);

return str_replace(array_keys($transform), array_values($transform), $str);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the last change. Please remove this trailing space.

@aik099
Copy link
Contributor

aik099 commented Jan 23, 2025

I hope that once this PR is merged. The library would be work on PHP 8.1+. For people using this library, that should be a big relief.

If possible, consider switching to the official QuickBooks API client for PHP: https://github.com/intuit/QuickBooks-V3-PHP-SDK .

@xtremevision
Copy link
Author

xtremevision commented Jan 23, 2025

Done. Removed trailing space.

@aik099
Copy link
Contributor

aik099 commented Jan 23, 2025

Done. Removed trailing space.

You've removed the wrong trailing space. There should be one empty file at the end of each file.

I was talking about the empty line above the return str_replace(array_keys($transform), array_values($transform), isset($str) ? $str : ''); code in the XML.php file, that had some tabs/space on it. The line should stay, but there shouldn't be anything space-alike in it.

@xtremevision
Copy link
Author

Sorry, try now.

@aik099
Copy link
Contributor

aik099 commented Jan 23, 2025

Great. Thank you @xtremevision .

@tvaughan73
Copy link
Contributor

I hope that once this PR is merged. The library would be work on PHP 8.1+. For people using this library, that should be a big relief.

If possible, consider switching to the official QuickBooks API client for PHP: https://github.com/intuit/QuickBooks-V3-PHP-SDK .

Many people probably would if this SDK supported QB Desktop.

@xtremevision
Copy link
Author

xtremevision commented Jul 6, 2025 via email

@xtremevision
Copy link
Author

I hope that once this PR is merged. The library would be work on PHP 8.1+. For people using this library, that should be a big relief.

If possible, consider switching to the official QuickBooks API client for PHP: https://github.com/intuit/QuickBooks-V3-PHP-SDK .

Unfortunately I am using another module that relies on this repo. Switching to another sdk is sadly impossible.

@xtremevision
Copy link
Author

I would be very grateful if the PR could be merged finally so I can update my composer and reinstall the original module instead of my fork. The original PR was submitted over 1 year ago. Thanks.

@xtremevision
Copy link
Author

Hello? @aik099 is there a hold-up? I believe I've made all the requested changes. Can the merge be done please? Thanks.

@xtremevision xtremevision requested a review from aik099 July 8, 2025 02:05
@aik099
Copy link
Contributor

aik099 commented Jul 31, 2025

@xtremevision, I've approved the PR, but I don't have merge rights in this repo.

@keith-chargeover, could you please merge this?

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