Skip to content

Latest commit

History

History
60 lines (41 loc) 路 2.34 KB

CONTRIBUTING.md

File metadata and controls

60 lines (41 loc) 路 2.34 KB

Contributing

馃憤馃帀 First off, thanks for taking the time to contribute! 馃帀馃憤

Submitting a Bug Report

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.

Creating a Pull Request

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]

Running Quality Checks

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.

Code Style

  • 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

Unit Tests

  • Run the unit tests with vendor/bin/phpunit

Integration Tests

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:

  1. Change the working directory to the app folder

In the app folder:

  1. Install the test application dependencies with composer install
  2. Run the integration tests with vendor/bin/phpunit