Passed
Push — master ( 152a70...0c8393 )
by Jose
03:00
created

Coordinate   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 4
c 1
b 0
f 0
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getY() 0 3 1
A __construct() 0 2 1
A getId() 0 3 1
A getX() 0 3 1
1
<?php
2
3
namespace JMGQ\AStar\Example\Graph;
4
5
class Coordinate
6
{
7 30
    public function __construct(private int $x, private int $y)
0 ignored issues
show
Unused Code introduced by
The parameter $x is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

7
    public function __construct(/** @scrutinizer ignore-unused */ private int $x, private int $y)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $y is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

7
    public function __construct(private int $x, /** @scrutinizer ignore-unused */ private int $y)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
8
    {
9 30
    }
10
11 13
    public function getX(): int
12
    {
13 13
        return $this->x;
0 ignored issues
show
Bug Best Practice introduced by
The property x does not exist on JMGQ\AStar\Example\Graph\Coordinate. Did you maybe forget to declare it?
Loading history...
14
    }
15
16 13
    public function getY(): int
17
    {
18 13
        return $this->y;
0 ignored issues
show
Bug Best Practice introduced by
The property y does not exist on JMGQ\AStar\Example\Graph\Coordinate. Did you maybe forget to declare it?
Loading history...
19
    }
20
21 21
    public function getId(): string
22
    {
23 21
        return $this->x . 'x' . $this->y;
0 ignored issues
show
Bug Best Practice introduced by
The property y does not exist on JMGQ\AStar\Example\Graph\Coordinate. Did you maybe forget to declare it?
Loading history...
Bug Best Practice introduced by
The property x does not exist on JMGQ\AStar\Example\Graph\Coordinate. Did you maybe forget to declare it?
Loading history...
24
    }
25
}
26