Coordinates::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace SDIS62\Core\Ops\Entity;
4
5
use Datetime;
6
7
class Coordinates
8
{
9
    /**
10
     * Latitude.
11
     *
12
     * @var float
13
     */
14
    protected $latitude;
15
16
    /**
17
     * Longitude.
18
     *
19
     * @var float
20
     */
21
    protected $longitude;
22
23
    /**
24
     * Timestamp.
25
     *
26
     * @var Datetime
27
     */
28
    protected $date;
29
30
    /**
31
     * Création d'une coordonnée.
32
     *
33
     * @param float    $x
0 ignored issues
show
Bug introduced by
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
34
     * @param float    $y
0 ignored issues
show
Bug introduced by
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
35
     * @param Datetime $date
36
     */
37
    public function __construct($latitude, $longitude, Datetime $date = null)
38
    {
39
        $this->setCoordinates($latitude, $longitude, $date);
40
    }
41
42
    /**
43
     * Set the value of Point Y.
44
     *
45
     * @param float    $x
0 ignored issues
show
Bug introduced by
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
46
     * @param float    $y
0 ignored issues
show
Bug introduced by
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
47
     * @param Datetime $date
48
     *
49
     * @return self
50
     */
51
    public function setCoordinates($latitude, $longitude, Datetime $date = null)
52
    {
53
        $this->latitude  = $latitude;
54
        $this->longitude = $longitude;
55
        $this->date      = empty($date) ? new Datetime() : $date;
56
57
        return $this;
58
    }
59
60
    /**
61
     * Get the value of Point X.
62
     *
63
     * @return float
64
     */
65
    public function getLatitude()
66
    {
67
        return $this->latitude;
68
    }
69
70
    /**
71
     * Get the value of Point Y.
72
     *
73
     * @return float
74
     */
75
    public function getLongitude()
76
    {
77
        return $this->longitude;
78
    }
79
80
    /**
81
     * Get the value of Timestamp.
82
     *
83
     * @return Datetime
84
     */
85
    public function getDate()
86
    {
87
        return $this->date;
88
    }
89
}
90