0

We are Upgrading Magento Version from 2.4.3 to 2.4.6.

Area configuration aggregation... 5/9 [===============>------------] 55% 34 secs 498.0 MiB

In ClassReader.php line 57:

Impossible to process constructor argument Parameter #0 [ <required> Zend\Http\ClientFactory $clientFactory ] of Credova\Financial\Api\RequestAbstract class

In GetParameterClassTrait.php line 34:

Class "Zend\Http\ClientFactory" does not exist

setup:di:compile

enter image description here

Plase help us how can we fix this issue.

Note:- We already install "magento/zendframework1": "^1.15" in magento 2.4.6. But still facing the issue.

2 Answers 2

1

Based on my research, Zend usage has been deprecated since version 2.4.6. Therefore, it is necessary to install Laminas instead.

Replace Zend_Http_Client with \Laminas\Http\Request (Replace constants from GET to METHOD_GET, POST to METHOD_POST)

For example: \Zend_Http_Client::POST will be \Laminas\Http\Request::METHOD_POST and \Zend_Http_Client::GET will be \Laminas\Http\Request::METHOD_GET

Replace Zend_Json with \Laminas\Json\Json

Make sure that you have installed

  • laminas/laminas-http
  • laminas/laminas-serializer

Here is more infomation: https://developer-stage.adobe.com/commerce/php/development/backward-incompatible-changes/highlights/?utm_source=store&utm_medium=blog&utm_campaign=2023-02-magento-2-4-6

Have you any query let me know.

Thank you

4
  • As per your comment, you mention below thing Replace Zend_Http_Client with \Laminas\Http\Request (Replace constants from GET to METHOD_GET, POST to METHOD_POST) Feb 15 at 6:49
  • But in my code, we have this "Zend\Http\ClientFactory" class. can you please help on this class? Feb 15 at 6:49
  • On the custom module you used "Zend\Http\ClientFactory" please check. Feb 15 at 6:52
  • Check on this module Credova_Financial Feb 15 at 6:52
0

The error is from this custom extension.

Credova\Financial

So here you have 2 options.

  1. Install the updated package of the extension which is compitible with magento 2.4.6.
  2. Remove that extension and file from the magento 2.4.6.

Now try to run the compile command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.