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.

SplitPointField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 37
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getLatitudeColumn() 0 4 1
A getLongitudeColumn() 0 4 1
1
<?php
2
namespace Solvire\API\Serializers\DataFields;
3
4
use Solvire\API\Exceptions\InvalidParameterException;
5
use Solvire\Utilities\OptionsChecker as Ch;
6
7
/**
8
 * Kind of a hack to couple the data elements in separate fields as a single point for representation
9
 * In GIS databases this would be one data element.
10
 *
11
 *
12
 * @author solvire <[email protected]>
13
 * @package DataFields
14
 * @namespace Solvire\API\Serializers\DataFields
15
 */
16
class SplitPointField extends PointField
17
{
18
19
    protected $requiredFields = [
20
        'latitudeColumn',
21
        'longitudeColumn'
22
    ];
23
24
    protected $cast = 'array';
25
26
    protected $latitudeColumn = 'latitude';
27
28
    protected $longitudeColumn = 'longitude';
29
30
    /**
31
     * among the other variables we need to have the column names for longitude and latitude added in here
32
     *
33
     * @param array $options            
34
     */
35 3
    public function __construct($options)
36
    {
37 3
        Ch::ek($options, $this->requiredFields);
38 3
        $this->latitudeColumn = $options['latitudeColumn'];
39 3
        $this->longitudeColumn = $options['longitudeColumn'];
40 3
        parent::__construct($options);
41 3
    }
42
43 2
    public function getLatitudeColumn()
44
    {
45 2
        return $this->latitudeColumn;
46
    }
47
48 2
    public function getLongitudeColumn()
49
    {
50 2
        return $this->longitudeColumn;
51
    }
52
}
53