Skip to content

Conversation

carusogabriel
Copy link
Contributor

PSR-12 is an extension of the PSR-2 set of rules
that aims to standardize the code style.

As per PSR-12, under the item 3:

The header of a PHP file may consist of a number of different blocks. If present,
each of the blocks below MUST be separated by a single blank line, and MUST NOT
contain a blank line. Each block MUST be in the order listed below, although
blocks that are not relevant may be omitted.

For context on why this was voted in the past, see #9.

[PSR-12](https://www.php-fig.org/psr/psr-12) is an extension of the PSR-2 set of rules that aims to standardize the code style. As per PSR-12, under the [item 3](https://www.php-fig.org/psr/psr-12/#3-declare-statements-namespace-and-import-statements): The header of a PHP file may consist of a number of different blocks. If present, each of the blocks below MUST be separated by a single blank line, and MUST NOT contain a blank line. Each block MUST be in the order listed below, although blocks that are not relevant may be omitted. For context on why this was voted in the past, see #9.
@carusogabriel carusogabriel force-pushed the feature/psr-12-important-statements-separation branch from e6da438 to 1ede95a Compare March 20, 2020 17:03
@carusogabriel carusogabriel added this to the 8.0.0 milestone Mar 20, 2020
@carusogabriel carusogabriel marked this pull request as ready for review March 20, 2020 17:06
@carusogabriel carusogabriel requested a review from a team as a code owner March 20, 2020 17:06
@malarzm
Copy link
Member

malarzm commented Mar 20, 2020

Most important question: does PHPStorm fold all the uses or now I'll have a folded use section for each group?

@carusogabriel
Copy link
Contributor Author

carusogabriel commented Mar 20, 2020

@malarzm Yes, it does 🎉

2020-03-20 at 18 17

I'm gonna assume since 2019.3, as per this article:

In the 5th build (193.4386.20) of the PhpStorm 2019.3 EAP, we’re introducing MongoDB support in DB tools, quick-fixes for the numeric literal separator of PHP 7.4, and last but not least, support for the PSR-12 code style standard.

Copy link
Member

@malarzm malarzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be 👍 on this as PHPStorm works correctly

@greg0ire greg0ire merged commit d025e82 into master Mar 20, 2020
@greg0ire greg0ire deleted the feature/psr-12-important-statements-separation branch March 20, 2020 20:14
@greg0ire
Copy link
Member

Thanks @carusogabriel !

@greg0ire greg0ire self-assigned this Mar 20, 2020
@ostrolucky
Copy link
Member

Thanks @carusogabriel !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8 participants