Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit to a single blank line between methods and lines in code #51

Open
roslov opened this issue Apr 12, 2024 · 1 comment
Open

Limit to a single blank line between methods and lines in code #51

roslov opened this issue Apr 12, 2024 · 1 comment

Comments

@roslov
Copy link
Owner

roslov commented Apr 12, 2024

Disable more than one new line between methods, functions, lines of code, etc.

Incorrect:

$a = 10;


return $a;

Correct:

$a = 10;

return $a;

or

$a = 10;
return $a;

Incorrect:

}


public function someMethod(): void
{

Correct:

}

public function someMethod(): void
{
@roslov
Copy link
Owner Author

roslov commented May 11, 2024

Something like this:

<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
    <properties>
        <property name="minLinesCountBeforeFirstMethod" value="0"/>
        <property name="maxLinesCountBeforeFirstMethod" value="1"/>
        <property name="minLinesCountBeforeMethod" value="0"/>
        <property name="maxLinesCountBeforeMethod" value="1"/>
        <property name="minLinesCountAfterMethod" value="0"/>
        <property name="maxLinesCountAfterMethod" value="1"/>
    </properties>
</rule>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant