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

Video::reset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
ccs 10
cts 10
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jul 7, 2016 - 5:36:48 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         Video.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 Video extends Entity implements EntityInterface
30
{
31
    /**
32
     * Init <a-video>
33
     *
34
     * The video primitive displays a video on a flat plane as a texture. It is an entity that prescribes the geometry with its geometric primitive set to plane.
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 161 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
35
     *
36
     * @return void
37
     */
38 1
    public function reset()
39
    {
40 1
        parent::reset();
41 1
        $this->component('Material')->shader('flat');
42 1
        $this->color('#FFF');
43 1
        $this->component('Material')->side('double');
44 1
        $this->component('Material')->transparent(true);
45
        
46 1
        $this->component('Geometry')->primitive('plane');
47 1
        $this->height(1.75);
48 1
        $this->width(3);
49 1
    }
50
51
    /**
52
     * geometry.height
53
     *
54
     * @param float $height
55
     * @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...
56
     */
57 1
    public function height(float $height = 1.75): self
58
    {
59 1
        $this->component('Geometry')->height($height);
60 1
        return $this;
61
    }
62
    
63
    /**
64
     * geometry.width
65
     *
66
     * @param float $width
0 ignored issues
show
Documentation introduced by
Should the type for parameter $width not be integer|double?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
67
     * @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...
68
     */
69 1
    public function width(float $width = 3): self
70
    {
71 1
        $this->component('Geometry')->width($width);
72 1
        return $this;
73
    }
74
}