-
-
Notifications
You must be signed in to change notification settings - Fork 728
Closed
Labels
Description
Rules like TypedPropertyRector
and PropertyTypeDeclarationRector
do way too much. Also, the name is super unclear and overlapping.
Infering from 7 different places with different priorities, this result is often "not the best":
+/**
+ * @var DateTime|null
+ */
public $dateTime;
public fuction getDateTime(): DateTime|null
{
return $this->dateTime;
}
This is technically correct, but based on strict return type, the property cannot be anything else than DateTime|null
strict type.
Saying that, these should be separated to own rules, so developer can add them one by one. Also, we'll be able to control them without deep nesting. This already started with:
ParamTypeByParentCallTypeRector
ParamTypeFromStrictTypedPropertyRector
ReturnTypeFromReturnNewRector
etc.