Test Failed
Pull Request — master (#684)
by Morten
05:28
created

IpAddressResolver::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace OwenIt\Auditing\Resolvers;
4
5
use Illuminate\Support\Facades\Request;
6
use OwenIt\Auditing\Contracts\Auditable;
7
use OwenIt\Auditing\Contracts\Resolver;
8
9
class IpAddressResolver implements Resolver
10
{
11
    public static function resolve(Auditable $auditable): string
12
    {
13
        return Request::ip();
0 ignored issues
show
Bug Best Practice introduced by
The expression return Illuminate\Support\Facades\Request::ip() could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
14
    }
15
}
16