Issues (6)

src/helpers.php (1 issue)

Labels
Severity
1
<?php
2
3
use DingNotice\DingTalk;
4
5
if (!function_exists('ding')){
6
7
    /**
8
     * @return bool|DingTalk
9
     */
10
    function ding(){
11
12
        $arguments = func_get_args();
13
14
        $dingTalk = app(DingTalk::class);
0 ignored issues
show
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

14
        $dingTalk = /** @scrutinizer ignore-call */ app(DingTalk::class);
Loading history...
15
16
        if (empty($arguments)) {
17
            return $dingTalk;
18
        }
19
20
        if (is_string($arguments[0])) {
21
            $robot = $arguments[1] ?? 'default';
22
            return $dingTalk->with($robot)->text($arguments[0]);
23
        }
24
25
    }
26
}