Completed
Pull Request — master (#4)
by Elf
01:49
created

helpers.php ➔ apps()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (! function_exists('apps')) {
4
    /**
5
     * Obtain the Apps instance.
6
     *
7
     * @return \ElfSundae\Laravel\Apps\Apps
8
     */
9
    function apps()
10
    {
11 1
        return app('apps');
12
    }
13
}
14
15
if (! function_exists('app_id')) {
16
    /**
17
     * Get or check the current application identifier.
18
     *
19
     * @return string|bool
20
     */
21
    function app_id()
22
    {
23 1
        return app('apps')->id(...func_get_args());
24
    }
25
}
26
27
if (! function_exists('app_url')) {
28
    /**
29
     * Generate an absolute URL to a path for the given application identifier.
30
     *
31
     * @param  string  $appId
32
     * @param  string  $path
33
     * @param  mixed  $extra
34
     * @return string
35
     */
36
    function app_url($appId = '', $path = '', $extra = [])
37
    {
38 1
        return app('apps')->url($appId, $path, $extra);
39
    }
40
}
41