You are here

ObjectOperatorIndentUnitTest.inc in Coder 8.2

Tests coding standards for chained method calls.

File

coder_sniffer/Drupal/Test/WhiteSpace/ObjectOperatorIndentUnitTest.inc
View source
<?php

/**
 * @file
 * Tests coding standards for chained method calls.
 */
use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
 * Function containing test code for chained method calls.
 */
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);
}

Functions

Namesort descending Description
chained_method_calls Function containing test code for chained method calls.