Skip to content

False positive in ScopeIndentSniff when anonymous functions are used with method chaining #298

@oliverklee

Description

@oliverklee

Minimal example:

class FooTest extends AbstractTestCase { public function foo() { $mockedDatabase->expects($this->at(2)) ->method('raw') ->with($this->callback( function ($subject) { } ) ); /** @var Database $mockedDatabase */ /** @var Container $mockedContainer */ $subject = new HeartbeatRegistrator($mockedLogger, $mockedDatabase, $mockedContainer); $subject->addHeartbeatObjectsToQueue(array($mockedHeartbeatObject1, $mockedHeartbeatObject2)); } } 

FOUND 4 ERRORS AFFECTING 4 LINES

32 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found
| | 8
33 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found
| | 8
34 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found
| | 8
36 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found
| | 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions