Passed
Push — sudav3 ( ac6dc6...d2f44f )
by 世昌
02:12
created

PropertyDataTrait::offsetSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace suda\orm\struct;
3
4
use suda\orm\struct\MagicArrayAccessTrait;
0 ignored issues
show
Bug introduced by
The type suda\orm\struct\MagicArrayAccessTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
6
trait PropertyDataTrait
7
{
8
    use MagicArrayAccessTrait;
9
    /**
10
     * 设置值
11
     *
12
     * @param string $name
13
     * @param mixed $value
14
     */
15
    public function __set(string $name, $value)
16
    {
17
        $this->$name = $value;
18
    }
19
    
20
    /**
21
     * 获取参数值
22
     *
23
     * @param string $name
24
     * @return mixed
25
     */
26
    public function __get(string $name)
27
    {
28
        return $this->$name;
29
    }
30
31
    /**
32
     * 判断是否设置
33
     *
34
     * @param string $name
35
     * @return boolean
36
     */
37
    public function __isset(string $name)
38
    {
39
        return isset($this->$name);
40
    }
41
42
    /**
43
     * 取消设置值
44
     *
45
     * @param string $name
46
     */
47
    public function __unset(string $name)
48
    {
49
        unset($this->$name);
50
    }
51
}
52