Resend.php doesn't have a namespace declaration which means Mozart can't automatically isolate dependencies.
For context, this library is used in Send Emails With Resend, a WordPress plugin that lets me use Resend for all transactional emails on WordPress sites. Unfortunately, a different WordPress plugin (WPForms) bundles with it an older version of PSR-3 which caused conflicts with the Resend WP plugin. I wanted to fix this by contributing a PR to the Resend plugin that uses namespaced dependencies, but Mozart can't overwrite the namespace if there isn't one to begin with here.
I'm happy to contribute a PR with the fix but thought you might want an issue opened first.
I believe it's just as simple as changing Resend.php like so.
At the start of the file:
At the end, to ensure existing implementations referencing \Resend\<name> would still work:
class_alias(\Resend\Resend::class, 'Resend');
Thank you for your time and even more so for this library. Resend's the best transactional email service I've used for TS/JS projects, and I have a big interest in it also being as useable for PHP projects.
Resend.phpdoesn't have anamespacedeclaration which means Mozart can't automatically isolate dependencies.For context, this library is used in Send Emails With Resend, a WordPress plugin that lets me use Resend for all transactional emails on WordPress sites. Unfortunately, a different WordPress plugin (WPForms) bundles with it an older version of PSR-3 which caused conflicts with the Resend WP plugin. I wanted to fix this by contributing a PR to the Resend plugin that uses namespaced dependencies, but Mozart can't overwrite the namespace if there isn't one to begin with here.
I'm happy to contribute a PR with the fix but thought you might want an issue opened first.
I believe it's just as simple as changing
Resend.phplike so.At the start of the file:
At the end, to ensure existing implementations referencing
\Resend\<name>would still work:Thank you for your time and even more so for this library. Resend's the best transactional email service I've used for TS/JS projects, and I have a big interest in it also being as useable for PHP projects.