ExampleMailComposer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 12 1
1
<?php
2
3
namespace App;
4
5
use CodeZero\Mailer\MailComposer;
6
7
class ExampleMailComposer extends MailComposer
8
{
9
    /**
10
     * Compose a welcome mail. (example)
11
     *
12
     * @param string $email
13
     * @param string $firstname
14
     *
15
     * @return \CodeZero\Mailer\Mail
16
     */
17
    public function compose($email, $firstname)
18
    {
19
        $toEmail = $email;
20
        $toName = $firstname;
21
        $subject = 'Welcome!';
22
        $view = 'emails.welcome';
23
        $data = [
24
            'name' => $firstname
25
        ];
26
27
        return $this->getMail($toEmail, $toName, $subject, $view, $data);
28
    }
29
}
30