BaseConfig.php 613 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @link:http://www.gdqijianshi.com/
  4. * @copyright: Copyright (c) 2020 广东七件事集团
  5. * Created by PhpStorm
  6. * Author: zal
  7. * Date: 2020-04-01
  8. * Time: 21:49
  9. */
  10. namespace common\helpers\printer\config;
  11. abstract class BaseConfig
  12. {
  13. public function __construct($config = [])
  14. {
  15. foreach ($config as $name => $value) {
  16. if (property_exists($this, $name)) {
  17. $this->$name = $value;
  18. }
  19. }
  20. }
  21. /**
  22. * @param string $content
  23. * @return array
  24. * @throws \Exception
  25. */
  26. abstract public function print($content);
  27. }