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

Fix PHP 8.2 and Other Related Issues #640

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

mralaminahamed
Copy link

@mralaminahamed mralaminahamed commented Apr 30, 2024

Changes Proposed in this Pull Request:

  1. PHP 8.2 Compatibility: Resolved issues related to compatibility with PHP 8.2, ensuring the plugin functions smoothly on this PHP version without errors or warnings.
  2. PHP CS Fixer (3.*) Compatibility: Resolve issues related to compatibility with PHP CS Fixer 3.* and update configure file as per new guidelines.

Related Issue(s) and PR(s):

How to Test the Changes in this Pull Request:

  1. Ensure you have PHP 8.2 installed on your development environment.
  2. Apply this PR's changes to your local copy of the plugin.
  3. Test a payment to verify that the reported issues are resolved and enhancements work as expected.
  4. Check for any PHP warnings, errors, or unexpected behavior.

Changelog Entry:

  • Fixed: fix: Fatal error: Uncaught Error: Class "PhpCsFixer\Finder" not found on .php_cs file.
  • Fixed: PHP 8.2 compatibility issues and resolved added dynamicly called properties.

Self-Review Checklist:

  • Code follows WordPress coding standards.
  • Fixes or enhancements fully address the reported issues or goals.
  • Tested thoroughly on relevant environments.
  • Documentation and comments are updated.
  • No regressions introduced.

Additional Notes:

@williamdes
Copy link
Contributor

I think you should extract into another PR the actual changes of the code and keep this one for the tooling

@mralaminahamed mralaminahamed changed the title [IN-PROGRESS] Fix PHP 8.2 and Other Related Issues [IN-PROGRESS] Fix PHP 8.2, PHPCS and Other Related Issues Apr 30, 2024
@mralaminahamed mralaminahamed changed the title [IN-PROGRESS] Fix PHP 8.2, PHPCS and Other Related Issues [IN-PROGRESS] Fix PHP 8.2 and Other Related Issues Apr 30, 2024
@mralaminahamed mralaminahamed changed the title [IN-PROGRESS] Fix PHP 8.2 and Other Related Issues Fix PHP 8.2 and Other Related Issues Apr 30, 2024
MangoPay/PayOut.php Outdated Show resolved Hide resolved
Copy link
Contributor

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

This definitely looks good now

Co-authored-by: William Desportes <[email protected]>
.gitignore Outdated Show resolved Hide resolved
.php-cs-fixer.cache Outdated Show resolved Hide resolved
@mralaminahamed
Copy link
Author

What's the expected timeframe for merging this PR into the master branch?

MangoPay/KycDocument.php Outdated Show resolved Hide resolved
MangoPay/PayOut.php Outdated Show resolved Hide resolved
MangoPay/PayOut.php Outdated Show resolved Hide resolved
@iulian03
Copy link
Contributor

iulian03 commented Jun 3, 2024

Hi @mralaminahamed ,

Sorry for the late response. We will check your PR, thank you for the contribution!

MangoPay/PayOut.php Outdated Show resolved Hide resolved
@mralaminahamed
Copy link
Author

@williamdes, I've made the changes based on your feedback. Could you please take another look and let me know if there's anything else that needs to be addressed? Thanks for your time and guidance!

MangoPay/PayOut.php Outdated Show resolved Hide resolved
@mralaminahamed
Copy link
Author

mralaminahamed commented Jul 17, 2024

Hi @iulian03,

I hope you are doing well. I wanted to follow up on the status of this pull request (#640) that addresses the PHP 8.2 compatibility issues and other related problems.

It's been over a month since I submitted the pull request, and I've been actively working on incorporating the valuable feedback provided by @williamdes and making the necessary changes. The latest updates have been reviewed and approved by @williamdes, indicating that the pull request is ready for final review and merging.

I understand that you and the team might have a busy schedule, but I kindly request an update on the timeline for reviewing and merging these changes. As a developer relying on this SDK, it's crucial to have it compatible with the latest PHP versions, and I believe many others in the community would also benefit from these fixes.

Additionally, I wanted to inquire about your plans for the next release of the Mangopay PHP SDK. It would be great if you could share any information on when we can expect a new version that includes these compatibility enhancements.

@pkly
Copy link

pkly commented Sep 23, 2024

It'd be great if you could add tests against php 8.3 as well (tho it seems to work fine from my experience, without the MR)

@mralaminahamed
Copy link
Author

Thanks for your feedback, and I will try to add test cases for php 8.3.

# Conflicts:
#	MangoPay/Libraries/ApiBase.php
* @see \MangoPay\KycDocumentStatus
* @phpstan-var \MangoPay\KycDocumentStatus::*
*/
public $TypeLabel;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this property? I don't see it in the docs :D

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

*
* @var string
*/
public $StatusLabel;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this property? I don't see it in the docs :D (correct me if I'm wrong)

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

*
* @var string
*/
public $SecureMode;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for adding this to the PayIn class?

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* @see https://mangopay.com/docs/endpoints/direct-card-payins#direct-card-payin-object
* @var string
*/
public $Requested3DSVersion;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for adding this to the PayIn class?

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* The IP address of the end user initiating the transaction, in IPV4 or IPV6 format.
* @var string
*/
public $IpAddress;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for adding this to the PayIn class?

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* One of PayOutPaymentDetails implementations, depending on $PaymentType
* @var object
*/
public $PayoutPaymentDetails;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for adding this to the PayOut class? We already have it below.

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* 'STANDARD', 'INSTANT_PAYMENT', 'INSTANT_PAYMENT_ONLY'
* @var string
*/
public $PayoutModeRequested;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for adding this to the PayOut class?

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* Message related to the refund
* @var string
*/
public $RefundReasonMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this param? I don't see it in the docs (correct me if I'm wrong)

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

* The output status of Declaration status.
* @var string
*/
public $OutputStatus;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this param? I don't see it in the docs (correct me if I'm wrong)

Copy link
Author

Choose a reason for hiding this comment

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

This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly.

RUN docker-php-source delete

# Install composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this step different from the other versions?

Copy link
Author

Choose a reason for hiding this comment

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

Would you please check the screenshot?
Screenshot From 2024-12-12 00-41-14

Copy link
Contributor

@williamdes williamdes Dec 12, 2024

Choose a reason for hiding this comment

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

@iulian03 this is the recommended version by composer

@mralaminahamed
Copy link
Author

@iulian03 , if there are no issues, may I close this PR? I originally created it to address PHP 8.2 compatibility issues in our production environment with our product. However, it has been pending review for some time, and there have been significant changes to the documentation since then. Some of the proposed changes may no longer align with the current documentation structure.

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.

Add PHP 8.2 Support PHP 8.2 compatibility
4 participants