helpers.php ➔ blink()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
nc 4
nop 0
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @return \Spatie\Blink\Blink|mixed
5
 */
6
function blink()
7
{
8
    $arguments = func_get_args();
9
10
    if (empty($arguments)) {
11
        return app('blink');
12
    }
13
14
    if (count($arguments) === 1) {
15
        return app('blink')->get($arguments[0]);
16
    }
17
18
    if (count($arguments) === 2) {
19
        return app('blink')->once($arguments[0], $arguments[1]);
20
    }
21
22
    throw new InvalidArgumentException('blink() expects 0, 1 or 2 arguments');
23
}
24