MessageSent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
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