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

ApplicationStub   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setAttributes() 0 4 1
A instance() 0 4 1
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 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