ParameterCollection::offsetGet()   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
 * ParameterCollection.
15
 *
16
 * @author Timo Michna <timomichna/yahoo.de>
17
 * @extends \PEIP\Data\ParameterHolder
18
 * @implements \PEIP\INF\Data\ParameterHolder, ArrayAccess
19
 */
20
class ParameterCollection extends \PEIP\Data\ParameterHolder implements \ArrayAccess
21
{
22
    /**
23
     * @param $offset
24
     *
25
     * @return
26
     */
27
    public function offsetExists($offset)
28
    {
29
        return $this->hasParameter($offset);
30
    }
31
32
    /**
33
     * @param $offset
34
     *
35
     * @return
36
     */
37
    public function offsetGet($offset)
38
    {
39
        return $this->getParameter($offset);
40
    }
41
42
    /**
43
     * @param $name
44
     *
45
     * @return
46
     */
47
    public function offsetUnset($name)
48
    {
49
        $this->deleteParameter($name);
50
    }
51
52
    /**
53
     * @param $offset
54
     * @param $name
55
     *
56
     * @return
57
     */
58
    public function offsetSet($offset, $name)
59
    {
60
        $this->setParameter($offeset, $name);
0 ignored issues
show
Bug introduced by
The variable $offeset does not exist. Did you mean $offset?

This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.

The variable may have been renamed without also renaming all references.

Loading history...
61
    }
62
}
63