MailComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 36
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMail() 0 4 1
1
<?php
2
3
namespace CodeZero\Mailer;
4
5
abstract class MailComposer
6
{
7
    /**
8
     * Mail
9
     *
10
     * @var Mail
11
     */
12
    private $mail;
13
14
    /**
15
     * Create a new mail instance.
16
     *
17
     * @param Mail $mail
18
     */
19 2
    public function __construct(Mail $mail)
20
    {
21 2
        $this->mail = $mail;
22 2
    }
23
24
    /**
25
     * Compose an e-mail.
26
     *
27
     * @param string $toEmail
28
     * @param string $toName
29
     * @param string $subject
30
     * @param string $view
31
     * @param array $data
32
     * @param callable $options
33
     *
34
     * @return \CodeZero\Mailer\Mail
35
     */
36 1
    protected function getMail($toEmail, $toName, $subject, $view, array $data = array(), $options = null)
37
    {
38 1
        return $this->mail->compose($toEmail, $toName, $subject, $view, $data, $options);
39
    }
40
}
41