Test Failed
Pull Request — master (#70)
by Rafael
05:48
created

UsersPushNotifications::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 5
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
use Gewaer\Models\Notifications;
9
use Gewaer\Notifications\PushNotifications\PushNotifications as PushNotifications;
10
use Gewaer\Traits\NotificationsTrait;
11
12
class UsersPushNotifications extends PushNotifications implements PushNotificationsContract
13
{
14
    /**
15
     * Notifications Trait
16
     */
17
    use NotificationsTrait;
18
19
    /**
20
     * Constructor
21
     */
22
    public function __construct(Users $user, string $content, string $systemModule)
23
    {
24
        $this->user = $user;
25
        $this->content  = $content;
26
        $this->systemModule = $systemModule;
27
    }
28
29
    /**
30
     * Assemble an Apps Push Notification
31
     * @todo Create specific assembler for apps push notifications
32
     */
33
    public function assemble()
34
    {
35
        /**
36
         * Create a new database record
37
         */
38
        self::create($this->user,$this->content,Notifications::USERS,$this->systemModule);
39
40
        return $this->content . " From Users";
41
    }
42
}
43