Skip to content

Commit

Permalink
Revert "cs"
Browse files Browse the repository at this point in the history
This reverts commit 8d969bb.
  • Loading branch information
danharrin committed Feb 5, 2025
1 parent 755fd94 commit 9ce2aed
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 33 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"pint",
"npm run prettier"
],
"pint": "pint",
"pint": "pint --config pint-strict-imports.json",
"test:pest": "pest --parallel",
"test:phpstan": "phpstan analyse",
"test": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function refactor(Node $node): ?Node
}

/**
* @param ClassMethod|Function_|Closure|ArrowFunction $classMethod
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $classMethod
*/
private function shouldSkipParam(Param $param, string $expectedName, $classMethod): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
use Filament\Pages\Dashboard;
use Filament\Pages\Page;
use Filament\Resources\Pages\CreateRecord;
use Filament\Schemas\Components\Component;
use PhpParser\Modifiers;
use PhpParser\Node;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
Expand All @@ -23,7 +19,7 @@
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

class FixMethodsRector extends AbstractRector
class SimpleMethodChangesRector extends AbstractRector
{
protected VariableRenamer $variableRenamer;

Expand Down Expand Up @@ -78,19 +74,6 @@ public function getChanges(): array
},
],
],
[
'class' => [
Component::class,
],
'changes' => [
'getChildComponents' => function (ClassMethod $node): void {
$param = new Param(new Variable('slot'), default: new ConstFetch(new Name('null')));
$param->type = new Name('?string');

$node->params = [$param];
},
],
],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

class FixPropertiesRector extends AbstractRector
class SimplePropertyChangesRector extends AbstractRector
{
/**
* @return array<array{
Expand Down
10 changes: 2 additions & 8 deletions packages/upgrade/src/rector.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

use Filament\Infolists\Components\ImageEntry;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\ImageColumn;
use Filament\Upgrade\Rector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
Expand Down Expand Up @@ -262,16 +260,12 @@
);

$rectorConfig->rules([
Rector\FixMethodsRector::class,
Rector\FixPropertiesRector::class,
Rector\SimpleMethodChangesRector::class,
Rector\SimplePropertyChangesRector::class,
Rector\RenameSchemaParamToMatchTypeRector::class,
]);

$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename(Schema::class, 'schema', 'components'),
new MethodCallRename(ImageColumn::class, 'height', 'imageHeight'),
new MethodCallRename(ImageColumn::class, 'width', 'imageWidth'),
new MethodCallRename(ImageEntry::class, 'height', 'imageHeight'),
new MethodCallRename(ImageEntry::class, 'width', 'imageWidth'),
]);
};
17 changes: 17 additions & 0 deletions pint-strict-imports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"preset": "laravel",
"rules": {
"blank_line_before_statement": true,
"concat_space": {
"spacing": "one"
},
"fully_qualified_strict_types": {
"import_symbols": true
},
"method_argument_space": true,
"single_trait_insert_per_statement": true,
"types_spaces": {
"space": "single"
}
}
}
4 changes: 0 additions & 4 deletions pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"concat_space": {
"spacing": "one"
},
"fully_qualified_strict_types": {
"import_symbols": true
},
"global_namespace_import": true,
"method_argument_space": true,
"single_trait_insert_per_statement": true,
"types_spaces": {
Expand Down

0 comments on commit 9ce2aed

Please sign in to comment.