Completed
Push — master ( e8b22d...bec3f6 )
by Marko
11s
created

Plane::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 21, 2016 - 12:30:42 PM
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         Plane.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 Plane extends Entity implements EntityInterface
30
{
31
    /**
32
     * Init <a-plane>
33
     *
34
     * The plane primitive creates flat surfaces.
35
     * It is an entity that prescribes the geometry
36
     * with its geometric primitive set to plane.
37
     *
38
     * @return void
39
     */
40 2
    public function reset()
41
    {
42 2
        parent::reset();
43 2
        $this->component('Material');
44 2
        $this->component('Geometry')->primitive('plane');
45 2
    }
46
47
    /**
48
     * geometry.height
49
     *
50
     * @param float $height            
51
     * @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...
52
     */
53 2
    public function height(float $height): self
54
    {
55 2
        $this->component('Geometry')->height($height);
56 2
        return $this;
57
    }
58
59
    /**
60
     * geometry.width
61
     *
62
     * @param float $width            
63
     * @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...
64
     */
65 2
    public function width(float $width): self
66
    {
67 2
        $this->component('Geometry')->width($width);
68 2
        return $this;
69
    }
70
}
71