InternalStoreAbstract::hasInternalValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 3 Features 0
Metric Value
c 4
b 3
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace PEIP\Data;
4
5
/*
6
 * This file is part of the PEIP package.
7
 * (c) 2009-2016 Timo Michna <timomichna/yahoo.de>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
/**
14
 * InternalStoreAbstract.
15
 *
16
 * @author Timo Michna <timomichna/yahoo.de>
17
 */
18
19
abstract class InternalStoreAbstract
20
{
21
    private $internalValues = [];
22
23
    /**
24
     * @param $key
25
     *
26
     * @return
27
     */
28
    protected function hasInternalValue($key)
29
    {
30
        return array_key_exists($key, $this->internalValues);
31
    }
32
33
    /**
34
     * @param $key
35
     *
36
     * @return
37
     */
38
    protected function getInternalValue($key)
39
    {
40
        return array_key_exists($key, $this->internalValues) ? $this->internalValues[$key] : null;
41
    }
42
43
    /**
44
     * @param $key
45
     *
46
     * @return
47
     */
48
    protected function deleteInternalValue($key)
49
    {
50
        unset($this->internalValues[$key]);
51
    }
52
53
    /**
54
     * @param $key
55
     * @param $value
56
     *
57
     * @return
58
     */
59
    protected function setInternalValue($key, $value)
60
    {
61
        $this->internalValues[$key] = $value;
62
    }
63
64
    /**
65
     * @param $key
66
     * @param $value
67
     *
68
     * @return
69
     */
70
71
    /**
72
     * @param $internalValues
73
     *
74
     * @return
75
     */
76
    protected function setInternalValues(array $internalValues)
77
    {
78
        $this->internalValues = $internalValues;
79
    }
80
81
    /**
82
     * @param $key
83
     *
84
     * @return
85
     */
86
87
    /**
88
     * @return
89
     */
90
    protected function getInternalValues()
91
    {
92
        return $this->internalValues;
93
    }
94
95
    /**
96
     * @return
97
     */
98
    protected function addInternalValues()
99
    {
100
        array_merge($this->internalValues, $internalValues);
0 ignored issues
show
Bug introduced by
The variable $internalValues does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
101
    }
102
}
103