Thank you very much for your interest in this project! There are plenty of ways you can support us. :-)
We like you to read and follow our code of conduct before contributing. Thank you.
The best and (probably) easiest way to help is to use this library in your own projects. It would be very nice to share your thoughts with us. We love to hear from you.
If you have questions how to use it properly read the documentation carefully.
If you find something strange please report it to our issue tracker.
Found a security-related issue?
Of course, there are some features in the pipeline. However, if you have good ideas how to improve this library please let us know! Write a feature request in our issue tracker.
If you like to contribute source code, documentation snippets, self-explaining examples or other useful bits, fork this repository, setup the environment and make a pull request.
git clone https://github.com/i-doit/api-client-php.git
If you have a GitHub account create a fork first and then clone the repository.
After that, setup the environment with Composer:
composer install
Now it is the time to do your stuff. Do not forget to commit your changes. When you are done consider to make a pull requests.
Notice, that any of your contributions merged into this repository will be licensed under the AGPLv3.
Developers must meet these requirements:
- See requirements mentioned in the documentation
- Xdebug, needed for code coverage with phpunit
- Composer
- Git
- One or more working copies of i-doit (otherwise this API client library is senseless)
As an alternative to a local environment you can run everything inside a Docker container. To make it easy there is already a Dockerfile
available in the root directory of this repository. Build the image and run the container:
docker build . -t idoitapi:latest
docker run -it --rm --name idoitapi -v "$PWD":/usr/src idoitapi:latest
This executes composer list
by default. It's possible to run any other command. For example, if you're right at the beginning run composer install
insight the container:
docker run -it --rm --name idoitapi -v "$PWD":/usr/src idoitapi:latest composer install
There is a huge amount of tests located under tests/
. These tests can be executed by PHPUnit. We test both this client library and the i-doit JSON-RPC API as well.
- Copy file
.env.dist
to.env
- Put your configuration settings to
.env
Execute tests for all released features:
composer phpunit
At the end you get the result of a code coverage analysis.
Run these tests in parallel to produce a higher load:
composer parallel
Run all tests in debug mode using Xdebug:
bin/phpunit-dbg
If you configure your system properly, you will be able to set breakpoints in your IDE.
You may add arguments and options, for example:
bin/phpunit-dbg --group unreleased tests/Idoit/APIClient/APITest.php
Some tests are grouped. Include a group by --group
or exclude it by --exclude-group
.
Group name | Description |
---|---|
unreleased |
Unreleased features in the i-doit JSON-RPC API |
open |
Still open issues in the i-doit JSON-RPC API |
issues |
Perform tests for reported issues |
ABC-123 |
Perform tests for reported issue ABC-123 |
…and publish it to packagist.org. You need commit rights for this repository.
- Bump version:
composer config extra.version <VERSION>
- Update composer:
composer update
- Keep
README.md
andCHANGELOG.md
up-to-date - Commit changes:
git commit -a -m "Bump version to $(composer config extra.version)"
- Perform some tests, for example
composer ci
- Run unit tests:
composer phpunit
- Create Git tag:
git tag -s -a -m "Release version $(composer config extra.version)" $(composer config extra.version)
- Push changes:
git push --follow-tags
There is already a webhook enabled to push the code from GitHub to Packagist.
This project comes with some useful composer scripts:
Command | Description |
---|---|
composer ci |
Perform continuous integration tasks |
composer find-forbidden |
Find forbidden words in source code |
composer gitstats |
Create Git statistics |
composer gource |
Visualize Git history |
composer lint |
Perform all lint checks |
composer lint-php |
Check syntax of PHP files |
composer lint-json |
Check syntax of JSON files |
composer lint-xml |
Check syntax of XML files |
composer lint-yaml |
Check syntax of YAML files |
composer outdated-packages |
Report outdated composer packages |
composer phan |
Perform static code analysis with phan |
composer phpcompatibility |
Run PHP compatibility checks |
composer phpcpd |
Detect copy/paste in source code |
composer phpcs |
Detect violations of defined coding standards |
composer phploc |
Print source code statistics |
composer phpmd |
Detect mess in source code |
composer phpmnd |
Detect magic numbers in source code |
composer phpstan |
Analyze source code |
composer phpunit |
Perform unit tests |
composer phpunit-addon |
Perform unit tests for add-on related API requests |
composer phpunit-parallel |
Perform unit tests in parallel |
composer phpunit-unreleased |
Perform unit tests for unreleased features |
composer system-check |
Run some system checks |
For example, execute composer ci
.
If you think this project is useful for your daily work, consider a donation. What about a beer?