You are here

function test3 in Coder 7.2

Same name in this branch
  1. 7.2 coder_sniffer/Test/bad/bad.php \test3()
  2. 7.2 coder_sniffer/Test/good/good.php \test3()
Same name and namespace in other branches
  1. 8.3 tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test3()
  2. 8.3 tests/DrupalPractice/good/good.php \test3()
  3. 8.3 tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test3()
  4. 8.3 tests/Drupal/WhiteSpace/ScopeClosingBraceUnitTest.inc \test3()
  5. 8.3 tests/Drupal/bad/bad.php \test3()
  6. 8.3 tests/DrupalPractice/Objects/drupal8/example.module \test3()
  7. 8.2 coder_sniffer/DrupalPractice/Test/CodeAnalysis/VariableAnalysisUnitTest.inc \test3()
  8. 8.2 coder_sniffer/DrupalPractice/Test/good/good.php \test3()
  9. 8.2 coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc \test3()
  10. 8.2 coder_sniffer/Drupal/Test/bad/bad.php \test3()
  11. 8.2 coder_sniffer/Drupal/Test/good/good.php \test3()
  12. 8.3.x tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test3()
  13. 8.3.x tests/DrupalPractice/good/good.php \test3()
  14. 8.3.x tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test3()
  15. 8.3.x tests/Drupal/WhiteSpace/ScopeClosingBraceUnitTest.inc \test3()
  16. 8.3.x tests/Drupal/bad/bad.php \test3()
  17. 8.3.x tests/DrupalPractice/Objects/drupal8/example.module \test3()

Example of chained method invocations in a function.

File

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

Code

function test3() {

  // Uses the Rules API as example.
  $rule = rule();
  $rule
    ->condition('rules_test_condition_true')
    ->condition('rules_test_condition_true')
    ->condition(rules_or()
    ->condition(rules_condition('rules_test_condition_true')
    ->negate())
    ->condition('rules_test_condition_false')
    ->condition(rules_and()
    ->condition('rules_test_condition_false')
    ->condition('rules_test_condition_true')
    ->negate()));
}