Skip to content

Fix PSR namespaces#114

Merged
dg merged 2 commits into
nette:masterfrom
Jeroeny:nsnewline
Aug 23, 2022
Merged

Fix PSR namespaces#114
dg merged 2 commits into
nette:masterfrom
Jeroeny:nsnewline

Conversation

@Jeroeny

@Jeroeny Jeroeny commented Aug 23, 2022

Copy link
Copy Markdown
Contributor
  • Bugfix
  • BC: There is a difference in the output of PsrPrinter

The PSR standard(s) seem to indicate that they use a newline between use statements of different types (class, function and const).
It would be nice if this could be supported

@dg

dg commented Aug 23, 2022

Copy link
Copy Markdown
Member

Thanks!

@dg dg merged commit b95f7fd into nette:master Aug 23, 2022
@Jeroeny Jeroeny deleted the nsnewline branch August 23, 2022 20:24
@dg

dg commented Aug 23, 2022

Copy link
Copy Markdown
Member

What is the $psrSort for?

dg pushed a commit that referenced this pull request Aug 23, 2022
@Jeroeny

Jeroeny commented Aug 24, 2022

Copy link
Copy Markdown
Contributor Author

What is the $psrSort for?

It fixes the namespace sort:

before

namespace Example;

use Example\Foo\EmailAlias\Bar;
use Example\Foo\Email\Test;
use Example\Foo\MyClass;
use Example\Foo\Other;

after

namespace Example;

use Example\Foo\Email\Test;
use Example\Foo\EmailAlias\Bar;
use Example\Foo\MyClass;
use Example\Foo\Other;

Maybe it can be supported but not by default enabled in any printer?

dg pushed a commit that referenced this pull request Sep 12, 2022
@dg

dg commented Oct 6, 2022

Copy link
Copy Markdown
Member

@Jeroeny okay, I'm gonna use that as the default sort.

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.

2 participants