Passed
Push — master ( 5457d9...2ab55b )
by Maximo
03:08 queued 11s
created

MailProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
use Baka\Mail\Manager as BakaMail;
8
9
class MailProvider implements ServiceProviderInterface
10
{
11
    /**
12
     * @param DiInterface $container
13
     */
14 72
    public function register(DiInterface $container)
15
    {
16 72
        $config = $container->getShared('config');
17
18 72
        $container->setShared(
19 72
            'mail',
20
            function () use ($config) {
21 1
                $mailer = new BakaMail($config->email->toArray());
22 1
                return $mailer->createMessage();
23 72
            }
24
        );
25 72
    }
26
}
27