Vector::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 10
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