Location   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 8
eloc 17
dl 0
loc 52
c 0
b 0
f 0
ccs 11
cts 22
cp 0.5
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setParameters() 0 5 1
A getLatitude() 0 3 1
A setLongitude() 0 5 1
A __construct() 0 5 1
A setLatitude() 0 5 1
A make() 0 3 1
A getLongitude() 0 3 1
A getParameters() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Templates;
6
7
use Illuminate\Support\Collection;
8
9
class Location
10
{
11
    private $latitude;
12
    private $longitude;
13
    private $parameters;
14
15 1
    public function __construct(float $latitude, float $longitude, array $parameters = [])
16
    {
17 1
        $this->latitude = $latitude;
18 1
        $this->longitude = $longitude;
19 1
        $this->parameters = collect($parameters);
20 1
    }
21
22 1
    public static function make(float $latitude, float $longitude, array $parameters = [])
23
    {
24 1
        return new static($latitude, $longitude, $parameters);
25
    }
26
27 1
    public function getLatitude(): float
28
    {
29 1
        return $this->latitude;
30
    }
31
32
    public function setLatitude(float $latitude): Location
33
    {
34
        $this->latitude = $latitude;
35
36
        return $this;
37
    }
38
39 1
    public function getLongitude(): float
40
    {
41 1
        return $this->longitude;
42
    }
43
44
    public function setLongitude(float $longitude): Location
45
    {
46
        $this->longitude = $longitude;
47
48
        return $this;
49
    }
50
51
    public function getParameters(): Collection
52
    {
53
        return $this->parameters;
54
    }
55
56
    public function setParameters(array $parameters): Location
57
    {
58
        $this->parameters = collect($parameters);
59
60
        return $this;
61
    }
62
}
63