- Issue created by @xjm
- 🇦🇺Australia mstrelan
We could simplify this by using existing rector rules and create child issues that target one or more of these per issue. The relevant rules are listed in \Rector\Config\Level\TypeDeclarationLevel::RULES and I've identified the following as possibly relevant.
void:
- AddVoidReturnTypeWhereNoReturnRector
bool:
- ReturnTypeFromStrictBoolReturnExprRector
- BoolReturnTypeFromStrictScalarReturnsRector
array:
- ReturnTypeFromStrictNewArrayRector
- ReturnTypeFromReturnDirectArrayRector
The downfall is where rector determines the return type based on Other Things, one rule may end up with multiple return types.
- NumericReturnTypeFromStrictScalarReturnsRector
- ReturnTypeFromStrictConstantReturnRector
- ReturnTypeFromStrictTernaryRector
- ReturnTypeFromStrictScalarReturnExprRector
- ReturnTypeFromReturnNewRector
- ReturnTypeFromReturnCastRector
- ReturnTypeFromSymfonySerializerRector
- ReturnTypeFromStrictTypedPropertyRector
- AddReturnTypeDeclarationFromYieldsRector
- ReturnTypeFromStrictNativeCallRector
- ReturnTypeFromStrictTypedCallRector
- ReturnUnionTypeRector
- ReturnTypeFromStrictParamRector
- AddReturnTypeDeclarationBasedOnParentClassMethodRector
- ReturnTypeFromStrictFluentReturnRector
- ReturnNeverTypeRector
- 🇦🇺Australia mstrelan
Added related issue ✨ Enforce return types in all new methods and functions RTBC for discussion.