diff --git a/composer.json b/composer.json index 01d4df3461f..2436df6cd08 100644 --- a/composer.json +++ b/composer.json @@ -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": [ diff --git a/packages/upgrade/src/Rector/RenameSchemaParamToMatchTypeRector.php b/packages/upgrade/src/Rector/RenameSchemaParamToMatchTypeRector.php index e8a3f4997d8..953ef3d75d7 100644 --- a/packages/upgrade/src/Rector/RenameSchemaParamToMatchTypeRector.php +++ b/packages/upgrade/src/Rector/RenameSchemaParamToMatchTypeRector.php @@ -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 { diff --git a/packages/upgrade/src/Rector/FixMethodsRector.php b/packages/upgrade/src/Rector/SimpleMethodChangesRector.php similarity index 86% rename from packages/upgrade/src/Rector/FixMethodsRector.php rename to packages/upgrade/src/Rector/SimpleMethodChangesRector.php index 0f760224884..7a54b459676 100644 --- a/packages/upgrade/src/Rector/FixMethodsRector.php +++ b/packages/upgrade/src/Rector/SimpleMethodChangesRector.php @@ -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; @@ -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; @@ -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]; - }, - ], - ], ]; } diff --git a/packages/upgrade/src/Rector/FixPropertiesRector.php b/packages/upgrade/src/Rector/SimplePropertyChangesRector.php similarity index 99% rename from packages/upgrade/src/Rector/FixPropertiesRector.php rename to packages/upgrade/src/Rector/SimplePropertyChangesRector.php index 470ebe3fe16..143615be772 100644 --- a/packages/upgrade/src/Rector/FixPropertiesRector.php +++ b/packages/upgrade/src/Rector/SimplePropertyChangesRector.php @@ -22,7 +22,7 @@ use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; -class FixPropertiesRector extends AbstractRector +class SimplePropertyChangesRector extends AbstractRector { /** * @return arrayrules([ - 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'), ]); }; diff --git a/pint-strict-imports.json b/pint-strict-imports.json new file mode 100644 index 00000000000..4e54320d7ce --- /dev/null +++ b/pint-strict-imports.json @@ -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" + } + } +} diff --git a/pint.json b/pint.json index 580e983cdbb..c6ddb4940cf 100644 --- a/pint.json +++ b/pint.json @@ -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": {