Completed
Push — master ( 45d6cb...e1137c )
by WEBEWEB
01:33
created

NotificationFactory::newSuccessNotification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Factory;
13
14
use WBW\Bundle\CoreBundle\Notification\DangerNotification;
15
use WBW\Bundle\CoreBundle\Notification\DefaultNotification;
16
use WBW\Bundle\CoreBundle\Notification\InfoNotification;
17
use WBW\Bundle\CoreBundle\Notification\NotificationInterface;
18
use WBW\Bundle\CoreBundle\Notification\SuccessNotification;
19
use WBW\Bundle\CoreBundle\Notification\WarningNotification;
20
21
/**
22
 * Notification factory.
23
 *
24
 * @author webeweb <https://github.com/webeweb/>
25
 * @package WBW\Bundle\CoreBundle\Factory
26
 */
27
class NotificationFactory {
28
29
    /**
30
     * Create a danger notification.
31
     *
32
     * @param string $content The content.
33
     * @return NotificationInterface Returns the danger notification.
34
     */
35
    public static function newDangerNotification($content) {
36
        return new DangerNotification($content);
37
    }
38
39
    /**
40
     * Create a default notification.
41
     *
42
     * @param string $content The content.
43
     * @param string $type The type.
44
     * @return NotificationInterface Returns the default notification.
45
     */
46
    public static function newDefaultNotification($content, $type) {
47
        return new DefaultNotification($type, $content);
48
    }
49
50
    /**
51
     * Create a info notification.
52
     *
53
     * @param string $content The content.
54
     * @return NotificationInterface Returns the info notification.
55
     */
56
    public static function newInfoNotification($content) {
57
        return new InfoNotification($content);
58
    }
59
60
    /**
61
     * Create a success notification.
62
     *
63
     * @param string $content The content.
64
     * @return NotificationInterface Returns the success notification.
65
     */
66
    public static function newSuccessNotification($content) {
67
        return new SuccessNotification($content);
68
    }
69
70
    /**
71
     * Create a warning notification.
72
     *
73
     * @param string $content The content.
74
     * @return NotificationInterface Returns the warning notification.
75
     */
76
    public static function newWarningNotification($content) {
77
        return new WarningNotification($content);
78
    }
79
80
}
81