SimpleObject::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SubjectivePHPTest\Spl\Traits;
4
5
use SubjectivePHP\Spl\Traits\ArrayAccessTrait;
6
use SubjectivePHP\Spl\Traits\IteratorTrait;
7
use SubjectivePHP\Spl\Traits\MagicAccessorTrait;
8
9
/**
10
 * Basic object to use in tests.
11
 *
12
 * @property mixed $foo
13
 */
14
class SimpleObject implements \ArrayAccess, \Iterator
15
{
16
    /**
17
     * Array container.
18
     *
19
     * @var array
20
     */
21
    private $container;
22
23
    use ArrayAccessTrait;
24
    use IteratorTrait;
25
    use MagicAccessorTrait;
26
27
    /**
28
     * Construct a new instance.
29
     *
30
     * @param array $data The data to use in the object.
31
     */
32
    public function __construct(array $data = [])
33
    {
34
        $this->container = $data;
35
    }
36
37
    /**
38
     * Get the container.
39
     *
40
     * @return array
41
     */
42
    public function getContainer()
43
    {
44
        return $this->container;
45
    }
46
}
47