Test Failed
Pull Request — master (#70)
by Rafael
05:34
created

MailProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
ccs 5
cts 6
cp 0.8333
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
                return $mailer->createMessage();
23 72
            }
24
        );
25 72
    }
26
}
27