Passed
Pull Request — master (#12)
by Derek Stephen
06:48 queued 58s
created

HasLocationCoordinates   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 9
c 2
b 0
f 1
dl 0
loc 26
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLatitude() 0 3 1
A setLongitude() 0 3 1
A getLongitude() 0 3 1
A setLatitude() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bone\BoneDoctrine\Traits;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
trait HasLocationCoordinates
10
{
11
    #[ORM\Column(type: 'float', precision: 17, scale: 15, nullable: true)]
12
    private float $longitude = 0.0;
13
14
    #[ORM\Column(type: 'float', precision: 17, scale: 15, nullable: true)]
15
    private float $latitude = 0.0;
16
17
    public function getLongitude(): float
18
    {
19
        return $this->longitude;
20
    }
21
22
    public function setLongitude(float $longitude): void
23
    {
24
        $this->longitude = $longitude;
25
    }
26
27
    public function getLatitude(): float
28
    {
29
        return $this->latitude;
30
    }
31
32
    public function setLatitude(float $latitude): void
33
    {
34
        $this->latitude = $latitude;
35
    }
36
}
37