Skip to content

Commit d025e82

Browse files
authored
Merge pull request #164 from doctrine/feature/psr-12-important-statements-separation
Adopt PSR-12 for imports statements separation
2 parents 7e7aff6 + 1ede95a commit d025e82

File tree

9 files changed

+16
-3
lines changed

9 files changed

+16
-3
lines changed

lib/Doctrine/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
<properties>
302302
<property name="linesCountAfterLastUse" value="1"/>
303303
<property name="linesCountBeforeFirstUse" value="1"/>
304-
<property name="linesCountBetweenUseTypes" value="0"/>
304+
<property name="linesCountBetweenUseTypes" value="1"/>
305305
</properties>
306306
</rule>
307307
<!-- Forbid useless alias for classes, constants and functions -->

tests/fixed/ControlStructures.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use InvalidArgumentException;
88
use Throwable;
9+
910
use const PHP_VERSION;
1011

1112
class ControlStructures

tests/fixed/example-class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
use Fancy\TestCase;
1010
use InvalidArgumentException;
1111
use IteratorAggregate;
12+
1213
use function assert;
1314
use function strlen as stringLength;
1415
use function substr;
16+
1517
use const PHP_MINOR_VERSION;
1618
use const PHP_RELEASE_VERSION as PHP_PATCH_VERSION;
1719
use const PHP_VERSION;

tests/fixed/namespaces-spacing.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
use DateInterval;
88
use DateTimeImmutable;
99
use DateTimeZone;
10+
1011
use function strrev;
1112
use function time;
13+
1214
use const DATE_RFC3339;
1315

1416
strrev(

tests/fixed/use-ordering.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
use DateTimeImmutable;
88
use DateTimeInterface;
9+
910
use function sprintf;
11+
1012
use const PHP_EOL;
1113

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

tests/input/ControlStructures.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use InvalidArgumentException;
88
use Throwable;
9+
910
use const PHP_VERSION;
1011

1112
class ControlStructures

tests/input/example-class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
namespace Example;
66

77
use Throwable;
8+
89
use function strlen as stringLength;
10+
911
use Fancy\TestCase as TestCase;
12+
1013
use const PHP_RELEASE_VERSION as PHP_PATCH_VERSION;
14+
1115
use Doctrine\Sniffs\Spacing\ControlStructureSniff;
1216

1317
/**

tests/input/namespaces-spacing.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
use DateInterval;
66
use DateTimeImmutable;
77
use DateTimeZone;
8-
98
use function strrev;
109
use function time;
11-
1210
use const DATE_RFC3339;
1311
strrev(
1412
(new DateTimeImmutable('@' . time(), new DateTimeZone('UTC')))

tests/input/use-ordering.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
namespace Foo;
66

77
use function sprintf;
8+
89
use DateTimeImmutable;
10+
911
use const PHP_EOL;
12+
1013
use DateTimeInterface;
1114

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

0 commit comments

Comments
 (0)