Unexpected exception when instantiating class - error in Symfony 5.4 and PHP 8.1
JakubSzubart opened this issue · comments
Hey
Today out of nowhere i got error Unexpected exception when instantiating class.
when i tried to create client class for my akeneo integrator app.
- PHP: 8.1
- Symfony: 5.4
$clientBuilder = new AkeneoPimClientBuilder($params->get('pim_url'));
$this->client = $clientBuilder->buildAuthenticatedByPassword(
$params->get('pim_api_client_id'),
$params->get('pim_api_client_secret'),
$params->get('pim_api_user'),
$params->get('pim_api_password')
);
Additional informations: The error appeared after i installed the Symfony bundle https://symfony.com/bundles/SensioFrameworkExtraBundle/current/index.html#installation.
I tried to remove vendors and composer.lock file and reinstall packages. Still error is visible.
Can somebody help me?
I solved the problem, i missed in my composer.json file one of required packages:
http-interop/http-factory-guzzle
SensioFrameworkExtraBundle was not a problem. Some code was not merge correctly with my coworkers, and the library disappeared.
My advice: always double check requirements of the library 👍