NotificationFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 2
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