Worldpay / Worldpay-Magento2-CG

Worldpay Magento 2 Plugin for Worldpay Corporate Gateway
Other
17 stars 35 forks source link

Update Usage of Deprecated class Zend\Validator\File\Exists to \Laminas\Validator\File\Exists in PaymentMethods.php #130

Open obsergiu opened 5 months ago

obsergiu commented 5 months ago

Hello,

The recent PR did not address the deprecated code issue in the file

vendor/sapient/module-worldpay/Model/Utilities/PaymentMethods.php. 

The error being reported is:

main.CRITICAL: Error: Class "Zend\Validator\File\Exists" not found in vendor/sapient/module-worldpay/Model/Utilities/PaymentMethods.php:173
As the Zend\Validator\File\Exists class is no longer available, we need to update the code accordingly. 

Need to swap the:

$validator = new \Zend\Validator\File\Exists();

With:

$validator = new \Laminas\Validator\File\Exists();

Tested in Magento2.4.6-p2.

obsergiu commented 5 months ago

This seems to be because the laminas/laminas-zendframework-bridge was deprecated from laminas/laminas-server:2.17 and there's no hard requirement in magneto to keep it down to laminas/laminas-server: 2.16

https://github.com/laminas/laminas-server/pull/76

elavarasann commented 4 months ago

Hi, Thanks for highlighting this. We have made these changes & we will update these changes in next upcoming release.