👍🎉 First off, thanks for taking the time to contribute! 🎉👍
Before you report a bug, please check the troubleshooting guide first.
When creating the bug report, please follow the bug template and provide the details requested.
You're welcome to contribute new features by creating a pull requests or feature request in the issues section. Besides new features, translations are highly welcome.
For pull requests, please follow these guidelines:
- Do not use any PHP language features above the minimum supported version (see
composer.json
) - Use the configured code style (
phpcs.xml.dist
to configure PHP Code Sniffer checks in your IDE) - PHP 8.0 level type hints for everything (parameter types, return types, nullable types, union types,
void
), including test cases declare(strict_types=1)
must be used- Methods/properties/constants must declare visibility
- Please add/update test cases
- Test methods should be named
[method]_[scenario]_[expectedResult]
Before you create a pull request, please make sure your changes fulfill the quality criteria. CI is also checking these, but running them locally gives you the chance to catch any errors before you push changes.
First, install the dependencies by running composer install
in the project root.
- Run PHP-CS-Fixer v3 (not provided with the library, has to be
installed locally):
php-cs-fixer fix
- Run PHP CodeSniffer with
vendor/bin/phpcs
- Run Psalm with
vendor/bin/psalm
and address any error-level issues
- Run the unit tests with
vendor/bin/phpunit
The library comes with its own little test application to play around with 2fa and to run integration tests. For more
information, have a look at the Readme file in the app
folder. In short, to run the integration
tests:
- Change the working directory to the
app
folder
In the app
folder:
- Install the test application dependencies with
composer install
- Run the integration tests with
vendor/bin/phpunit