You are here

class Bar in Coder 8.2

Same name in this branch
  1. 8.2 coder_sniffer/Drupal/Test/bad/bad.php \Bar
  2. 8.2 coder_sniffer/Drupal/Test/good/good.php \Bar
Same name and namespace in other branches
  1. 7.2 coder_sniffer/Test/bad/bad.php \Bar
  2. 7.2 coder_sniffer/Test/good/good.php \Bar

Class declaration.

Classes can have a multiline comment.

Hierarchy

Expanded class hierarchy of Bar

1 string reference to 'Bar'
good.php in coder_sniffer/Drupal/Test/good/good.php
This file contains all the valid notations for the drupal coding standard.

File

coder_sniffer/Drupal/Test/good/good.php, line 581
This file contains all the valid notations for the drupal coding standard.

View source
class Bar {

  /**
   * Private properties have no prefix.
   *
   * @var int
   */
  private $secret = 1;

  /**
   * Protected properties also don't have a prefix.
   *
   * @var int
   */
  protected $foo = 1;

  /**
   * Longer properties use camelCase naming.
   *
   * @var int
   */
  public $barProperty = 1;

  /**
   * Public static variables use camelCase, too.
   *
   * @var string
   */
  public static $basePath = NULL;

  /**
   * {@inheritdoc}
   */
  protected $modules = [
    'node',
    'user',
  ];

  /**
   * Enter description here ...
   */
  public function foo() {
  }

  /**
   * Enter description here ...
   */
  protected function barMethod() {
  }

  /**
   * Test the ++ and -- operator.
   */
  public function incDecTest() {
    $this->foo++;
    $this->foo--;
    --$this->foo;
    ++$this->foo;
  }

  /**
   * It is allowed to leave out param docs on methods.
   */
  public function noParamDocs($a, $b) {
  }

  /**
   * Param comments with references are found correctly.
   *
   * @param string $a
   *   Parameter one.
   * @param array $b
   *   Parameter two.
   */
  public function test($a, array &$b) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Bar::$barProperty public property Longer properties use camelCase naming.
Bar::$basePath public static property Public static variables use camelCase, too.
Bar::$foo protected property Protected properties also don't have a prefix.
Bar::$modules protected property
Bar::$secret private property Private properties have no prefix.
Bar::barMethod protected function Enter description here ...
Bar::foo public function Enter description here ...
Bar::incDecTest public function Test the ++ and -- operator.
Bar::noParamDocs public function It is allowed to leave out param docs on methods.
Bar::test public function Param comments with references are found correctly.