| Total Complexity | 9 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | trait At |
||
| 6 | { |
||
| 7 | protected $mobiles = []; |
||
| 8 | protected $all = false; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * at 某人 |
||
| 12 | * at someone |
||
| 13 | * |
||
| 14 | * @param string|array $someone |
||
| 15 | * |
||
| 16 | * @return $this |
||
| 17 | */ |
||
| 18 | 6 | public function at($someone = null) |
|
| 19 | { |
||
| 20 | 6 | if (is_string($someone) || is_numeric($someone)) { |
|
| 21 | 6 | $this->mobiles[] = (string)$someone; |
|
| 22 | 6 | } elseif (is_array($someone)) { |
|
| 23 | 6 | $this->mobiles = array_merge($this->mobiles, $someone); |
|
| 24 | } |
||
| 25 | 6 | return $this; |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * set at all active |
||
| 30 | * at 全部人 |
||
| 31 | * |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | 6 | public function atAll() |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * cancel at all |
||
| 42 | * 取消 at 全部人 |
||
| 43 | * |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | 6 | public function notAtAll() |
|
| 50 | } |
||
| 51 | |||
| 52 | |||
| 53 | 8 | protected function getAt() |
|
| 66 | } |