Completed
Pull Request — master (#439)
by
unknown
09:25 queued 01:29
created

UrlResolver::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * This file is part of the Laravel Auditing package.
4
 *
5
 * @author     Antério Vieira <[email protected]>
6
 * @author     Quetzy Garcia  <[email protected]>
7
 * @author     Raphael França <[email protected]>
8
 * @copyright  2015-2018
9
 *
10
 * For the full copyright and license information,
11
 * please view the LICENSE.md file that was distributed
12
 * with this source code.
13
 */
14
15
namespace OwenIt\Auditing\Resolvers;
16
17
use Illuminate\Support\Facades\App;
18
use Illuminate\Support\Facades\Request;
19
20
class UrlResolver implements \OwenIt\Auditing\Contracts\UrlResolver
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public static function resolve(): string
26
    {
27
        if (App::runningInConsole()) {
28
            return 'console';
29
        }
30
31
        return Request::fullUrlWithQuery([]);
32
    }
33
}
34