Completed
Pull Request — master (#66)
by Marko
02:37
created

Cylinder::reset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 21, 2016 - 12:24:13 PM
5
 * Contact      [email protected]
6
 * @copyright   2016 Marko Kungla - https://github.com/mkungla
7
 * @license     The MIT License (MIT)
8
 *
9
 * @category       AframeVR
10
 * @package        aframe-php
11
 *
12
 * Lang         PHP (php version >= 7)
13
 * Encoding     UTF-8
14
 * File         Cylinder.php
15
 * Code format  PSR-2 and 12
16
 * @link        https://github.com/mkungla/aframe-php
17
 * @issues      https://github.com/mkungla/aframe-php/issues
18
 * ********************************************************************
19
 * Contributors:
20
 * @author Marko Kungla <[email protected]>
21
 * ********************************************************************
22
 * Comments:
23
 * @formatter:on */
24
namespace AframeVR\Extras\Primitives;
25
26
use \AframeVR\Core\Entity;
27
use \AframeVR\Interfaces\EntityInterface;
28
29
class Cylinder extends Entity implements EntityInterface
30
{
31
32
    /**
33
     * <a-cylinder>
34
     *
35
     * The cylinder primitive is an entity that prescribes the geometry with its geometric primitive set to cylinder.
36
     * It can be used to create tubes and curved surfaces.
37
     *
38
     * @return void
39
     */
40 3
    public function reset()
41
    {
42 3
        parent::reset();
43 3
        $this->attr('Material');
44 3
        $this->attr('Geometry')->primitive('cylinder');
45 3
    }
46
47
    /**
48
     * geometry.height
49
     *
50
     * @param float $height
51
     * @return self
52
     */
53 2
    public function height(float $height)
54
    {
55 2
        $this->attr('Geometry')->height($height);
56 2
        return $this;
57
    }
58
59
    /**
60
     * geometry.openEnded
61
     *
62
     * @param bool $openEnded
63
     * @return self
64
     */
65 2
    public function openEnded(bool $openEnded = false)
66
    {
67 2
        $this->attr('Geometry')->openEnded($openEnded);
68 2
        return $this;
69
    }
70
71
    /**
72
     * geometry.radius
73
     *
74
     * @param float $radius
75
     * @return self
76
     */
77 2
    public function radius(float $radius)
78
    {
79 2
        $this->attr('Geometry')->radius($radius);
80 2
        return $this;
81
    }
82
83
    /**
84
     * geometry.segmentsHeight
85
     *
86
     * @param int $segmentsHeight
87
     * @return self
88
     */
89 2
    public function segmentsHeight(int $segmentsHeight)
90
    {
91 2
        $this->attr('Geometry')->segmentsHeight($segmentsHeight);
92 2
        return $this;
93
    }
94
95
    /**
96
     * geometry.segmentsRadial
97
     *
98
     * @param int $segmentsRadial
99
     * @return self
100
     */
101 2
    public function segmentsRadial(int $segmentsRadial)
102
    {
103 2
        $this->attr('Geometry')->segmentsRadial($segmentsRadial);
104 2
        return $this;
105
    }
106
107
    /**
108
     * geometry.thetaLength
109
     *
110
     * @param int $thetaLength
111
     * @return self
112
     */
113 2
    public function thetaLength(int $thetaLength)
114
    {
115 2
        $this->attr('Geometry')->thetaLength($thetaLength);
116 2
        return $this;
117
    }
118
119
    /**
120
     * geometry.thetaStart
121
     *
122
     * @param int $thetaStart
123
     * @return self
124
     */
125 2
    public function thetaStart(int $thetaStart)
126
    {
127 2
        $this->attr('Geometry')->thetaStart($thetaStart);
128 2
        return $this;
129
    }
130
131
    /**
132
     * material.side
133
     *
134
     * @param bool $openEnded
0 ignored issues
show
Bug introduced by
There is no parameter named $openEnded. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
135
     * @return self
136
     */
137
    public function side(string $side)
138
    {
139
        $this->attr('Material')->side($side);
140
        return $this;
141
    }
142
}
143