function chained_method_calls in Coder 8.3.x
Same name and namespace in other branches
- 8.3 tests/Drupal/WhiteSpace/ObjectOperatorIndentUnitTest.inc \chained_method_calls()
- 8.2 coder_sniffer/Drupal/Test/WhiteSpace/ObjectOperatorIndentUnitTest.inc \chained_method_calls()
Function containing test code for chained method calls.
File
- tests/
Drupal/ 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);
}