You are here

function chained_method_calls in Coder 8.2

Same name and namespace in other branches
  1. 8.3 tests/Drupal/WhiteSpace/ObjectOperatorIndentUnitTest.inc \chained_method_calls()
  2. 8.3.x tests/Drupal/WhiteSpace/ObjectOperatorIndentUnitTest.inc \chained_method_calls()

Function containing test code for chained method calls.

File

coder_sniffer/Drupal/Test/WhiteSpace/ObjectOperatorIndentUnitTest.inc, line 13
Tests coding standards for chained method calls.

Code

function chained_method_calls(EntityTypeManagerInterface $entityTypeManager) {

  // Some standards compliant chained method calls.
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);

  // Some non-compliant calls.
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
  $result = $entityTypeManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($this->ids);
}