GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 2ad4a9...13b53f )
by Tom Van
25s
created

Coordinates::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * PHP Exif Coordinates ValueObject
4
 *
5
 * @link        http://github.com/PHPExif/php-exif-common for the canonical source repository
6
 * @copyright   Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
7
 * @license     http://github.com/PHPExif/php-exif-common/blob/master/LICENSE MIT License
8
 * @category    PHPExif
9
 * @package     Common
10
 * @codeCoverageIgnore
11
 */
12
13
namespace PHPExif\Common\Data\ValueObject;
14
15
use \InvalidArgumentException;
16
use \JsonSerializable;
17
use \RuntimeException;
18
19
/**
20
 * Coordinates class
21
 *
22
 * A value object to describe the coordinates of an image
23
 *
24
 * @category    PHPExif
25
 * @package     Common
26
 */
27
class Coordinates implements JsonSerializable
28
{
29
    /**
30
     * The latitude
31
     *
32
     * @var DigitalDegrees
33
     */
34
    private $latitude;
35
36
    /**
37
     * The longitude
38
     *
39
     * @var DigitalDegrees
40
     */
41
    private $longitude;
42
43
    /**
44
     * @param DigitalDegrees $latitude
45
     * @param DigitalDegrees $longitude
46
     */
47
    public function __construct(DigitalDegrees $latitude, DigitalDegrees $longitude)
48
    {
49
        $this->setLatitude($latitude);
50
        $this->setLongitude($longitude);
51
    }
52
53
    /**
54
     * Sets the latitude
55
     *
56
     * @param DigitalDegrees $latitude
57
     *
58
     * @return void
59
     */
60
    private function setLatitude(DigitalDegrees $latitude)
61
    {
62
        $this->latitude = $latitude;
63
    }
64
65
    /**
66
     * Sets the longitude
67
     *
68
     * @param DigitalDegrees $longitude
69
     *
70
     * @return void
71
     */
72
    private function setLongitude(DigitalDegrees $longitude)
73
    {
74
        $this->longitude = $longitude;
75
    }
76
77
    /**
78
     * Getter for latitude
79
     *
80
     * @return DigitalDegrees
81
     */
82
    public function getLatitude()
83
    {
84
        return $this->latitude;
85
    }
86
87
    /**
88
     * Getter for longitude
89
     *
90
     * @return DigitalDegrees
91
     */
92
    public function getLongitude()
93
    {
94
        return $this->longitude;
95
    }
96
97
    /**
98
     * Creates a new instance from given Coordinates object
99
     *
100
     * @param Coordinates $coordinates
101
     *
102
     * @return Coordinates
103
     */
104
    public static function fromCoordinates(Coordinates $coordinates)
105
    {
106
        return new self(
107
            (clone $coordinates->getLatitude()),
108
            (clone $coordinates->getLongitude())
109
        );
110
    }
111
112
    /**
113
     * @inheritDoc
114
     *
115
     * @return string
116
     */
117
    public function jsonSerialize()
118
    {
119
        return [
120
            'latitude' => $this->getLatitude(),
121
            'longitude' => $this->getLongitude(),
122
        ];
123
    }
124
125
    /**
126
     * Returns string representation
127
     *
128
     * @return string
129
     */
130
    public function __toString()
131
    {
132
        return sprintf(
133
            '%1$s,%2$s',
134
            (string) $this->getLatitude(),
135
            (string) $this->getLongitude()
136
        );
137
    }
138
}
139