mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
Updated Rector to commit 79c57f019e1c94c72ef79cb6cbdda864bdc2e1c1
79c57f019e
[TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector (#5333)
This commit is contained in:
parent
58923caaf6
commit
fb06a0e1f2
|
@ -12,6 +12,7 @@ use Rector\Core\Enum\ObjectReference;
|
||||||
use Rector\Core\Php\PhpVersionProvider;
|
use Rector\Core\Php\PhpVersionProvider;
|
||||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||||
|
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||||
use Rector\StaticTypeMapper\ValueObject\Type\SelfStaticType;
|
use Rector\StaticTypeMapper\ValueObject\Type\SelfStaticType;
|
||||||
use Rector\StaticTypeMapper\ValueObject\Type\SimpleStaticType;
|
use Rector\StaticTypeMapper\ValueObject\Type\SimpleStaticType;
|
||||||
/**
|
/**
|
||||||
|
@ -45,20 +46,19 @@ final class StaticTypeMapper implements TypeMapperInterface
|
||||||
return $type->toPhpDocNode();
|
return $type->toPhpDocNode();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param StaticType $type
|
* @param SimpleStaticType|StaticType $type
|
||||||
*/
|
*/
|
||||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||||
{
|
{
|
||||||
// special case, for autocomplete of return type
|
|
||||||
if ($type instanceof SimpleStaticType) {
|
|
||||||
return new Name(ObjectReference::STATIC);
|
|
||||||
}
|
|
||||||
if ($type instanceof SelfStaticType) {
|
if ($type instanceof SelfStaticType) {
|
||||||
return new Name(ObjectReference::SELF);
|
return new Name(ObjectReference::SELF);
|
||||||
}
|
}
|
||||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::STATIC_RETURN_TYPE)) {
|
if ($typeKind !== TypeKind::RETURN) {
|
||||||
return new Name(ObjectReference::STATIC);
|
return new Name(ObjectReference::SELF);
|
||||||
}
|
}
|
||||||
return new Name(ObjectReference::SELF);
|
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::STATIC_RETURN_TYPE)) {
|
||||||
|
return new Name(ObjectReference::SELF);
|
||||||
|
}
|
||||||
|
return new Name(ObjectReference::STATIC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '043d43cd0347b4c2a73e896674a1f22ab1ce6d62';
|
public const PACKAGE_VERSION = '79c57f019e1c94c72ef79cb6cbdda864bdc2e1c1';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-12-06 14:26:04';
|
public const RELEASE_DATE = '2023-12-06 21:22:55';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user