Closed dseegers closed 3 years ago
Hi,
Thanks for reporting the issue.
We are investigate the error. Currently I have not been able to reproduce the error - are you able to help me with a few more details?
I have this on my local machine and a development machine (Linux) Mac Osx on commit: 3911968d1bd535b96ad2bc2803672d488f9c36cb
Well, I think I have found the problem.
When I look at the ObjectDefinitionHelper.php
file (CookiebotWP-master/addons/lib/ioc/php-di/php-di/src/DI/Definition/Helper) it is looking for the interface DefinitionHelper
.
When I look in this file, you see the next (this is the php-di in the plugin)
<?php
/**
* PHP-DI
*
* @link http://php-di.org/
* @copyright Matthieu Napoli (http://mnapoli.fr/)
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
*/
namespace DI\Definition\Helper;
/**
* Helps defining container entries.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
interface DefinitionHelper
{
/**
* @param string $entryName Container entry name
* @return \DI\Definition\Definition
*/
public function getDefinition($entryName);
}
I also have a file in my vendor file, expecting Definition
where it is breaking.
How can I solve this and help to fix the problem :)?
<?php
declare(strict_types=1);
namespace DI\Definition\Helper;
use DI\Definition\Definition;
/**
* Helps defining container entries.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
interface DefinitionHelper
{
/**
* @param string $entryName Container entry name
*/
public function getDefinition(string $entryName) : Definition;
}
@dseegers
In your vendor folder. Did you install another PHP DI - that might be the reason why the plugin breaks.
You should be able to use the plugin out of the bug without installing any additional libraries through composer?
I will try to look more into it tomorrow morning.
/Johan
@phpgeek.
The problem is that it is calling getDefinition($entryName)
.
I have tested on two internal websites.
The first one has a plugin with php-di
The other is an framework
that has the same conflict https://github.com/offbeatwp
PHP-DI version in the plugin https://github.com/PHP-DI/PHP-DI/commit/a6c813bf6b0d0bdeade3ac5a920e2c2a5b1a6ce3
Hi @dseegers,
Which plugin did cause the issue with DI?
Take care,
Aytac
Well I think that the problem is that the cookiebot uses an changed version of php-di. Without the definition, so it would conflict with other composer packages that use php-di
interface DefinitionHelper
{
/**
* @param string $entryName Container entry name
*/
public function getDefinition(string $entryName) : Definition;
}
When I try to activate the plugin it is throwing a fatal error: