Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
/example.php export-ignore
/.github export-ignore
26 changes: 26 additions & 0 deletions .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Autotest
on: [push, pull_request]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
container:
image: php:8.2-cli-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Vendor
run: wget https://getcomposer.org/download/latest-stable/composer.phar && php composer.phar i

- name: Run PHPSTAN
run: php composer.phar phpstan

- name: Run CodeStyle check
run: php composer.phar cs-check

- name: PhpUnit
run: php composer.phar phpunit
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/vendor/
/.idea/
/composer.lock
/example.html
/example.html
/composer.phar
/tests/file.cache
/tests/.phpcs-cache
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.0.0] - 2025-03-26
### Added
- Support PHP 8.2
- Update all libs (endroid/qr-code, psr/cache, christian-riesen/base32, paragonie/random_compat)
- Add psr/simple-cache:^3.0
- Add CodeStyle fixer
- PhpStan level up to 8
- Add fast command with `Makeile`
- Use Docker

## [2.2.0] - 2021-05-24
### Added
- Support for different types of writer for Endroid
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
SHELL = /bin/bash
### https://makefiletutorial.com/

docker := docker run -it --rm -v $(PWD):/app -w /app php:8.2-cli-alpine
composer := $(docker) php composer.phar

bash:
$(docker) bash

composer-download:
test -f composer.phar || wget https://getcomposer.org/download/latest-stable/composer.phar

composer-i:
@make composer-download
$(composer) install --prefer-dist --no-scripts

composer-u:
$(composer) update --prefer-dist --no-scripts $(name)

cs-fix:
$(composer) cs-fix

cs-check:
$(composer) cs-check

phpstan:
$(composer) phpstan

phpunit:
$(composer) phpunit

test:
$(composer) cs-check
$(composer) phpstan
$(composer) phpunit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This gives you a secret. You should:
2. attach the secret to their user account so you can query it

There are 2 ImageGenerator implementations included with this library:
1. EndroidQrImageGenerator which requires you composer require `endroid/qr-code:~2.2|~3` which generates it without any external service dependencies.
1. EndroidQrImageGenerator which requires you composer require `endroid/qr-code:^6.0` which generates it without any external service dependencies.
2. GoogleImageGenerator which uses the Google QR code API to generate the image.

I'd recommend using Endroid as it seems that Google has now [deprecated their QR code API](https://developers.google.com/chart/infographics/docs/qr_codes)
Expand Down
38 changes: 28 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{
"name": "dolondro/google-authenticator",
"name": "dochne/google-authenticator",
"description": "Code to authenticate against the Google Authenticator app",
"license": "MIT",
"version": "3.0.0",
"authors": [
{
"name": "Doug Nelson",
"email": "dougnelson@silktide.com"
},
{
"name": "Xakki",
"email": "git@xakki.ru"
}
],
"require": {
"php": ">=5.4",
"christian-riesen/base32": "^1.2",
"psr/cache": "^1.0",
"paragonie/random_compat": "^2.0|~9.99"
"php": ">=8.2",
"christian-riesen/base32": "^1.6",
"psr/cache": "^3.0",
"psr/simple-cache": "^3.0",
"paragonie/random_compat": "^9.99"
},
"require-dev": {
"phpunit/phpunit": "~6",
"endroid/qr-code": "~2.2|~3",
"cache/filesystem-adapter": "^1.0",
"phpstan/phpstan": "^0.11.3",
"cache/array-adapter": "^1.0"
"phpunit/phpunit": "^11",
"endroid/qr-code": "^6.0",
"phpstan/phpstan": "^2.1",
"symfony/cache": "^7.2",
"squizlabs/php_codesniffer": "*",
"opsway/psr12-strict-coding-standard": "*"
},
"suggests": {
"endroid/qr-code": "Allows use of EndroidQrImageGenerator to generate the QR code images"
Expand All @@ -33,5 +40,16 @@
"psr-4": {
"Dolondro\\GoogleAuthenticator\\Tests\\": "tests"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"phpstan": "XDEBUG_MODE=off vendor/bin/phpstan analyse",
"cs-check": "XDEBUG_MODE=off vendor/bin/phpcs",
"cs-fix": "XDEBUG_MODE=off vendor/bin/phpcbf",
"phpunit": "XDEBUG_MODE=off vendor/bin/phpunit -c phpunit.xml --no-coverage"
}
}
Loading