pressidium / pressidium-cookie-consent

🍪 Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.
https://wordpress.org/plugins/pressidium-cookie-consent/
GNU General Public License v2.0
48 stars 2 forks source link

Vendor conflicts with Sword/Bedrock #39

Closed williarin closed 10 months ago

williarin commented 10 months ago

Hello,

I tried this plugin with Sword which is WordPress run inside Symfony, using a centralized Composer. It works similar to Bedrock so I guess the problem is the same using Bedrock.

The plugin has a conflict with ContainerInterface:

Fatal error: Uncaught Error: Compile Error: Declaration of League\Container\Container::has($id) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool

This is because my Psr\Container is set to ^2.0 and this plugin needs ^1.0.

Ideally this plugin should prefix all vendor namespaces using something like https://github.com/typisttech/imposter-plugin in order to avoid conflicts with any other plugin or core app.

Is this something that can be considered?

over-engineer commented 10 months ago

Hey, @williarin!

Thanks for spotting that issue and taking the time to report it!

The issue was addressed in 1.2.2, which was just released on the Plugin Directory.

This version wraps all Composer dependencies in our own namespace (Pressidium\WP\CookieConsent\Dependencies\) to prevent conflicts with other plugins loading the same dependencies with different versions.

Let me know if that fixed it for you 🙂

williarin commented 10 months ago

It works perfectly now, thank you very much!