| Total Complexity | 8 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | trait PropertyDataTrait |
||
| 5 | { |
||
| 6 | |||
| 7 | public function offsetSet($offset, $value) |
||
| 8 | { |
||
| 9 | $this->__set($offset, $value); |
||
| 10 | } |
||
| 11 | |||
| 12 | public function offsetExists($offset) |
||
| 13 | { |
||
| 14 | return $this->__isset($offset); |
||
| 15 | } |
||
| 16 | |||
| 17 | public function offsetUnset($offset) |
||
| 18 | { |
||
| 19 | $this->__unset($offset); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function offsetGet($offset) |
||
| 23 | { |
||
| 24 | return $this->__get($offset); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * 设置值 |
||
| 29 | * |
||
| 30 | * @param string $name |
||
| 31 | * @param mixed $value |
||
| 32 | */ |
||
| 33 | public function __set(string $name, $value) |
||
| 34 | { |
||
| 35 | $this->$name = $value; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * 获取参数值 |
||
| 40 | * |
||
| 41 | * @param string $name |
||
| 42 | * @return mixed |
||
| 43 | */ |
||
| 44 | public function __get(string $name) |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * 判断是否设置 |
||
| 51 | * |
||
| 52 | * @param string $name |
||
| 53 | * @return boolean |
||
| 54 | */ |
||
| 55 | public function __isset(string $name) |
||
| 56 | { |
||
| 57 | return isset($this->$name); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * 取消设置值 |
||
| 62 | * |
||
| 63 | * @param string $name |
||
| 64 | */ |
||
| 65 | public function __unset(string $name) |
||
| 68 | } |
||
| 69 | } |
||
| 70 |