MaxMindOptions::getKey()   A
last analyzed

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 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CodeblogPro\GeoLocation\Application\GeoIpRemoteServices;
4
5
use CodeblogPro\GeoLocation\Application\Interfaces\RemoteServicesOptions;
6
use Illuminate\Support\Facades\Config;
7
8
class MaxMindOptions implements RemoteServicesOptions
9
{
10
    public function isEnabled(): bool
11
    {
12
        return (bool)(Config('geolocation.maxmind.enabled') ?? false);
0 ignored issues
show
Bug introduced by
The function Config 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

12
        return (bool)(/** @scrutinizer ignore-call */ Config('geolocation.maxmind.enabled') ?? false);
Loading history...
13
    }
14
15
    public function getSort(): int
16
    {
17
        return (int)(Config('geolocation.maxmind.sort') ?? 0);
0 ignored issues
show
Bug introduced by
The function Config 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

17
        return (int)(/** @scrutinizer ignore-call */ Config('geolocation.maxmind.sort') ?? 0);
Loading history...
18
    }
19
20
    public function getKey(): string
21
    {
22
        return 'Token ' . Config('geolocation.maxmind.key');
0 ignored issues
show
Bug introduced by
The function Config 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

22
        return 'Token ' . /** @scrutinizer ignore-call */ Config('geolocation.maxmind.key');
Loading history...
23
    }
24
25
    public function getUrl(): string
26
    {
27
        return Config('geolocation.maxmind.url');
0 ignored issues
show
Bug introduced by
The function Config 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

27
        return /** @scrutinizer ignore-call */ Config('geolocation.maxmind.url');
Loading history...
28
    }
29
}
30