Passed
Pull Request — master (#12)
by Laurens
01:42
created

AbstractLocation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getValue() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbook\MetaData\SemanticTag;
6
7
use LauLamanApps\ApplePassbook\MetaData\SemanticTag;
8
9
abstract class AbstractLocation implements SemanticTag
10
{
11
    private float $latitude;
12
    private float $longitude;
13
14
    public function __construct(
15
        float $latitude,
16
        float $longitude
17
    ) {
18
        $this->latitude = $latitude;
19
        $this->longitude = $longitude;
20
    }
21
22
    /**
23
     * @return array<string, float>
24
     */
25
    public function getValue(): array
26
    {
27
        return [
28
            'latitude' => $this->latitude,
29
            'longitude' => $this->longitude,
30
        ];
31
    }
32
}