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

CircleMethods   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 70
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A radius() 0 4 1
A segments() 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:24:06 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         CircleMethods.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 CircleMethods
27
{
28
29
    /**
30
     * The circle primitive defines two-dimensional circles, which can be complete circles or partial circles (like Pac-Man).
31
     * Note that because it is flat, only a single side of the circle will be rendered if “side: double” is not specified on the material component.
32
     */
33
    const DEFAULTS = array(
34
        /* Radius (in meters) of the circle. */
35
        'radius' => 1,
36
        /* Number of triangles to construct the circle, like pizza slices. A higher number of segments means the circle will be more round. */
37
        'segments' => 32,
38
        /* Start angle for first segment. Can be used to define a partial circle. */
39
        'thetaStart' => 0,
40
        /* The central angle (in degrees). Defaults to 360, which makes for a complete circle. */
41
        'thetaLength' => 360
42
    );
43
44
    /**
45
     * Radius (in meters) of the circle.
46
     *
47
     * @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...
48
     * @param float|int $radius            
1 ignored issue
show
Documentation introduced by
Consider making the type for parameter $radius a bit more specific; maybe use double.
Loading history...
49
     * @return void
50
     */
51 1
    public function radius(array &$dom_attributes, float $radius)
52
    {
53 1
        $dom_attributes['radius'] = $radius;
54 1
    }
55
56
    /**
57
     * Segments
58
     *
59
     * CIRCLE: Number of triangles to construct the circle, like pizza slices.
60
     * A higher number of segments means the circle will be more round.
61
     *
62
     * @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...
63
     * @param int $segments            
64
     * @return void
65
     */
66 1
    public function segments(array &$dom_attributes, int $segments)
67
    {
68 1
        $dom_attributes['segments'] = $segments;
69 1
    }
70
71
    /**
72
     * Start angle for first segment.
73
     * Can be used to define a partial circle.
74
     *
75
     * @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...
76
     * @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...
77
     * @return void
78
     */
79 1
    public function thetaStart(array &$dom_attributes, float $thetaStart)
80
    {
81 1
        $dom_attributes['thetaStart'] = $thetaStart;
82 1
    }
83
84
    /**
85
     * Defaults to 360, which makes for a complete circle.
86
     *
87
     * @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...
88
     * @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...
89
     * @return void
90
     */
91 1
    public function thetaLength(array &$dom_attributes, float $thetaLength)
92
    {
93 1
        $dom_attributes['thetaLength'] = $thetaLength;
94 1
    }
95
}
96