ObjectOperatorIndentUnitTest.inc in Coder 8.3
Same filename and directory in other branches
Tests coding standards for chained method calls.
File
tests/Drupal/WhiteSpace/ObjectOperatorIndentUnitTest.incView 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
Name | Description |
---|---|
chained_method_calls | Function containing test code for chained method calls. |