ConeMethods   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 2 Features 1
Metric Value
wmc 9
c 5
b 2
f 1
lcom 0
cbo 0
dl 0
loc 98
ccs 24
cts 24
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A height() 0 4 1
A openEnded() 0 4 2
A radiusBottom() 0 4 1
A radiusTop() 0 4 1
A segmentsRadial() 0 4 1
A segmentsHeight() 0 4 1
A thetaStart() 0 4 1
A thetaLength() 0 4 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 27, 2016 - 5:30:36 AM
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         ConeMethods.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\Core\Components\Geometry\Methods;
25
26
class ConeMethods
27
{
28
    /**
29
     * Height of the cone.
30
     *
31
     * @param array $dom_attributes            
32
     * @param double $height            
33
     * @return void
34
     */
35 3
    public function height(array &$dom_attributes, float $height)
36
    {
37 3
        $dom_attributes['height'] = $height;
38 3
    }
39
40
    /**
41
     * Whether the ends of the cone are open (true) or capped (false).
42
     *
43
     * @param array $dom_attributes            
44
     * @param bool|false $openEnded            
45
     * @return void
46
     */
47 3
    public function openEnded(array &$dom_attributes, bool $openEnded = false)
48
    {
49 3
        $dom_attributes['openEnded'] = $openEnded ? 'true' : 'false';
50 3
    }
51
52
    /**
53
     * Radius of the bottom end of the cone.
54
     *
55
     * @param array $dom_attributes            
56
     * @param double $radiusBottom            
57
     * @return void
58
     */
59 3
    public function radiusBottom(array &$dom_attributes, float $radiusBottom)
60
    {
61 3
        $dom_attributes['radiusBottom'] = $radiusBottom;
62 3
    }
63
64
    /**
65
     * Radius of the top end of the cone.
66
     *
67
     * @param array $dom_attributes            
68
     * @param double $radiusTop            
69
     * @return void
70
     */
71 3
    public function radiusTop(array &$dom_attributes, float $radiusTop)
72
    {
73 3
        $dom_attributes['radiusTop'] = $radiusTop;
74 3
    }
75
76
    /**
77
     * Number of segmented faces around the circumference of the cone.
78
     *
79
     * @param array $dom_attributes            
80
     * @param int $segmentsRadial            
81
     * @return void
82
     */
83 3
    public function segmentsRadial(array &$dom_attributes, int $segmentsRadial)
84
    {
85 3
        $dom_attributes['segmentsRadial'] = $segmentsRadial;
86 3
    }
87
88
    /**
89
     * Number of rows of faces along the height of the cone.
90
     *
91
     * @param array $dom_attributes            
92
     * @param int $segmentsHeight            
93
     * @return void
94
     */
95 3
    public function segmentsHeight(array &$dom_attributes, int $segmentsHeight)
96
    {
97 3
        $dom_attributes['segmentsHeight'] = $segmentsHeight;
98 3
    }
99
100
    /**
101
     * Starting angle in degrees.
102
     *
103
     * @param array $dom_attributes            
104
     * @param double $thetaStart            
105
     * @return void
106
     */
107 3
    public function thetaStart(array &$dom_attributes, float $thetaStart)
108
    {
109 3
        $dom_attributes['thetaStart'] = $thetaStart;
110 3
    }
111
112
    /**
113
     * Central angle in degrees.
114
     *
115
     * @param array $dom_attributes            
116
     * @param double $thetaLength            
117
     * @return void
118
     */
119 3
    public function thetaLength(array &$dom_attributes, float $thetaLength)
120
    {
121 3
        $dom_attributes['thetaLength'] = $thetaLength;
122 3
    }
123
}
124