Completed
Push — master ( fafbf7...a6c735 )
by Vladimir
04:01
created

Location::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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