Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Rector\Tests\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector\Fixture;

class UseTraitAfterProperty
{
private $a;
use SomeTrait;
}

?>
-----
<?php

namespace Rector\Tests\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector\Fixture;

class UseTraitAfterProperty
{
private $a;

use SomeTrait;
}

?>
1 change: 1 addition & 0 deletions rules/CodeQuality/Rector/FuncCall/SortNamedParamRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function refactor(Node $node): ?Node
if ($node instanceof CallLike && $node->isFirstClassCallable()) {
return null;
}

$args = $node instanceof Attribute ? $node->args : $node->getArgs();

if (count($args) <= 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ private function processAddNewLine(ClassLike $classLike, bool $hasChanged, int $
break;
}

if ($classLike->stmts[$key + 1] instanceof TraitUse) {
continue;
}

$stmt = $classLike->stmts[$key];
$nextStmt = $classLike->stmts[$key + 1];

if ($stmt instanceof TraitUse && $nextStmt instanceof TraitUse) {
continue;
}

$endLine = $stmt->getEndLine();
$rangeLine = $nextStmt->getStartLine() - $endLine;

Expand Down