Skip to content

PSR2 standard is not checking that closing brace is on line following the body #908

@rtucek

Description

@rtucek

From php-fig

Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on its own line, and the closing brace MUST go on the next line following the body. There MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis.

So based on the definition above a function/method like this:

public function some_function() { // Some code here // Some code there return $something; }

should be converted to this (e.g. stripping spaces and linebreaks in the body between the parenthesis and the first/last occurrence of a code block/comment).

public function some_function() { // Some code here // Some code there return $something; }

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