helpers.php ➔ notify()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 3
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Arcanedev\Notify\Contracts\Notify;
6
7
if ( ! function_exists('notify')) {
8
    /**
9
     * Notify Helper function.
10
     *
11
     * @param  string|null  $message
12
     * @param  string       $type
13
     * @param  array        $extra
14
     *
15
     * @return \Arcanedev\Notify\Contracts\Notify
16
     */
17
    function notify(string $message = null, string $type = 'info', array $extra = []): Notify
18
    {
19
        /** @var  Arcanedev\Notify\Contracts\Notify  $notifier */
20
        $notifier = app(Notify::class);
21
22
        if (is_null($message)) {
23
            return $notifier;
24
        }
25
26
        return $notifier->flash($message, $type, $extra);
27
    }
28
}
29