MyCustomOutput.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Class MyCustomOutput
  4. *
  5. * @created 24.12.2017
  6. * @author Smiley <smiley@chillerlan.net>
  7. * @copyright 2017 Smiley
  8. * @license MIT
  9. */
  10. namespace chillerlan\QRCodeExamples;
  11. use chillerlan\QRCode\Output\QROutputAbstract;
  12. class MyCustomOutput extends QROutputAbstract{
  13. /**
  14. * @inheritDoc
  15. */
  16. protected function moduleValueIsValid($value):bool{
  17. // TODO: Implement moduleValueIsValid() method. (abstract)
  18. return false;
  19. }
  20. /**
  21. * @inheritDoc
  22. */
  23. protected function getModuleValue($value){
  24. // TODO: Implement getModuleValue() method. (abstract)
  25. return null;
  26. }
  27. /**
  28. * @inheritDoc
  29. */
  30. protected function getDefaultModuleValue(bool $isDark){
  31. // TODO: Implement getDefaultModuleValue() method. (abstract)
  32. return null;
  33. }
  34. /**
  35. * @inheritDoc
  36. */
  37. public function dump(string $file = null):string{
  38. $output = '';
  39. for($y = 0; $y < $this->moduleCount; $y++){
  40. for($x = 0; $x < $this->moduleCount; $x++){
  41. $output .= (int)$this->matrix->check($x, $y);
  42. }
  43. $output .= $this->options->eol;
  44. }
  45. return $output;
  46. }
  47. }