Test Failed
Pull Request — master (#70)
by Rafael
04:52
created

PushNotifications   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 24
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A assemble() 0 3 1
1
<?php
2
3
namespace Gewaer\Notifications\PushNotifications;
4
5
use Namshi\Notificator\Notification;
6
use Gewaer\Contracts\PushNotificationsContract;
7
use Gewaer\Models\Users;
8
9
class PushNotifications extends Notification implements PushNotificationsContract
10
{
11
    public $user;
12
13
    public $content;
14
15
    public $notificationTypeId;
16
17
    public $systemModule;
18
19
    public function __construct( Users $user,string $content, int $notificationTypeId = 0, string $systemModule)
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening parenthesis; 1 found
Loading history...
Coding Style introduced by
Expected 1 space between comma and type hint "string"; 0 found
Loading history...
Coding Style introduced by
Parameters which have default values should be placed at the end.

If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway:

// $a must always be passed; it's default value is never used.
function someFunction($a = 5, $b) { }
Loading history...
20
    {
21
        $this->user = $user;
22
        $this->content  = $content;
23
        $this->notificationTypeId = $notificationTypeId;
24
        $this->systemModule = $systemModule;
25
    }
26
27
    /**
28
     * Assemble Notification
29
     */
30
    public function assemble()
31
    {
32
        return $this->content;
33
    }
34
}
35