MyAuthenticatorClass.php 782 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Class MyAuthenticatorClass
  4. *
  5. * @filesource MyAuthenticatorClass.php
  6. * @created 24.12.2017
  7. * @package chillerlan\QRCodeExamples
  8. * @author Smiley <smiley@chillerlan.net>
  9. * @copyright 2017 Smiley
  10. * @license MIT
  11. */
  12. namespace chillerlan\QRCodeExamples;
  13. use chillerlan\QRCode\{QRCode, QROptions, Traits\QRAuthenticator};
  14. /**
  15. * using the QRAuthenticator trait
  16. */
  17. class MyAuthenticatorClass{
  18. use QRAuthenticator;
  19. public function getQRCode(){
  20. // data fetched from wherever
  21. $this->authenticatorSecret = 'SECRETTEST234567';
  22. $this->qrOptions = new QROptions(['outputType' => QRCode::OUTPUT_MARKUP_SVG]); // set options if needed
  23. $label = 'my label';
  24. $issuer = 'example.com';
  25. return $this->getURIQRCode($label, $issuer);
  26. }
  27. }