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

PushNotifications::assemble()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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