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

Update class and interface template #764

Closed
wants to merge 1 commit into from

Conversation

umpirsky
Copy link

Classes used to have one extra line before first method/constructor in the class:

<?php

namespace App\Domain;

class Book
{

    public function getTitle()
    {
        // TODO: write logic here
    }
}

After my update, it looks like this:

<?php

namespace App\Domain;

class Book
{
    public function getTitle()
    {
        // TODO: write logic here
    }
}

@Ocramius
Copy link

@umpirsky this fixes a symptom, not the cause. And it breaks PSR-2 compat on empty classes.

@umpirsky
Copy link
Author

@Ocramius True, I know, i just thought that in most cases class will not be empty. :)

I guess more appropriate fix would be to have first method template and add empty line only if it's not the first thing after {.

@Ocramius
Copy link

Indeed, that would be the correct fix.

@umpirsky
Copy link
Author

@Ocramius But harder to implement. :trollface:

@Ocramius
Copy link

Computering is hard: deal with it.

@umpirsky
Copy link
Author

😄

@ciaranmcnulty
Copy link
Member

I believe the work that @shanethehat did for 2.3.0 addresses this; if it doesn't I think an extension to his approach is appropriate rather than breaking the template in a non-PSR2 way.

@ciaranmcnulty
Copy link
Member

@umpirsky Can you check this is still the behaviour for master and if so can you please open an issue so we can discuss the best way to fix?

I appreciate your contribution!

@umpirsky
Copy link
Author

@ciaranmcnulty Oh, it actually works in master, cool! Thanks. 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants