Failed Conditions
Pull Request — master (#10)
by Maximo
03:05
created

MailProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
0 ignored issues
show
Coding Style introduced by
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
8
class MailProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param DiInterface $container
12
     */
13 4
    public function register(DiInterface $container)
14
    {
15 4
        $config = $container->getShared('config');
16
17 4
        $container->setShared(
18 4
            'mail',
19
            function () use ($config) {
20
                $mailer = new \Baka\Mail\Manager($config->email->toArray());
21
                return $mailer->createMessage();
22 4
            }
23
        );
24 4
    }
25
}
26