mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 68c42e7e843bfb9fde2b6516bb1bb76648d67045
68c42e7e84
[DeadCode] Skip Remove @return/@param null functionality in case of sub type (#5350)
This commit is contained in:
parent
fffe49e4aa
commit
d2dde21bd9
|
@ -62,10 +62,6 @@ final class DeadParamTagValueNodeAnalyzer
|
|||
if (!$param instanceof Param) {
|
||||
return \false;
|
||||
}
|
||||
// param null is always dead
|
||||
if ($this->isNullTagValueNode($paramTagValueNode)) {
|
||||
return \true;
|
||||
}
|
||||
if ($param->type === null) {
|
||||
return \false;
|
||||
}
|
||||
|
@ -89,11 +85,4 @@ final class DeadParamTagValueNodeAnalyzer
|
|||
}
|
||||
return !$this->genericTypeNodeAnalyzer->hasGenericType($paramTagValueNode->type);
|
||||
}
|
||||
private function isNullTagValueNode(ParamTagValueNode $paramTagValueNode) : bool
|
||||
{
|
||||
if (!$paramTagValueNode->type instanceof IdentifierTypeNode) {
|
||||
return \false;
|
||||
}
|
||||
return (string) $paramTagValueNode->type === 'null';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,10 +68,6 @@ final class DeadReturnTagValueNodeAnalyzer
|
|||
public function isDead(ReturnTagValueNode $returnTagValueNode, $functionLike) : bool
|
||||
{
|
||||
$returnType = $functionLike->getReturnType();
|
||||
if ($this->isNullTagValueNode($returnTagValueNode)) {
|
||||
// return null is always unused
|
||||
return \true;
|
||||
}
|
||||
if ($returnType === null) {
|
||||
return \false;
|
||||
}
|
||||
|
@ -153,11 +149,4 @@ final class DeadReturnTagValueNodeAnalyzer
|
|||
}
|
||||
return !$this->isNeverReturnType($returnType);
|
||||
}
|
||||
private function isNullTagValueNode(ReturnTagValueNode $returnTagValueNode) : bool
|
||||
{
|
||||
if (!$returnTagValueNode->type instanceof IdentifierTypeNode) {
|
||||
return \false;
|
||||
}
|
||||
return (string) $returnTagValueNode->type === 'null';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '287eab3a7040f8d42fa10701d5fbfc2998fdcc25';
|
||||
public const PACKAGE_VERSION = '68c42e7e843bfb9fde2b6516bb1bb76648d67045';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-12-10 17:30:26';
|
||||
public const RELEASE_DATE = '2023-12-10 17:31:56';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue