| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public static function checkAttribute($model, $attribute, $array) |
||
| 55 | { |
||
| 56 | if (2 >= count($array) && isset($array[0])) { |
||
| 57 | $model->$attribute = $array[0]; |
||
| 58 | static::false($model, $attribute); |
||
| 59 | if (isset($array[1])) { |
||
| 60 | $model->$attribute = $array[1]; |
||
| 61 | } |
||
| 62 | } else { |
||
| 63 | throw new \Exception('数组 0 位元素表示错误的属性值,1 位元素表示正确的属性值'); |
||
| 64 | } |
||
| 67 |