Vector   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A setX() 0 5 1
A getY() 0 3 1
A getX() 0 3 1
A setY() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chipmunk;
6
7
class Vector extends AbstractFfi
8
{
9
    public function __construct(float $x = 0.0, float $y = 0.0)
10
    {
11
        parent::__construct();
12
13
        $this->setCData($this->getFfi()->new('cpVect'));
14
15
        $this->getCData()->x = $x;
0 ignored issues
show
Bug introduced by
The property x does not seem to exist on FFI\CData.
Loading history...
16
        $this->getCData()->y = $y;
0 ignored issues
show
Bug introduced by
The property y does not seem to exist on FFI\CData.
Loading history...
17
    }
18
19
    public function getX(): float
20
    {
21
        return $this->getCData()->x;
0 ignored issues
show
Bug introduced by
The property x does not seem to exist on FFI\CData.
Loading history...
22
    }
23
24
    public function setX(float $x): self
25
    {
26
        $this->getCData()->x = $x;
0 ignored issues
show
Bug introduced by
The property x does not seem to exist on FFI\CData.
Loading history...
27
28
        return $this;
29
    }
30
31
    public function getY(): float
32
    {
33
        return $this->getCData()->y;
0 ignored issues
show
Bug introduced by
The property y does not seem to exist on FFI\CData.
Loading history...
34
    }
35
36
    public function setY(float $y): self
37
    {
38
        $this->getCData()->y = $y;
0 ignored issues
show
Bug introduced by
The property y does not seem to exist on FFI\CData.
Loading history...
39
40
        return $this;
41
    }
42
}
43