Updated Rector to commit 79c57f019e1c94c72ef79cb6cbdda864bdc2e1c1

79c57f019e [TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector (#5333)
This commit is contained in:
Tomas Votruba 2023-12-06 14:25:02 +00:00
parent 58923caaf6
commit fb06a0e1f2
2 changed files with 10 additions and 10 deletions

View File

@ -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);
} }
} }

View File

@ -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
*/ */