GetSetUnset   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 17 3
1
<?php
2
/**
3
 * @author     Chris Hilsdon <[email protected]>
4
 * @package    ComodoDecodeCSR
5
 * @copyright  2016 Xigen
6
 * @license    GNU General Public License v3
7
 * @link       https://github.com/XigenChris/ComodoDecodeCSR
8
 */
9
10
namespace Xigen\Traits;
11
12
trait GetSetUnset
13
{
14
    public function __call($method, $args)
15
    {
16
        $data = false;
17
        switch (substr($method, 0, 3)) {
18
            case 'get':
19
                $get = substr($method, 3);
20
                $data = $this->$get;
21
                break;
22
            case 'set':
23
                $set = substr($method, 3);
24
                $data = $args[0];
25
                $this->$set = $data;
26
                break;
27
        }
28
29
        return $data;
30
    }
31
}
32