NotificationFactory::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 2
nc 2
nop 3
1
<?php
2
3
namespace JK\NotificationBundle\Factory;
4
5
use JK\NotificationBundle\Entity\Notification;
6
7
class NotificationFactory implements NotificationFactoryInterface
8
{
9
    public function create(string $title, string $content, string $ownerId = null): Notification
10
    {
11
        $notification = new Notification();
12
        $notification->setTitle($title);
13
        $notification->setContent($content);
14
15
        if ($ownerId) {
16
            $notification->setOwnerId($ownerId);
17
        }
18
19
        return $notification;
20
    }
21
}
22