Passed
Push — main ( b0a561...bd46d7 )
by John
03:47
created

Toast   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A danger() 0 3 1
A warning() 0 3 1
A info() 0 3 1
A debug() 0 3 1
A success() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usernotnull\Toast;
6
7
class Toast
8
{
9
    public function danger(string $message, string $title = null): Notification
10
    {
11
        return new Notification($message, $title, NotificationType::$danger);
12
    }
13
14
    public function debug(string $message, string $title = null): Notification
15
    {
16
        return new Notification($message, $title, NotificationType::$debug);
17
    }
18
19
    public function info(string $message, string $title = null): Notification
20
    {
21
        return new Notification($message, $title, NotificationType::$info);
22
    }
23
24
    public function success(string $message, string $title = null): Notification
25
    {
26
        return new Notification($message, $title, NotificationType::$success);
27
    }
28
29
    public function warning(string $message, string $title = null): Notification
30
    {
31
        return new Notification($message, $title, NotificationType::$warning);
32
    }
33
}
34