Skip to content

Clarifying blank line between methods #54

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

Closed
mbniebergall opened this issue Nov 11, 2022 · 1 comment
Closed

Clarifying blank line between methods #54

mbniebergall opened this issue Nov 11, 2022 · 1 comment

Comments

@mbniebergall
Copy link

I've read and re-read the specs, and had a peer search as well, and I am not finding clarity that there MUST be a blank line between class methods. All the examples show it, but it doesn't seem to be clear that it is required in the spec.

For example, this seems to be allowed:

class BlankLine
{
    public function firstMethod()
    {
        ...
    }
    public function nextMethod()
    {
        ...
    }
}

When it should be this instead:

class BlankLine
{
    public function firstMethod()
    {
        ...
    }

    public function nextMethod()
    {
        ...
    }
}

Can anyone prove me wrong in the spec? If not, I'll get a PR open to clarify this.

@KorvinSzanto
Copy link
Contributor

We currently allow both of your examples and I don't think we want to change that. The blank lines between methods can be added as part of:

Blank lines MAY be added to improve readability and to indicate related blocks of code except where explicitly forbidden.

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

2 participants