Passed
Push — trunk ( 8d4a38...24af8b )
by Christian
22:20 queued 11:00
created

MailerConfigurationCompilerPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Content\Mail;
4
5
use Shopware\Core\Content\Mail\Service\MailerTransportLoader;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\DependencyInjection\Reference;
9
10
/**
11
 * @package core
12
 *
13
 * @interal
14
 */
15
class MailerConfigurationCompilerPass implements CompilerPassInterface
16
{
17
    public function process(ContainerBuilder $container): void
18
    {
19
        $container->getDefinition('mailer.default_transport')->setFactory([
20
            new Reference(MailerTransportLoader::class),
21
            'fromString',
22
        ]);
23
24
        $container->getDefinition('mailer.transports')->setFactory([
25
            new Reference(MailerTransportLoader::class),
26
            'fromStrings',
27
        ]);
28
    }
29
}
30