Completed
Branch 2.0 (f08412)
by Zhengchao
01:19
created

ApplicationStub::setAttributes()   A

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
/*
4
 * This file is part of questocat/laravel-referral package.
5
 *
6
 * (c) questocat <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Tests\Stubs;
13
14
use ArrayAccess;
15
16
class ApplicationStub implements ArrayAccess
17
{
18
    protected $attributes = [];
19
20
    public function setAttributes($attributes)
21
    {
22
        $this->attributes = $attributes;
23
    }
24
25
    public function instance($key, $instance)
26
    {
27
        $this->attributes[$key] = $instance;
28
    }
29
30
    public function offsetExists($offset)
31
    {
32
        return isset($this->attributes[$offset]);
33
    }
34
35
    public function offsetGet($key)
36
    {
37
        return $this->attributes[$key];
38
    }
39
40
    public function offsetSet($key, $value)
41
    {
42
        $this->attributes[$key] = $value;
43
    }
44
45
    public function offsetUnset($key)
46
    {
47
        unset($this->attributes[$key]);
48
    }
49
}
50