Skip to content

Latest commit

 

History

History
48 lines (40 loc) · 1.13 KB

CONTRIBUTING.md

File metadata and controls

48 lines (40 loc) · 1.13 KB

Contribution Guidelines

We follow PSR-2 Coding Style. Be sure to configure EditorConfig to ensure you have proper indentation settings.

  • Include namespace on the same line as opening <?php.
  • Method names must be camelCase, but helper functions should be snake_case.
  • Use array literals, e.g. [], rather than old array() syntax.

Code Sample

<?php namespace Vendor\Package;

use FooInterface;
use BarClass as Bar;
use OtherVendor\OtherPackage\BazClass;

class Foo extends Bar implements FooInterface
{
    /**
     * Sample function.
     *
     * @param String a - A parameter.
     * @param String b - Another parameter.
     * @return void
     */
    public function sampleFunction($a, $b = null)
    {
        if ($a === $b) {
            bar();
        } elseif ($a > $b) {
            $foo->bar($arg1);
        } else {
            BazClass::bar($arg2, $arg3);
        }
    }

    /**
     * Another sample function.
     */
    final public static function bar()
    {
        // method body
    }
}