Skip to content

Adopt PSR-12 for imports statements separation #164

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

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Doctrine/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
<properties>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="0"/>
<property name="linesCountBetweenUseTypes" value="1"/>
</properties>
</rule>
<!-- Forbid useless alias for classes, constants and functions -->
Expand Down
1 change: 1 addition & 0 deletions tests/fixed/ControlStructures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use InvalidArgumentException;
use Throwable;

use const PHP_VERSION;

class ControlStructures
Expand Down
2 changes: 2 additions & 0 deletions tests/fixed/example-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
use Fancy\TestCase;
use InvalidArgumentException;
use IteratorAggregate;

use function assert;
use function strlen as stringLength;
use function substr;

use const PHP_MINOR_VERSION;
use const PHP_RELEASE_VERSION as PHP_PATCH_VERSION;
use const PHP_VERSION;
Expand Down
2 changes: 2 additions & 0 deletions tests/fixed/namespaces-spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use DateInterval;
use DateTimeImmutable;
use DateTimeZone;

use function strrev;
use function time;

use const DATE_RFC3339;

strrev(
Expand Down
2 changes: 2 additions & 0 deletions tests/fixed/use-ordering.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

use DateTimeImmutable;
use DateTimeInterface;

use function sprintf;

use const PHP_EOL;

echo sprintf('Current date and time is %s', (new DateTimeImmutable())->format(DateTimeInterface::ATOM)) . PHP_EOL;
1 change: 1 addition & 0 deletions tests/input/ControlStructures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use InvalidArgumentException;
use Throwable;

use const PHP_VERSION;

class ControlStructures
Expand Down
4 changes: 4 additions & 0 deletions tests/input/example-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
namespace Example;

use Throwable;

use function strlen as stringLength;

use Fancy\TestCase as TestCase;

use const PHP_RELEASE_VERSION as PHP_PATCH_VERSION;

use Doctrine\Sniffs\Spacing\ControlStructureSniff;

/**
Expand Down
2 changes: 0 additions & 2 deletions tests/input/namespaces-spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
use DateInterval;
use DateTimeImmutable;
use DateTimeZone;

use function strrev;
use function time;

use const DATE_RFC3339;
strrev(
(new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))
Expand Down
3 changes: 3 additions & 0 deletions tests/input/use-ordering.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
namespace Foo;

use function sprintf;

use DateTimeImmutable;

use const PHP_EOL;

use DateTimeInterface;

echo sprintf('Current date and time is %s', (new DateTimeImmutable())->format(DateTimeInterface::ATOM)) . PHP_EOL;