codemasher 7 years ago
parent
commit
d257a8ea06
3 changed files with 1 additions and 104 deletions
  1. 1 2
      composer.json
  2. 0 77
      src/Traits/QRAuthenticator.php
  3. 0 25
      tests/Traits/QRAuthenticatorTest.php

+ 1 - 2
composer.json

@@ -24,8 +24,7 @@
 		"chillerlan/php-traits": "^2.0"
 		"chillerlan/php-traits": "^2.0"
 	},
 	},
 	"require-dev": {
 	"require-dev": {
-		"phpunit/phpunit": "^7.3",
-		"chillerlan/php-authenticator": "^2.0"
+		"phpunit/phpunit": "^7.3"
 	},
 	},
 	"autoload": {
 	"autoload": {
 		"psr-4": {
 		"psr-4": {

+ 0 - 77
src/Traits/QRAuthenticator.php

@@ -1,77 +0,0 @@
-<?php
-/**
- * Trait QRAuthenticator
- *
- * @filesource   QRAuthenticator.php
- * @created      21.12.2017
- * @package      chillerlan\QRCode\Traits
- * @author       Smiley <smiley@chillerlan.net>
- * @copyright    2017 Smiley
- * @license      MIT
- */
-
-namespace chillerlan\QRCode\Traits;
-
-use chillerlan\Authenticator\Authenticator;
-use chillerlan\QRCode\QRCode;
-
-/**
- * Creates URI QR Codes for use with mmobile authenticators
- */
-trait QRAuthenticator{
-
-	/**
-	 * @var \chillerlan\QRCode\QROptions
-	 */
-	protected $qrOptions;
-
-	/**
-	 * @var string
-	 */
-	protected $authenticatorSecret;
-
-	/**
-	 * @var int
-	 */
-	protected $authenticatorDigits = Authenticator::DEFAULT_DIGITS;
-
-	/**
-	 * @var int
-	 */
-	protected $authenticatorPeriod = Authenticator::DEFAULT_PERIOD;
-
-	/**
-	 * @var string
-	 */
-	protected $authenticatorMode   = Authenticator::DEFAULT_AUTH_MODE;
-
-	/**
-	 * @var string
-	 */
-	protected $authenticatorAlgo   = Authenticator::DEFAULT_HASH_ALGO;
-
-	/**
-	 * @param string $label
-	 * @param string $issuer
-	 *
-	 * @return mixed
-	 */
-	protected function getURIQRCode(string $label, string $issuer) {
-		$uri = $this->getAuthenticator()->setSecret($this->authenticatorSecret)->getUri($label, $issuer);
-
-		return (new QRCode($this->qrOptions))->render($uri);
-	}
-
-	/**
-	 * @return \chillerlan\Authenticator\Authenticator
-	 */
-	protected function getAuthenticator():Authenticator {
-		return (new Authenticator)
-			->setPeriod($this->authenticatorPeriod)
-			->setDigits($this->authenticatorDigits)
-			->setMode($this->authenticatorMode)
-			->setAlgorithm($this->authenticatorAlgo)
-		;
-	}
-
-}

File diff suppressed because it is too large
+ 0 - 25
tests/Traits/QRAuthenticatorTest.php


Some files were not shown because too many files changed in this diff