Completed
Push — master ( 02db1d...96e327 )
by Daniel
02:23 queued 15s
created

FilterData::offsetGet()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 6
Ratio 54.55 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 11
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid;
6
7
class FilterData extends \ArrayObject
8
{
9
    public function offsetGet($key)
10
    {
11 View Code Duplication
        if (!isset($this[$key])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
            throw new \InvalidArgumentException(sprintf(
13
                'Unknown key "%s", known keys "%s"',
14
                $key, implode('", "', array_keys((array) $this))
15
            ));
16
        }
17
18
        return parent::offsetGet($key);
19
    }
20
21
    public function __get($key)
22
    {
23
        return  $this[$key];
24
    }
25
}
26