// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\common\library\printer\engine; use cores\traits\ErrorTrait; /** * 小票打印机驱动基类 * Class Basics * @package app\common\library\printer\engine */ abstract class Basics { use ErrorTrait; /** * 打印机配置 * @var array */ protected array $config; /** * 打印联数(次数) * @var int */ protected int $times; /** * 构造函数 * Basics constructor. * @param array $config 打印机配置 * @param int $times 打印联数(次数) */ public function __construct(array $config, int $times) { $this->config = $config; $this->times = $times; } /** * 执行打印请求 * @param string $content * @return bool */ abstract protected function printTicket(string $content): bool; }