no); } /** * 判断读卡器类型是否匹配 */ public function isType(string $type): bool { return $this->type === $type; } /** * 判断读卡器类型是否在给定列表中 */ public function isTypeIn(array $types): bool { return in_array($this->type, $types, true); } /** * 转换为数组 */ public function toArray(): array { return [ 'no' => $this->no, 'type' => $this->type, 'id' => $this->id, ]; } }