Completed
Push — master ( 453b67...10e484 )
by Abdelrahman
11:57
created

VerificationSuccessNotification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
namespace Rinvex\Fort\Notifications;
17
18
use Illuminate\Support\Facades\Lang;
19
use Illuminate\Notifications\Notification;
20
use Illuminate\Notifications\Messages\MailMessage;
21
22
class VerificationSuccessNotification extends Notification
23
{
24
    /**
25
     * Indicates if the user is moderated or not.
26
     *
27
     * @var bool
28
     */
29
    public $moderated;
30
31
    /**
32
     * Create a notification instance.
33
     *
34
     * @param bool $social
0 ignored issues
show
Bug introduced by
There is no parameter named $social. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
35
     *
36
     * @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...
37
     */
38
    public function __construct($moderated = false)
39
    {
40
        $this->moderated = $moderated;
41
    }
42
    /**
43
     * Get the notification's channels.
44
     *
45
     * @param mixed $notifiable
46
     *
47
     * @return array|string
48
     */
49
    public function via($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
    {
51
        return ['mail'];
52
    }
53
54
    /**
55
     * Build the mail representation of the notification.
56
     *
57
     * @return \Illuminate\Notifications\Messages\MailMessage
58
     */
59
    public function toMail()
60
    {
61
        if ($this->moderated) {
62
            $phrase = Lang::get('rinvex.fort::email.verification.email.success.intro_moderation');
63
        } else {
64
            $phrase = Lang::get('rinvex.fort::email.verification.email.success.intro_default');
65
        }
66
67
        return (new MailMessage)
68
            ->subject(Lang::get('rinvex.fort::email.verification.email.success.subject'))
69
            ->line($phrase);
70
    }
71
}
72