From 46121438bc6ba8421bc2e8a2bc90bafdf5786c3c Mon Sep 17 00:00:00 2001 From: geni_jaho Date: Wed, 11 Dec 2024 20:45:56 +0100 Subject: [PATCH] Refactor into our own AbstractRector that implements DocumentedRuleInterface --- composer.json | 3 ++- src/AbstractRector.php | 8 ++++++++ src/Rector/ArrayDimFetch/EnvVariableToEnvHelperRector.php | 2 +- .../RequestVariablesToRequestFacadeRector.php | 2 +- .../CallOnAppArrayAccessToStandaloneAssignRector.php | 2 +- .../Cast/DatabaseExpressionCastsToMethodCallRector.php | 2 +- src/Rector/ClassMethod/AddArgumentDefaultValueRector.php | 2 +- .../ClassMethod/AddGenericReturnTypeToRelationsRector.php | 2 +- .../ClassMethod/AddParentBootToModelClassMethodRector.php | 2 +- .../AddParentRegisterToEventServiceProviderRector.php | 2 +- .../ClassMethod/MigrateToSimplifiedAttributeRector.php | 2 +- .../Class_/AddExtendsAnnotationToModelFactoriesRector.php | 2 +- .../AddMockConsoleOutputFalseToConsoleTestsRector.php | 2 +- src/Rector/Class_/AnonymousMigrationsRector.php | 2 +- src/Rector/Class_/CashierStripeOptionsToStripeRector.php | 2 +- ...reComponentComputedMethodToComputedAttributeRector.php | 2 +- .../LivewireComponentQueryStringToUrlAttributeRector.php | 2 +- .../Class_/ModelCastsPropertyToCastsMethodRector.php | 2 +- .../Class_/PropertyDeferToDeferrableProviderToRector.php | 2 +- .../Class_/RemoveModelPropertyFromFactoriesRector.php | 2 +- src/Rector/Class_/ReplaceExpectsMethodsInTestsRector.php | 2 +- src/Rector/Class_/UnifyModelDatesWithCastsRector.php | 2 +- .../Coalesce/ApplyDefaultInsteadOfNullCoalesceRector.php | 2 +- src/Rector/Empty_/EmptyToBlankAndFilledFuncRector.php | 2 +- .../Expr/AppEnvironmentComparisonToParameterRector.php | 2 +- ...SubStrToStartsWithOrEndsWithStaticMethodCallRector.php | 2 +- .../FuncCall/ArgumentFuncCallToMethodCallRector.php | 2 +- .../DispatchNonShouldQueueToDispatchSyncRector.php | 2 +- src/Rector/FuncCall/FactoryFuncCallToStaticCallRector.php | 2 +- src/Rector/FuncCall/HelperFuncCallToFacadeClassRector.php | 2 +- .../NotFilledBlankFuncCallToBlankFilledFuncCallRector.php | 2 +- .../NowFuncWithStartOfDayMethodCallToTodayFuncRector.php | 2 +- src/Rector/FuncCall/RemoveDumpDataDeadCodeRector.php | 2 +- src/Rector/FuncCall/RemoveRedundantValueCallsRector.php | 2 +- src/Rector/FuncCall/RemoveRedundantWithCallsRector.php | 2 +- src/Rector/FuncCall/SleepFuncToSleepStaticCallRector.php | 2 +- ...owIfAndThrowUnlessExceptionsToUseClassStringRector.php | 2 +- src/Rector/FuncCall/TypeHintTappableCallRector.php | 2 +- src/Rector/If_/AbortIfRector.php | 2 +- src/Rector/If_/ReportIfRector.php | 2 +- src/Rector/If_/ThrowIfRector.php | 2 +- src/Rector/MethodCall/AssertSeeToAssertSeeHtmlRector.php | 2 +- .../MethodCall/AssertStatusToAssertMethodRector.php | 2 +- .../AvoidNegatedCollectionFilterOrRejectRector.php | 2 +- .../ChangeQueryWhereDateValueWithCarbonRector.php | 2 +- .../DatabaseExpressionToStringToMethodCallRector.php | 2 +- .../MethodCall/EloquentOrderByToLatestOrOldestRector.php | 2 +- .../EloquentWhereRelationTypeHintingParameterRector.php | 2 +- .../EloquentWhereTypeHintClosureParameterRector.php | 2 +- src/Rector/MethodCall/FactoryApplyingStatesRector.php | 2 +- .../MethodCall/JsonCallToExplicitJsonCallRector.php | 2 +- .../LumenRoutesStringActionToUsesArrayRector.php | 2 +- .../LumenRoutesStringMiddlewareToArrayRector.php | 2 +- src/Rector/MethodCall/RedirectBackToBackHelperRector.php | 2 +- .../MethodCall/RedirectRouteToToRouteHelperRector.php | 2 +- .../MethodCall/RefactorBlueprintGeometryColumnsRector.php | 2 +- .../MethodCall/ReplaceServiceContainerCallArgRector.php | 2 +- ...houtJobsEventsAndNotificationsWithFacadeFakeRector.php | 2 +- .../MethodCall/ResponseHelperCallToJsonResponseRector.php | 2 +- .../MethodCall/ReverseConditionableMethodCallRector.php | 2 +- .../UseComponentPropertyWithinCommandsRector.php | 2 +- .../ValidationRuleArrayStringValueToArrayRector.php | 2 +- src/Rector/Namespace_/FactoryDefinitionRector.php | 2 +- src/Rector/New_/AddGuardToLoginEventRector.php | 2 +- .../PropertyFetch/OptionalToNullsafeOperatorRector.php | 2 +- .../ReplaceFakerInstanceWithHelperRector.php | 2 +- .../StaticCall/CarbonSetTestNowToTravelToRector.php | 2 +- src/Rector/StaticCall/DispatchToHelperFunctionsRector.php | 2 +- .../EloquentMagicMethodToQueryBuilderRector.php | 2 +- src/Rector/StaticCall/MinutesToSecondsInCacheRector.php | 2 +- .../StaticCall/Redirect301ToPermanentRedirectRector.php | 2 +- .../ReplaceAssertTimesSendWithAssertSentTimesRector.php | 2 +- .../StaticCall/RequestStaticValidateToInjectRector.php | 2 +- src/Rector/StaticCall/RouteActionCallableRector.php | 2 +- 74 files changed, 82 insertions(+), 73 deletions(-) create mode 100644 src/AbstractRector.php diff --git a/composer.json b/composer.json index 4cf4c83a..5ca27eaa 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "require": { "php": ">=8.2", "rector/rector": "^2.0.0-rc2", - "webmozart/assert": "^1.11" + "webmozart/assert": "^1.11", + "symplify/rule-doc-generator-contracts": "^11.2" }, "require-dev": { "nikic/php-parser": "^5.3", diff --git a/src/AbstractRector.php b/src/AbstractRector.php new file mode 100644 index 00000000..6819f079 --- /dev/null +++ b/src/AbstractRector.php @@ -0,0 +1,8 @@ +