Skip to content

src/Resend.php lacks a namespace declaration #105

Description

@ara303

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:

namespace Resend;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions