| Total Complexity | 7 |
| Total Lines | 81 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | trait ArrayDataTrait |
||
| 8 | { |
||
| 9 | use MagicArrayAccessTrait; |
||
| 10 | /** |
||
| 11 | * 表数据 |
||
| 12 | * |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $data = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * 设置值 |
||
| 19 | * |
||
| 20 | * @param string $name |
||
| 21 | * @param mixed $value |
||
| 22 | */ |
||
| 23 | public function __set(string $name, $value) |
||
| 24 | { |
||
| 25 | $this->assertFieldName($name); |
||
| 26 | $this->data[$name] = $value; |
||
| 27 | } |
||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | /** |
||
| 32 | * 获取参数值 |
||
| 33 | * |
||
| 34 | * @param string $name |
||
| 35 | * @return mixed |
||
| 36 | */ |
||
| 37 | public function __get(string $name) |
||
| 38 | { |
||
| 39 | $this->assertFieldName($name); |
||
| 40 | return $this->data[$name] ?? null; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * 判断是否设置 |
||
| 45 | * |
||
| 46 | * @param string $name |
||
| 47 | * @return boolean |
||
| 48 | */ |
||
| 49 | public function __isset(string $name) |
||
| 50 | { |
||
| 51 | $this->assertFieldName($name); |
||
| 52 | return array_key_exists($name, $this->data); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * 取消设置值 |
||
| 57 | * |
||
| 58 | * @param string $name |
||
| 59 | */ |
||
| 60 | public function __unset(string $name) |
||
| 61 | { |
||
| 62 | $this->assertFieldName($name); |
||
| 63 | unset($this->data[$name]); |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * 断言字段 |
||
| 68 | * |
||
| 69 | * @param string $name |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | protected function assertFieldName(string $name) |
||
| 76 | } |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * 检查字段是否存在 |
||
| 81 | * |
||
| 82 | * @param string $name |
||
| 83 | * @return boolean |
||
| 84 | */ |
||
| 85 | public function checkFieldExist(string $name) |
||
| 88 | } |
||
| 89 | } |
||
| 90 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths