Skip to content

Commit 677eb55

Browse files
committed
update test
1 parent b5e7762 commit 677eb55

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

rules/CodingStyle/Rector/Stmt/NewlineAfterStatementRector.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,31 @@ public function __construct(
2727
public function getRuleDefinition(): RuleDefinition
2828
{
2929
return new RuleDefinition(
30-
'Add new line after statements to tidify code',
30+
'Add empty new line after differnt-type statements to improve code readability',
3131
[
3232
new CodeSample(
3333
<<<'CODE_SAMPLE'
3434
class SomeClass
3535
{
36-
public function first()
37-
{
38-
}
39-
public function second()
36+
public function run($input)
4037
{
38+
$value = 5 * $input;
39+
$secondValue = $value ^ 5;
40+
return $value - $secondValue;
4141
}
4242
}
4343
CODE_SAMPLE
4444
,
4545
<<<'CODE_SAMPLE'
4646
class SomeClass
4747
{
48-
public function first()
48+
public function run($input)
4949
{
50-
}
50+
$value = 5 * $input;
5151
52-
public function second()
53-
{
52+
$secondValue = $value ^ 5;
53+
54+
return $value - $secondValue;
5455
}
5556
}
5657
CODE_SAMPLE

tests/Issues/Issue7306/config/configured_rule.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
66
use Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector;
7-
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
87
use Rector\Config\RectorConfig;
98

109
return RectorConfig::configure()
1110
->withRules(
12-
[SimplifyIfNotNullReturnRector::class, ExplicitBoolCompareRector::class, NewlineAfterStatementRector::class]
11+
[
12+
SimplifyIfNotNullReturnRector::class,
13+
ExplicitBoolCompareRector::class,
14+
\Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector::class,
15+
]
1316
);

0 commit comments

Comments
 (0)