Completed
Pull Request — master (#4)
by ARCANEDEV
04:20
created

helpers.php ➔ notify()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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