Fetching contributors…
Cannot retrieve contributors at this time
73 lines (52 sloc) 3.86 KB

Contributing to php-opencloud

Welcome! If you'd like to work on php-opencloud, we appreciate your efforts. Here are a few general guidelines to follow:

  1. Use the working branch for your pull requests. Except in the case of an emergency hotfix, we will only update master with official releases.

  2. 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.

  3. Please abide by PSR-2 code styling.

  4. 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.

  5. 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.

  6. Document your code!

If you submit code, please add your name and email address to the CONTRIBUTORS file.

Test Instructions

To run unit tests:


To run the full suite of acceptance tests:

  1. Make sure your variables-order is set to "EGCRS"
  2. Set your PHP_OpenCloud_USERNAME and PHP_OpenCloud_API_KEY variables
  3. 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 named getFoo. For example, getImage.
    • Methods that return a collection of resources, say Foo, should be named listFoos. For example, listImages.
    • Methods that create a new resource, say Foo, should be named createFoo. For example, createEntity.
  • When validating arguments to a method, please throw \InvalidArgumentException when an invalid argument is found. For example, see here.

Ensuring PSR-2 coding style compliance

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.

Releasing a new version of php-opencloud

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:

  1. Update the value of the the VERSION constant.
  2. Merge the working branch into the master branch.
  3. Run the smoke tests. If they fail, make necessary changes and go to step 2.
  4. Create new release notes.
  5. Publish release notes.
  6. Announce release via appropriate channels.
  7. Party 🎉 🎈