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

MiscellanousSingleton::hasData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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