Passed
Push — master ( ab23d3...456c2a )
by Ferry
05:06
created

MiscellanousSingleton   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 3 1
A getData() 0 3 1
A hasData() 0 4 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 8/16/2019
6
 * Time: 12:23 AM
7
 */
8
9
namespace crocodicstudio\crudbooster\helpers;
10
11
12
class MiscellanousSingleton
13
{
14
    private $data;
15
16
    /**
17
     * @return mixed
18
     */
19
    public function getData($key)
20
    {
21
        return @$this->data[$key];
22
    }
23
24
    public function hasData($key) {
25
        $data = $this->data;
26
        if(isset($data[$key])) return true;
27
        else return false;
28
    }
29
30
    public function setData($key, $value): void
31
    {
32
        $this->data[$key] = $value;
33
    }
34
35
36
37
}