OpenStreetMap::getMap()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 3
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 3
rs 10
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