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

PHP code format - no new line after last method #4611

Closed
zeleznypa opened this issue Sep 10, 2022 · 5 comments · Fixed by #5731
Closed

PHP code format - no new line after last method #4611

zeleznypa opened this issue Sep 10, 2022 · 5 comments · Fixed by #5731
Assignees
Labels
kind:feature A feature request PHP [ci] enable extra PHP tests (php/php.editor)

Comments

@zeleznypa
Copy link

zeleznypa commented Sep 10, 2022

Description

To be able to setup the PSR-12 compatible auto-format, I have to add one empty line „after function“

Snímek obrazovky 2022-09-10 v 14 40 38

But the PSR don't want to have blank line before the class closing curly bracket.

Use case/motivation

I want to have code auto-formatted in PSR-12 compatible way.

Current result:

class Foo
{
    public function bar() {
        // some code
    }

    public function baz() {
        // some code
    }

}

Expected result:

class Foo
{
    public function bar() {
        // some code
    }

    public function baz() {
        // some code
    }
}

Related issues

No response

Are you willing to submit a pull request?

I want to, but I'm not a Java developer

Code of Conduct

Yes

@zeleznypa zeleznypa added kind:feature A feature request needs:triage Requires attention from one of the committers labels Sep 10, 2022
@mbien mbien added the PHP [ci] enable extra PHP tests (php/php.editor) label Sep 19, 2022
@KacerCZ KacerCZ removed the needs:triage Requires attention from one of the committers label Jan 15, 2023
@KacerCZ
Copy link
Contributor

KacerCZ commented Jan 15, 2023

It seems that setting blank lines "Before Class End" is only able to add more blank lines if its value is greater than blank lines "After Fields" or "After Function".
Similar case is also for blank lines "After Class Header" in combination with blank lines "Before Fields" and "Before Function".

So proposal seems to be that settings for class start and end should have higher priority than the other settings.
Right?

@junichi11 junichi11 self-assigned this Mar 27, 2023
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 28, 2023
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 28, 2023
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 29, 2023
@junichi11 junichi11 linked a pull request Mar 29, 2023 that will close this issue
tmysik added a commit that referenced this issue Mar 30, 2023
…class-end

Prioritize "Before Class End" of Blank Lines Option #4611
@zeleznypa
Copy link
Author

@tmysik Thanks so much ❤️

@tmysik
Copy link
Member

tmysik commented Mar 30, 2023

@zeleznypa Not me, I just clicked the Merge button ;)

@junichi11 is the right guy to thank to, he is implementing all the PHP support in NetBeans (not only) these days. Thanks a lot, Junichi!

@zeleznypa
Copy link
Author

@junichi11 Thanks much to you also :)

@junichi11
Copy link
Member

You're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature A feature request PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants