Passed
Branch master (8cb5b2)
by Christopher
04:33 queued 12s
created

Location   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLongitude() 0 3 1
A __construct() 0 4 1
A getLatitude() 0 3 1
1
<?php
0 ignored issues
show
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
namespace Triadev\Leopard\Model;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
class Location
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
5
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Location
Loading history...
6
    /** @var float */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
7
    private $latitude;
1 ignored issue
show
Coding Style introduced by
Private member variable "latitude" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "latitude" must be prefixed with an underscore
Loading history...
8
    
9
    /** @var float */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
10
    private $longitude;
0 ignored issues
show
Coding Style introduced by
Private member variable "longitude" must contain a leading underscore
Loading history...
Coding Style introduced by
Private member variable "longitude" must be prefixed with an underscore
Loading history...
11
    
12
    /**
13
     * Location constructor.
14
     * @param float $latitude
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
Coding Style introduced by
Missing parameter comment
Loading history...
15
     * @param float $longitude
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
16
     */
17 2
    public function __construct(float $latitude, float $longitude)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
18
    {
19 2
        $this->latitude = $latitude;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
20 2
        $this->longitude = $longitude;
21 2
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end __construct()
Loading history...
22
    
23
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
24
     * @return float
25
     */
26 2
    public function getLatitude(): float
27
    {
28 2
        return $this->latitude;
29
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getLatitude()
Loading history...
30
    
31
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
32
     * @return float
33
     */
34 2
    public function getLongitude(): float
35
    {
36 2
        return $this->longitude;
37
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getLongitude()
Loading history...
38
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
39