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

RingMethods   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 96
ccs 18
cts 18
cp 1
rs 10
c 1
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A radiusInner() 0 4 1
A radiusOuter() 0 4 1
A thetaLength() 0 4 1
A thetaStart() 0 4 1
A segmentsTheta() 0 4 1
A segmentsPhi() 0 4 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 27, 2016 - 5:45:05 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         RingMethods.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 RingMethods
27
{
28
29
    /**
30
     * The ring geometry defines a flat ring, like a CD.
31
     * Note that because it is flat,
32
     * only a single side of the ring will be rendered if side: double is not specified on the material component.
33
     */
34
    const DEFAULTS = array(
35
        /* Radius of the inner hole of the ring. */
36
        'radiusInner' => 1,
37
        /* Radius of the outer edge of the ring. */
38
        'radiusOuter' => 1,
39
        /* Number of segments. A higher number means the ring will be more round */
40
        'segmentsTheta' => 32,
41
        /* Number of triangles within each face defined by segmentsTheta. */
42
        'segmentsPhi' => 8,
43
        /* Starting angle in degrees. */
44
        'thetaStart' => 0,
45
        /* Central angle in degrees. */
46
        'thetaLength' => 360
47
    );
48
49
    /**
50
     * Radius of the inner hole of the ring.
51
     *
52
     * @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...
53
     * @param float|int $radiusInner            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $radiusInner a bit more specific; maybe use double.
Loading history...
54
     * @return void
55
     */
56 1
    public function radiusInner(array &$dom_attributes, float $radiusInner)
57
    {
58 1
        $dom_attributes['radiusInner'] = $radiusInner;
59 1
    }
60
61
    /**
62
     * Radius of the outer edge of the ring.
63
     *
64
     * @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...
65
     * @param float|int $radiusOuter            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $radiusOuter a bit more specific; maybe use double.
Loading history...
66
     * @return void
67
     */
68 1
    public function radiusOuter(array &$dom_attributes, float $radiusOuter)
69
    {
70 1
        $dom_attributes['radiusOuter'] = $radiusOuter;
71 1
    }
72
73
    /**
74
     * Central angle in degrees.
75
     *
76
     * @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...
77
     * @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...
78
     * @return void
79
     */
80 1
    public function thetaLength(array &$dom_attributes, float $thetaLength)
81
    {
82 1
        $dom_attributes['thetaLength'] = $thetaLength;
83 1
    }
84
85
    /**
86
     * Starting angle in degrees.
87
     *
88
     * @param &array $dom_attributess            
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...
Documentation introduced by
There is no parameter named $dom_attributess. Did you maybe mean $dom_attributes?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

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

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

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

Loading history...
89
     * @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...
90
     * @return void
91
     */
92 1
    public function thetaStart(array &$dom_attributes, float $thetaStart)
93
    {
94 1
        $dom_attributes['thetaStart'] = $thetaStart;
95 1
    }
96
97
    /**
98
     * Number of segments.
99
     * A higher number means the ring will be more round.
100
     *
101
     * @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...
102
     * @param int $segmentsTheta            
103
     * @return void
104
     */
105 1
    public function segmentsTheta(array &$dom_attributes, int $segmentsTheta)
106
    {
107 1
        $dom_attributes['segmentsTheta'] = $segmentsTheta;
108 1
    }
109
110
    /**
111
     * Number of triangles within each face defined by segmentsTheta.
112
     *
113
     * @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...
114
     * @param int $segmentsPhi            
115
     * @return void
116
     */
117 1
    public function segmentsPhi(array &$dom_attributes, int $segmentsPhi)
118
    {
119 1
        $dom_attributes['segmentsPhi'] = $segmentsPhi;
120 1
    }
121
}
122