Completed
Push — 0.3.x ( e34ee3...2bab49 )
by Marko
02:33
created

VRmodeUIComponent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 45
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A initializeComponent() 0 6 1
A enabled() 0 5 2
A hasDOMAttributes() 0 4 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jul 7, 2016 - 1:48:03 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         VRmodeUIComponent.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\VRmodeUI;
25
26
use \AframeVR\Interfaces\Core\Components\VRmodeUICMPTIF;
27
use \AframeVR\Core\Helpers\ComponentAbstract;
28
29
class VRmodeUIComponent extends ComponentAbstract implements VRmodeUICMPTIF
30
{
31
32
    /**
33
     * Initialize Component
34
     *
35
     * {@inheritdoc}
36
     *
37
     * @return bool
38
     */
39 2
    public function initializeComponent(): bool
40
    {
41 2
        $this->setDomAttribute('vr-mode-ui');
42 2
        $this->enabled();
43 2
        return true;
44
    }
45
46
    /**
47
     * look-controls enabled
48
     *
49
     * {@inheritdoc}
50
     *
51
     * @param bool $enabled            
52
     * @return LookControlsCMPTIF
0 ignored issues
show
Documentation introduced by
Should the return type not be VRmodeUICMPTIF?

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...
53
     */
54 2
    public function enabled(bool $enabled = true): VRmodeUICMPTIF
55
    {
56 2
        $this->dom_attributes['enabled'] = $enabled ? 'true' : 'false';
57 2
        return $this;
58
    }
59
    
60
    /**
61
     * Does component have DOM Atributes
62
     *
63
     * If compnent is called then we return true
64
     *
65
     * {@inheritdoc}
66
     *
67
     * @return bool
68
     */
69 1
    public function hasDOMAttributes(): bool
70
    {
71 1
        return true;
72
    }
73
}
74