Welcome! If you'd like to work on php-opencloud, we appreciate your efforts. Here are a few general guidelines to follow:
-
Use the
working
branch for your pull requests. Except in the case of an emergency hotfix, we will only updatemaster
with official releases. -
All code needs to come with unit tests. If you're introducing new code, you will need to write new test cases; if you're updating existing code, you will need to make sure the methods you're updating are still completely covered.
-
Please abide by PSR-2 code styling.
-
Explaining your pull requests is appreciated. Unless you're fixing a minor typographical error, create a description which explains your changes and, where relevant, references the existing issue you're hoping to fix.
-
If your pull request introduces a large change or addition, please consider creating a work-in-progress (WIP) pull request. This lets us review your changes and provide feedback early and often rather than all at once when the entire pull request is ready. To denote a pull request as WIP, simply add the "PR: Work In Progress" label to it. When you are finished with your work in the pull request and are ready for a final review and merge, please remove the "PR: Work In Progress" label.
-
Document your code!
If you submit code, please add your name and email address to the CONTRIBUTORS file.
vendor/bin/phpunit
- Make sure your variables-order is set to "EGCRS"
- Set your PHP_OpenCloud_USERNAME and PHP_OpenCloud_API_KEY variables
- Run:
php tests/OpenCloud/Smoke/Runner.php
-
When working on a
Service
class (e.g.OpenCloud\Image\Service
, name methods like so:- Methods that return a single resource, say
Foo
, should be namedgetFoo
. For example,getImage
. - Methods that return a collection of resources, say
Foo
, should be namedlistFoos
. For example,listImages
. - Methods that create a new resource, say
Foo
, should be namedcreateFoo
. For example,createEntity
.
- Methods that return a single resource, say
-
When validating arguments to a method, please throw
\InvalidArgumentException
when an invalid argument is found. For example, see here.
The code in this library is compliant with the PSR-2 Coding Style Guide. To ensure that any code you contribute is also PSR-2 compliant, please run the following command from the base directory of this project before submitting your contribution:
$ vendor/bin/php-cs-fixer fix --level psr2 .
Running this command will change your code to become PSR-2 compliant. You will need to commit these changes and make them part of your pull request.
If you are a core contributor to php-opencloud, you have the power to release new versions of it. Here are the steps to follow to ensure a proper release:
- Update the value of the the
VERSION
constant. - Merge the
working
branch into themaster
branch. - Run the smoke tests. If they fail, make necessary changes and go to step 2.
- Create new release notes.
- Publish release notes.
- Announce release via appropriate channels.
- Party 🎉 🎈