navtoastr()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 3
dl 0
loc 9
rs 10
c 1
b 0
f 0
1
<?php
2
3
4
if (! function_exists("navtoastr"))
5
{
6
    function navtoastr(string $message = null, string $type = 'success', bool $enableCustomButton = false) {
7
8
        if (is_null($message)) {
9
10
            return app('nav-toastr');
11
            
12
        }
13
14
        return app('nav-toastr')->addNotification($type, $message, $enableCustomButton);
0 ignored issues
show
Bug introduced by
The method addNotification() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        return app('nav-toastr')->/** @scrutinizer ignore-call */ addNotification($type, $message, $enableCustomButton);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
    }
16
}
17
18
19
if(! function_exists("toastr_css") ){
20
21
    function toastr_css(){
22
23
        return '<link rel="stylesheet" type="text/css" href="'.asset('vendor/nav-toastr/assets/css/app.css').'">';
24
25
    }
26
27
}
28
29
30
if(! function_exists("toastr_js") ){
31
32
    function toastr_js(){
33
34
        return '<script type="text/javascript" src="'.asset('vendor/nav-toastr/assets/js/app.js').'"></script>';
35
36
    }
37
    
38
}