Driver.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\common\library\express\provider;
  13. use cores\traits\ErrorTrait;
  14. use cores\exception\BaseException;
  15. /**
  16. * 物流查询驱动基类
  17. * Class Driver
  18. * @package app\common\library\express\provider\driver
  19. */
  20. abstract class Driver
  21. {
  22. use ErrorTrait;
  23. /**
  24. * 驱动句柄
  25. * @var Driver
  26. */
  27. protected $handler = null;
  28. /**
  29. * api配置参数
  30. * @var array
  31. */
  32. protected $options = [];
  33. /**
  34. * 查询物流轨迹
  35. * @param string $code
  36. * @param string $expressNo
  37. * @return array
  38. */
  39. abstract function query(string $code, string $expressNo): array;
  40. /**
  41. * 设置api配置参数
  42. * @param array $options 配置信息
  43. * @return static|null
  44. */
  45. public function setOptions(array $options): ?Driver
  46. {
  47. $this->options = $options;
  48. return $this;
  49. }
  50. }