Skip to content

Commit 8a9960c

Browse files
committed
re-add dependency changes
1 parent 7b69bbe commit 8a9960c

File tree

3 files changed

+5
-62
lines changed

3 files changed

+5
-62
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
"require-dev": {
3535
"pestphp/pest": "^3.0",
3636
"laravel/pint": "^1.14",
37-
"phpstan/phpstan": "^1.11",
37+
"phpstan/phpstan": "^2.1",
3838
"pestphp/pest-plugin-arch": "^3.0",
3939
"pestphp/pest-plugin-laravel": "^3.0",
4040
"phpstan/extension-installer": "^1.3",
41-
"phpstan/phpstan-deprecation-rules": "^1.2",
42-
"rector/rector": "^1.1",
41+
"phpstan/phpstan-deprecation-rules": "^2.0",
42+
"rector/rector": "^2.1",
4343
"projektgopher/whisky": "^0.7.0",
4444
"orchestra/testbench": "^9.4",
4545
"mockery/mockery": "^1.6",
4646
"symplify/rule-doc-generator-contracts": "^11.2",
47-
"phpstan/phpdoc-parser": "^1.24",
47+
"phpstan/phpdoc-parser": "^2.0",
4848
"spatie/laravel-ray": "^1.40"
4949
},
5050
"autoload-dev": {

rector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
declare(strict_types=1);
44

55
use Prism\Bedrock\Rectors\ReorderMethodsRector;
6-
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
76
use Rector\Config\RectorConfig;
87
use Rector\Set\ValueObject\LevelSetList;
98
use Rector\Set\ValueObject\SetList;
@@ -15,7 +14,6 @@
1514
__DIR__.'/tests',
1615
])
1716
->withRules([
18-
InlineConstructorDefaultToPropertyRector::class,
1917
ReorderMethodsRector::class,
2018
])
2119
->withSets([

src/Rectors/ReorderMethodsRector.php

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use PhpParser\Node\Stmt\Class_;
77
use PhpParser\Node\Stmt\ClassMethod;
88
use Rector\Rector\AbstractRector;
9-
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
10-
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
119

1210
class ReorderMethodsRector extends AbstractRector
1311
{
@@ -36,66 +34,13 @@ public function refactor(Node $node): ?Node
3634
}
3735

3836
$node->stmts = array_merge(
39-
array_filter($node->stmts, fn ($stmt): bool => ! $stmt instanceof ClassMethod),
37+
array_filter($node->stmts, fn (\PhpParser\Node\Stmt $stmt): bool => ! $stmt instanceof ClassMethod),
4038
$reorderedMethods
4139
);
4240

4341
return $node;
4442
}
4543

46-
#[\Override]
47-
public function getRuleDefinition(): RuleDefinition
48-
{
49-
return new RuleDefinition(
50-
'Reorders class methods: magic methods first, then public, protected, and private.',
51-
[
52-
new CodeSample(
53-
<<<'CODE_SAMPLE'
54-
class SomeClass
55-
{
56-
private function privateMethod()
57-
{
58-
}
59-
60-
public function publicMethod()
61-
{
62-
}
63-
64-
protected function protectedMethod()
65-
{
66-
}
67-
68-
public function __construct()
69-
{
70-
}
71-
}
72-
CODE_SAMPLE
73-
,
74-
<<<'CODE_SAMPLE'
75-
class SomeClass
76-
{
77-
public function __construct()
78-
{
79-
}
80-
81-
public function publicMethod()
82-
{
83-
}
84-
85-
protected function protectedMethod()
86-
{
87-
}
88-
89-
private function privateMethod()
90-
{
91-
}
92-
}
93-
CODE_SAMPLE
94-
),
95-
]
96-
);
97-
}
98-
9944
/**
10045
* @param array<int, ClassMethod> $methods
10146
* @return array<int, ClassMethod>

0 commit comments

Comments
 (0)