Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The standard (white space) for chained method calls has not been decided yet. See #1516460: Define coding standard for chained method calls.
Consider LocaleLookupTest.php
$this->storage->expects($this->any())
->method('findTranslation')
->will($this->returnCallback(function ($argument) use ($translations) {
if (isset($translations[$argument['language']][$argument['source']])) {
return (object) array('translation' => $translations[$argument['language']][$argument['source']]);
}
return TRUE;
}));
Gives errors like:
167 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
Proposed resolution
Make white space errors for lines part of chained object oriented calls warnings instead of errors, until #1516460: Define coding standard for chained method calls is decided.
Remaining tasks
User interface changes
No.
API changes
No.
Comments
Comment #1
klausiCommitted a fix, thanks for reporting!