*/ final class ConditionalTypeForParameterMapper implements TypeMapperInterface { /** * @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper */ private $phpStanStaticTypeMapper; /** * @required */ public function autowire(PHPStanStaticTypeMapper $phpStanStaticTypeMapper) : void { $this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper; } /** * @return class-string */ public function getNodeClass() : string { return ConditionalTypeForParameter::class; } /** * @param ConditionalTypeForParameter $type * @param TypeKind::* $typeKind */ public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode { return $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($type->getTarget(), $typeKind); } /** * @param ConditionalTypeForParameter $type * @param TypeKind::* $typeKind */ public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node { return $this->phpStanStaticTypeMapper->mapToPhpParserNode($type->getTarget(), $typeKind); } }