-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from abmmhasan/feature/enhancement
Feature/enhancement
- Loading branch information
Showing
6 changed files
with
132 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
name: PHP Composer | ||
name: "Stability Test" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ main ] | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Check PHP Version | ||
run: php -v | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
- name: Validate Composer | ||
run: composer validate --strict | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
- name: Install dependencies | ||
run: composer install --no-interaction --prefer-dist --optimize-autoloader | ||
|
||
# - name: Run test suite | ||
# run: composer run-script test | ||
- name: Package Audit | ||
run: composer audit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,10 @@ $secret = \AbmmHasan\OTP\HOTP::generateSecret(); | |
/** | ||
* Get QR Code Image for secret $secret | ||
*/ | ||
(new \AbmmHasan\OTP\HOTP($secret))->getQRImage('TestName', 'TestTitle'); | ||
(new \AbmmHasan\OTP\HOTP($secret))// supports digit count in 2nd parameter, recommended to be either 6 or 8 (default 6) | ||
->setCounter(3) // only required if the counter is being imported from another system or if it is old, & for QR only | ||
->setAlgorithm('sha256') // default is sha1; Caution: many app (in fact, most of them) have algorithm limitation | ||
->getProvisioningUriQR('TestName', '[email protected]'); // or `getProvisioningUri` just to get the URI | ||
|
||
/** | ||
* Get current OTP for a given counter | ||
|
@@ -72,7 +75,9 @@ $secret = \AbmmHasan\OTP\TOTP::generateSecret(); | |
/** | ||
* Get QR Code Image for secret $secret | ||
*/ | ||
(new \AbmmHasan\OTP\TOTP($secret))->getQRImage('TestName', 'TestTitle'); | ||
(new \AbmmHasan\OTP\TOTP($secret)) // supports digit count in 2nd parameter, recommended to be either 6 or 8 (default 6) | ||
->setAlgorithm('sha256') // default is sha1; Caution: many app (in fact, most of them) have algorithm limitation | ||
->getProvisioningUriQR('TestName', '[email protected]'); // or `getProvisioningUri` just to get the URI | ||
|
||
/** | ||
* Get current OTP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters