MapboxRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A url() 0 18 3
1
<?php
2
3
namespace Bakerkretzmar\LaravelMapbox;
4
5
abstract class MapboxRequest
6
{
7
    protected $dataset_id;
8
9
    protected $feature_id;
10
11
    protected $tileset;
12
13
    protected $upload_id;
14
15 36
    protected function url(string $endpoint, string $id = null, array $options = [])
16
    {
17
        $segments = [
18 36
            config('laravel-mapbox.url'),
19 36
            $endpoint,
20 36
            config('laravel-mapbox.version'),
21 36
            config('laravel-mapbox.username'),
22
        ];
23
24 36
        if ($id) {
25 28
            $segments[] = $id;
26
        }
27
28 36
        if (! empty($options)) {
29 20
            $segments = array_merge($segments, $options);
30
        }
31
32 36
        return 'https://' . implode('/', $segments) . '?access_token=' . config('laravel-mapbox.token');
33
    }
34
}
35