mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-06 03:10:50 +00:00
Updated Rector to commit 99a79f8df18f4202f7c939b7996b9714abb78fe4
99a79f8df1
[TypeDeclaration] Fix abs() returns on ReturnTypeFromStrictTypedCallRector (#5652)
This commit is contained in:
parent
dc98feb11d
commit
283153802a
|
@ -3,6 +3,7 @@
|
||||||
declare (strict_types=1);
|
declare (strict_types=1);
|
||||||
namespace Rector\TypeDeclaration\TypeAnalyzer;
|
namespace Rector\TypeDeclaration\TypeAnalyzer;
|
||||||
|
|
||||||
|
use PHPStan\Reflection\ParametersAcceptorSelector;
|
||||||
use PhpParser\Node;
|
use PhpParser\Node;
|
||||||
use PhpParser\Node\Expr;
|
use PhpParser\Node\Expr;
|
||||||
use PhpParser\Node\Expr\Array_;
|
use PhpParser\Node\Expr\Array_;
|
||||||
|
@ -98,12 +99,12 @@ final class ReturnStrictTypeAnalyzer
|
||||||
if ($methodReflection === null) {
|
if ($methodReflection === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$parametersAcceptor = $methodReflection->getVariants()[0];
|
$parametersAcceptorWithPhpDocs = ParametersAcceptorSelector::combineAcceptors($methodReflection->getVariants());
|
||||||
if ($parametersAcceptor instanceof FunctionVariantWithPhpDocs) {
|
if ($parametersAcceptorWithPhpDocs instanceof FunctionVariantWithPhpDocs) {
|
||||||
// native return type is needed, as docblock can be false
|
// native return type is needed, as docblock can be false
|
||||||
$returnType = $parametersAcceptor->getNativeReturnType();
|
$returnType = $parametersAcceptorWithPhpDocs->getNativeReturnType();
|
||||||
} else {
|
} else {
|
||||||
$returnType = $parametersAcceptor->getReturnType();
|
$returnType = $parametersAcceptorWithPhpDocs->getReturnType();
|
||||||
}
|
}
|
||||||
if ($returnType instanceof MixedType) {
|
if ($returnType instanceof MixedType) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '290926cc8b93331dd715d7ea061847dafbc1821a';
|
public const PACKAGE_VERSION = '99a79f8df18f4202f7c939b7996b9714abb78fe4';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-02-21 15:28:36';
|
public const RELEASE_DATE = '2024-02-21 23:16:34';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user