OpenStreetMap   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMap() 0 5 3
1
<?php
2
3
/**
4
 * OpenStreetMap link
5
 */
6
7
namespace Hepa19\IPGeo;
8
9
/**
10
 * Get link to Open Street Map based on IP address
11
 *
12
 */
13
class OpenStreetMap
14
{
15
    /**
16
     * Get OpenStreetMap URL
17
     *
18
     * @var float $longitude   Longitude
19
     * @var float $latitude   Latitude
20
     *
21
     * @return string|void
22
     */
23
24 5
    public function getMap($longitude, $latitude)
25
    {
26 5
        if (!empty($longitude) && !empty($latitude)) {
27 5
            $link = "https://www.openstreetmap.org/#map=13/$latitude/$longitude";
28 5
            return $link;
29
        }
30
    }
31
}
32