Completed
Pull Request — master (#63)
by Marko
03:19
created

Box::segmentsWidth()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 21, 2016 - 11:58:54 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         Box.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\Extras\Primitives;
25
26
use \AframeVR\Core\Entity;
27
use \AframeVR\Interfaces\EntityInterface;
28
29
class Box extends Entity implements EntityInterface
30
{
31
32
    /**
33
     * Init <a-box>
34
     *
35
     * The box primitive, formerly called <a-cube>, creates shapes such as boxes, cubes, or walls. It is an entity that
36
     * prescribes the geometry with its geometric primitive set to box.
37
     *
38
     * @return void
39
     */
40 5
    public function reset()
41
    {
42 5
        parent::reset();
43 5
        $this->component('Geometry')->primitive('box');
44 5
        $this->depth(1);
45 5
        $this->height(1);
46 5
        $this->width(1);
47 5
    }
48
49
    /**
50
     * geometry.depth
51
     *
52
     * @param float $depth            
53
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
54
     */
55 5
    public function depth(float $depth): self
56
    {
57 5
        $this->component('Geometry')->depth($depth);
58 5
        return $this;
59
    }
60
61
    /**
62
     * geometry.height
63
     *
64
     * @param float $height            
65
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
66
     */
67 5
    public function height(float $height): self
68
    {
69 5
        $this->component('Geometry')->height($height);
70 5
        return $this;
71
    }
72
73
    /**
74
     * geometry.width
75
     *
76
     * @param float $height            
0 ignored issues
show
Bug introduced by
There is no parameter named $height. 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...
77
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
78
     */
79 5
    public function width(float $width): self
80
    {
81 5
        $this->component('Geometry')->width($width);
82 5
        return $this;
83
    }
84
85
    /**
86
     * Optional: geometry.segmentsHeight
87
     *
88
     * @param int $height            
89
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
90
     */
91
    public function segmentsHeight(int $height): self
92
    {
93
        $this->component('Geometry')->segmentsHeight($height);
94
        return $this;
95
    }
96
97
    /**
98
     * Optional: geometry.segmentsWidth
99
     *
100
     * @param int $width            
101
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
102
     */
103
    public function segmentsWidth(int $width): self
104
    {
105
        $this->component('Geometry')->segmentsWidth($width);
106
        return $this;
107
    }
108
109
    /**
110
     * Optional: geometry.segmentsDepth
111
     *
112
     * @param int $depth            
113
     * @return self
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
114
     */
115
    public function segmentsDepth(int $depth): self
116
    {
117
        $this->component('Geometry')->segmentsDepth($depth);
118
        return $this;
119
    }
120
}
121