Skip to content

v1.0.8 -- AddedTransportManager.php does not comply with psr-4 autoloading standard #25

@BrutusBossNL

Description

@BrutusBossNL

When running composer on an old(er) Laravel application (5.8.x), yes I know... It will be upgraded soon, but untill then we are getting the composer warning:

Class Office365Mail\Transport\Office365AddedTransportManager located in ...\vendor\motze92\office365-mail\src\Transport\Office365MailAddedTransportManager.php does not comply with psr-4 autoloading standard. Skipping.

The main problem is that the filename (Office365MailAddedTransportManager.php) is different from the class name (Office365AddedTransportManager):

...
class Office365AddedTransportManager extends TransportManager
{
    ...
}
...

Changing this to the following should fix the issue:

...
class Office365MailAddedTransportManager extends TransportManager
{
    ...
}
...

This results in a 500 - server error when the application tries to send a mail:
Class 'Office365Mail\Transport\Office365AddedTransportManager' not found in file Office365MailServiceProvider.php

...
use Office365Mail\Transport\Office365AddedTransportManager;
...
    protected function registerSwiftTransport()
        {
            $this->app->singleton('swift.transport', function ($app) {
                return new Office365AddedTransportManager($app);
            });
...

Changing this to the following should fix the issue:

...
use Office365Mail\Transport\Office365MailAddedTransportManager;
...
    protected function registerSwiftTransport()
        {
            $this->app->singleton('swift.transport', function ($app) {
                return new Office365MailAddedTransportManager($app);
            });
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions