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

MiscellanousSingleton::setData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
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
}