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

TorusMethods   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 81
ccs 15
cts 15
cp 1
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A radius() 0 4 1
A radiusTubular() 0 4 1
A segmentsRadial() 0 4 1
A segmentsTubular() 0 4 1
A arc() 0 4 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 27, 2016 - 5:59:08 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         TorusMethods.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 TorusMethods
27
{
28
29
    /**
30
     * The torus primitive defines a donut shape.
31
     */
32
    const DEFAULTS = array(
33
        /* Radius of the outer edge of the torus. */
34
        'radius' => 1,
35
        /* Radius of the tube. */
36
        'radiusTubular' => 0.2,
37
        /* Number of segments along the circumference of the tube ends. A higher number means the tube will be more round. */
38
        'segmentsRadial' => 36,
39
        /* Number of segments along the circumference of the tube face. A higher number means the tube will be more round. */
40
        'segmentsTubular' => 32,
41
        /* Central angle. */
42
        'arc' => 360
43
    );
44
45
    /**
46
     * Radius of the outer edge of the torus.
47
     *
48
     * @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...
49
     * @param float|int $radius            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $radius a bit more specific; maybe use double.
Loading history...
50
     * @return void
51
     */
52 1
    public function radius(array &$dom_attributes, float $radius)
53
    {
54 1
        $dom_attributes['radius'] = $radius;
55 1
    }
56
57
    /**
58
     * Radius of the tube.
59
     *
60
     * @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...
61
     * @param float|int $radiusTubular            
0 ignored issues
show
Documentation introduced by
Consider making the type for parameter $radiusTubular a bit more specific; maybe use double.
Loading history...
62
     * @return void
63
     */
64 1
    public function radiusTubular(array &$dom_attributes, float $radiusTubular)
65
    {
66 1
        $dom_attributes['radiusTubular'] = $radiusTubular;
67 1
    }
68
69
    /**
70
     * Number of segments along the circumference of the tube ends.
71
     * A higher number means the tube will be more round.
72
     *
73
     * @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...
74
     * @param int $segmentsRadial            
75
     * @return void
76
     */
77 1
    public function segmentsRadial(array &$dom_attributes, int $segmentsRadial)
78
    {
79 1
        $dom_attributes['segmentsRadial'] = $segmentsRadial;
80 1
    }
81
82
    /**
83
     * Number of segments along the circumference of the tube face.
84
     * A higher number means the tube will be more round.
85
     *
86
     * @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...
87
     * @param int $segmentsTubular            
88
     * @return void
89
     */
90 1
    public function segmentsTubular(array &$dom_attributes, int $segmentsTubular)
91
    {
92 1
        $dom_attributes['segmentsTubular'] = $segmentsTubular;
93 1
    }
94
95
    /**
96
     * Central angle.
97
     *
98
     * @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...
99
     * @param float|int $radiusTubular            
0 ignored issues
show
Bug introduced by
There is no parameter named $radiusTubular. 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...
100
     * @return void
101
     */
102 1
    public function arc(array &$dom_attributes, float $arc)
103
    {
104 1
        $dom_attributes['arc'] = $arc;
105 1
    }
106
}
107