Completed
Pull Request — master (#27)
by Karl
05:54
created

PremiumUserSignup   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 49
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A via() 0 4 1
A toMail() 0 12 2
1
<?php namespace JobApis\JobsToMail\Notifications;
2
3
use Illuminate\Notifications\Notification;
4
use Illuminate\Notifications\Messages\MailMessage;
5
use JobApis\JobsToMail\Models\Token;
6
7
class PremiumUserSignup extends Notification
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $data;
13
14
    /**
15
     * Create a new notification instance.
16
     *
17
     * @param Token $token
0 ignored issues
show
Bug introduced by
There is no parameter named $token. 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...
18
     *
19
     * @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...
20
     */
21 1
    public function __construct($data)
22
    {
23 1
        $this->data = $data;
24 1
    }
25
26
    /**
27
     * Get the notification's delivery channels.
28
     *
29
     * @param  mixed  $notifiable
30
     * @return array
31
     */
32
    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...
33
    {
34
        return ['mail'];
35
    }
36
37
    /**
38
     * Get the mail representation of the notification.
39
     *
40
     * @param  mixed  $notifiable
41
     * @return \Illuminate\Notifications\Messages\MailMessage
42
     */
43
    public function toMail($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...
44
    {
45
        $message = (new MailMessage())
46
            ->subject('New Premium User Signup')
47
            ->line('A new user is interested in JobsToMail premium: ');
48
49
        foreach ($this->data as $key => $value) {
50
            $message->line($key . ': ' . $value);
51
        }
52
53
        return $message;
54
    }
55
}
56