Shape::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chipmunk;
6
7
/**
8
 * Allocate and initialize a segment shape.
9
 */
10
class Shape extends AbstractFfi
11
{
12
    public function __construct(Body $body, Vector $a, Vector $b, float $radius)
13
    {
14
        parent::__construct();
15
16
        $this->setCData(
17
            $this->getFfi()->cpSegmentShapeNew(
0 ignored issues
show
Bug introduced by
The method cpSegmentShapeNew() does not exist on FFI. ( Ignorable by Annotation )

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

17
            $this->getFfi()->/** @scrutinizer ignore-call */ cpSegmentShapeNew(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
18
                $body->getCData(),
19
                $a->getCData(),
20
                $b->getCData(),
21
                $radius
22
            )
23
        );
24
    }
25
26
    public function getFriction(): float
27
    {
28
        return $this->getFfi()->cpShapeGetFriction($this->getCData());
0 ignored issues
show
Bug introduced by
The method cpShapeGetFriction() does not exist on FFI. ( Ignorable by Annotation )

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

28
        return $this->getFfi()->/** @scrutinizer ignore-call */ cpShapeGetFriction($this->getCData());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
    }
30
31
    public function setFriction(float $friction): self
32
    {
33
        $this->getFfi()->cpShapeSetFriction($this->getCData(), $friction);
0 ignored issues
show
Bug introduced by
The method cpShapeSetFriction() does not exist on FFI. ( Ignorable by Annotation )

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

33
        $this->getFfi()->/** @scrutinizer ignore-call */ cpShapeSetFriction($this->getCData(), $friction);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
35
        return $this;
36
    }
37
}
38