Completed
Push — master ( 8ee140...270ac9 )
by Marko
02:12
created

ShaderAbstract   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B removeDefaultDOMAttributes() 0 8 5
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 25, 2016 - 8:48:28 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         ShaderAbstract.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
25
namespace AframeVR\Core\Helpers;
26
27
abstract class ShaderAbstract
28
{
29
30
    /**
31
     * removeDefaultDOMAttributes
32
     *
33
     * @return void
34
     */
35 3
    public function removeDefaultDOMAttributes()
36
    {
37 3
        $defaults = get_class_vars(__CLASS__);
38 3
        foreach (get_object_vars($this) as $name => $value) {
39 3
            if (empty($value) || (array_key_exists($name, $defaults) && $value === $defaults[$name]))
40 3
                unset($this->$name);
41
        }
42
    }
43
}