MessageSent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A build() 0 6 1
1
<?php
2
3
namespace Robertgarrigos\Contact\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use Illuminate\Queue\SerializesModels;
8
9
class MessageSent extends Mailable
10
{
11
    use Queueable, SerializesModels;
12
13
    public $name;
14
    public $email;
15
    public $text;
16
17
    /**
18
     * Create a new message instance.
19
     *
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22
    public function __construct(string $name, string $email, string $text)
23
    {
24
        $this->name = $name;
25
        $this->email = $email;
26
        $this->text = $text;
27
    }
28
29
    /**
30
     * Build the message.
31
     *
32
     * @return $this
33
     */
34
    public function build()
35
    {
36
        return $this->from($this->email, $this->name)
37
                    ->markdown('contact::email.sent')
38
                    ->subject(__('contact.subject'));
39
    }
40
}
41