Completed
Branch master (fb685e)
by Marko
02:00
created

ConeMethods   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 122
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
A height() 0 4 1
A openEnded() 0 5 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
    /**
30
     * The cone primitive under the hood is a cylinder primitive with varying top and bottom radiuses.
31
     */
32
    const DEFAULTS = array(
33
        /* Height of the cone. */
34
        'height' => 2,
35
        /* Whether the ends of the cone are open (true) or capped ('false'). */
36
        'openEnded' => 'false',
37
        /* Radius of the bottom end of the cone. */
38
        'radiusBottom' => 1,
39
        /* Radius of the top end of the cone. */
40
        'radiusTop' => 1,
41
        /* Number of segmented faces around the circumference of the cone. */
42
        'segmentsRadial' => 36,
43
        /* Number of rows of faces along the height of the cone. */
44
        'segmentsHeight' => 18,
45
        /* Starting angle in degrees. */
46
        'thetaStart' => 0,
47
        /* Central angle in degrees. */
48
        'thetaLength' => 360
49
    );
50
51
    /**
52
     * Height of the cone.
53
     *
54
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
55
     * @param float|int $height            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $height a bit more specific; maybe use double.
Loading history...
56
     * @return void
57
     */
58 1
    public function height(array &$dom_attributes, float $height)
59
    {
60 1
        $dom_attributes['height'] = $height;
61 1
    }
62
63
    /**
64
     * Whether the ends of the cone are open (true) or capped (false).
65
     *
66
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
67
     * @param bool|false $openEnded            
68
     * @return void
69
     */
70 1
    public function openEnded(array &$dom_attributes, bool $openEnded = false)
71
    {
72 1
        $dom_attributes['openEnded'] = $openEnded ? 'true' : 'false';
73
        ;
74 1
    }
75
76
    /**
77
     * Radius of the bottom end of the cone.
78
     *
79
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
80
     * @param float|int $radiusBottom            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $radiusBottom a bit more specific; maybe use double.
Loading history...
81
     * @return void
82
     */
83 1
    public function radiusBottom(array &$dom_attributes, float $radiusBottom)
84
    {
85 1
        $dom_attributes['radiusBottom'] = $radiusBottom;
86 1
    }
87
88
    /**
89
     * Radius of the top end of the cone.
90
     *
91
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
92
     * @param float|int $radiusBottom            
0 ignored issues
show
Bug introduced by
There is no parameter named $radiusBottom. 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...
93
     * @return void
94
     */
95 1
    public function radiusTop(array &$dom_attributes, float $radiusTop)
96
    {
97 1
        $dom_attributes['radiusTop'] = $radiusTop;
98 1
    }
99
100
    /**
101
     * Number of segmented faces around the circumference of the cone.
102
     *
103
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
104
     * @param int $segmentsRadial            
105
     * @return void
106
     */
107 1
    public function segmentsRadial(array &$dom_attributes, int $segmentsRadial)
108
    {
109 1
        $dom_attributes['segmentsRadial'] = $segmentsRadial;
110 1
    }
111
112
    /**
113
     * Number of rows of faces along the height of the cone.
114
     *
115
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
116
     * @param int $segmentsHeight            
117
     * @return void
118
     */
119 1
    public function segmentsHeight(array &$dom_attributes, int $segmentsHeight)
120
    {
121 1
        $dom_attributes['segmentsHeight'] = $segmentsHeight;
122 1
    }
123
124
    /**
125
     * Starting angle in degrees.
126
     *
127
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
128
     * @param float|int $thetaStart            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $thetaStart a bit more specific; maybe use double.
Loading history...
129
     * @return void
130
     */
131 1
    public function thetaStart(array &$dom_attributes, float $thetaStart)
132
    {
133 1
        $dom_attributes['thetaStart'] = $thetaStart;
134 1
    }
135
136
    /**
137
     * Central angle in degrees.
138
     *
139
     * @param &array $dom_attributes            
0 ignored issues
show
Documentation introduced by
The doc-type &array could not be parsed: Unknown type name "&array" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
140
     * @param float|int $thetaLength            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $thetaLength a bit more specific; maybe use double.
Loading history...
141
     * @return void
142
     */
143 1
    public function thetaLength(array &$dom_attributes, float $thetaLength)
144
    {
145 1
        $dom_attributes['thetaLength'] = $thetaLength;
146 1
    }
147
}
148