Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seal private and internal types #15668

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace OrchardCore.Admin
{
internal class AdminPageRouteModelProvider : IPageRouteModelProvider
internal sealed class AdminPageRouteModelProvider : IPageRouteModelProvider
{
private readonly IHostEnvironment _hostingEnvironment;
private readonly ApplicationPartManager _applicationManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<string> GetContentItemIdAsync(string handle)
}
}

internal class AliasPartContentHandleHelper
internal sealed class AliasPartContentHandleHelper
{
#pragma warning disable CA1862 // Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
internal static Task<ContentItem> QueryAliasIndex(ISession session, string alias) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace OrchardCore.BackgroundTasks.Services
/// <summary>
/// An empty change token that is always in the changed state but without raising any change callbacks.
/// </summary>
internal class AlwaysHasChangedToken : IChangeToken
internal sealed class AlwaysHasChangedToken : IChangeToken
{
public static AlwaysHasChangedToken Singleton { get; } = new AlwaysHasChangedToken();

Expand All @@ -24,7 +24,7 @@ public IDisposable RegisterChangeCallback(Action<object> callback, object state)
}
}

internal class EmptyDisposable : IDisposable
internal sealed class EmptyDisposable : IDisposable
{
public static EmptyDisposable Instance { get; } = new EmptyDisposable();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public FieldType GetField(ContentPartFieldDefinition field)
};
}

private class FieldTypeDescriptor
private sealed class FieldTypeDescriptor
{
public string Description { get; set; }
public Type FieldType { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace OrchardCore.ContentLocalization.Handlers
{
internal class ContentLocalizationPartHandlerCoordinator : ContentLocalizationHandlerBase
internal sealed class ContentLocalizationPartHandlerCoordinator : ContentLocalizationHandlerBase
{
private readonly ITypeActivatorFactory<ContentPart> _contentPartFactory;
private readonly IEnumerable<IContentLocalizationPartHandler> _partHandlers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private Task UpdateContentPartAsync(ContentPartDefinition part, ContentPartDefin
}
});

private class ContentDefinitionStepModel
private sealed class ContentDefinitionStepModel
{
public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = [];
public ContentPartDefinitionRecord[] ContentParts { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context)
}
}

private class DeleteContentDefinitionStepModel
private sealed class DeleteContentDefinitionStepModel
{
public string[] ContentTypes { get; set; } = [];
public string[] ContentParts { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ await _contentDefinitionManager.AlterPartDefinitionAsync(record.Name, builder =>
});
}

private class ReplaceContentDefinitionStepModel
private sealed class ReplaceContentDefinitionStepModel
{
public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = [];
public ContentPartDefinitionRecord[] ContentParts { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Task RecipeStepExecutingAsync(RecipeExecutionContext context)
return Task.CompletedTask;
}

private class ContentDefinitionStepModel
private sealed class ContentDefinitionStepModel
{
public string Name { get; set; }
public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OrchardCore.Demo.Services
{
internal class UserProfileClaimsProvider : IUserClaimsProvider
internal sealed class UserProfileClaimsProvider : IUserClaimsProvider
{
public Task GenerateAsync(IUser user, ClaimsIdentity claims)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ public Task ExecuteAsync(RecipeExecutionContext context)
return _deploymentPlanService.CreateOrUpdateDeploymentPlansAsync(deploymentPlans);
}

private class DeploymentPlansModel
private sealed class DeploymentPlansModel
{
public DeploymentPlanModel[] Plans { get; set; }
}

private class DeploymentPlanModel
private sealed class DeploymentPlanModel
{
public string Name { get; set; }

public DeploymentStepModel[] Steps { get; set; }
}

private class DeploymentStepModel
private sealed class DeploymentStepModel
{
public string Type { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context)
}
}

private class FeatureStepModel
private sealed class FeatureStepModel
{
public string Name { get; set; }
public string[] Disable { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static ModelStateDictionary DeserializeModelState(string serialisedErrorL
return modelState;
}

private class ModelStateTransferValue
private sealed class ModelStateTransferValue
{
public string Key { get; set; }
public string AttemptedValue { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ await _contentDefinitionManager.AlterTypeDefinitionAsync("TextArea", type => typ
return 4;
}

internal class TitlePartSettings
internal sealed class TitlePartSettings
{
public int Options { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultE
await next.Invoke();
}

internal class CacheEntry : Document
internal sealed class CacheEntry : Document
{
public IEnumerable<LayerMetadata> Widgets { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan
});
}

private class MediaDeploymentStepModel
private sealed class MediaDeploymentStepModel
{
public string SourcePath { get; set; }
public string TargetPath { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum Format
WebP
}

internal class ImageSharpUrlFormatter
internal sealed class ImageSharpUrlFormatter
{
public static string GetImageResizeUrl(string path, IDictionary<string, string> queryStringParams = null, int? width = null, int? height = null, ResizeMode resizeMode = ResizeMode.Undefined, int? quality = null, Format format = Format.Undefined, Anchor anchor = null, string bgcolor = null)
{
Expand All @@ -53,7 +53,7 @@ public static string GetImageResizeUrl(string path, IDictionary<string, string>
queryStringParams["rmode"] = resizeMode.ToString().ToLower();
}

// The format is set before quality such that the quality is not
// The format is set before quality such that the quality is not
// invalidated when the url is generated.
if (format != Format.Undefined)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public async Task ExecuteAsync(RecipeExecutionContext context)
}
}

private class MediaStepModel
private sealed class MediaStepModel
{
/// <summary>
/// Collection of <see cref="MediaStepFile"/> objects.
/// </summary>
public MediaStepFile[] Files { get; set; }
}

private class MediaStepFile
private sealed class MediaStepFile
{
/// <summary>
/// Path where the content will be written.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OrchardCore.Microsoft.Authentication.Configuration
{
internal class CookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
internal sealed class CookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
{
private readonly string _tenantPrefix;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OrchardCore.Microsoft.Authentication.Configuration
{
internal class OpenIdConnectOptionsConfiguration : IConfigureNamedOptions<OpenIdConnectOptions>
internal sealed class OpenIdConnectOptionsConfiguration : IConfigureNamedOptions<OpenIdConnectOptions>
{
private readonly IOptionsMonitor<MicrosoftIdentityOptions> _azureADOptions;
private readonly AzureADSettings _azureADSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OrchardCore.MiniProfiler
{
internal class CurrentDbProfiler : IDbProfiler
internal sealed class CurrentDbProfiler : IDbProfiler
{
private Func<IDbProfiler> GetProfiler { get; }
public CurrentDbProfiler(Func<IDbProfiler> getProfiler) => GetProfiler = getProfiler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace OrchardCore.MiniProfiler
{
internal class MiniProfilerConnectionFactory : IConnectionFactory
internal sealed class MiniProfilerConnectionFactory : IConnectionFactory
{
protected static readonly string ConnectionName = nameof(ProfiledDbConnection).ToLower();
private static readonly string ConnectionName = nameof(ProfiledDbConnection).ToLower();

private readonly IConnectionFactory _factory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context)
}
}

private class CommandStepModel
private sealed class CommandStepModel
{
public string[] Commands { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public async Task ExecuteAsync(RecipeExecutionContext context)
context.InnerRecipes = innerRecipes;
}

private class InternalStep
private sealed class InternalStep
{
public InternalStepValue[] Values { get; set; }
}

private class InternalStepValue
private sealed class InternalStepValue
{
public string ExecutionId { get; set; }
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void Release(string key)
}
}

private class Locker : ILocker
private sealed class Locker : ILocker
{
private readonly RedisLock _lock;
private readonly string _key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ await HttpBackgroundJob.ExecuteAfterEndOfRequestAsync("lucene-index-rebuild", as
}
}

private class LuceneIndexRebuildStepModel
private sealed class LuceneIndexRebuildStepModel
{
public bool IncludeAll { get; set; } = false;
public string[] Indices { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ await HttpBackgroundJob.ExecuteAfterEndOfRequestAsync("lucene-index-reset", asyn
}
}

private class LuceneIndexResetStepModel
private sealed class LuceneIndexResetStepModel
{
public bool IncludeAll { get; set; } = false;
public string[] Indices { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public void Dispose()
}
}

internal class IndexWriterWrapper : IndexWriter
internal sealed class IndexWriterWrapper : IndexWriter
{
public IndexWriterWrapper(LDirectory directory, IndexWriterConfig config) : base(directory, config)
{
Expand All @@ -530,7 +530,7 @@ public IndexWriterWrapper(LDirectory directory, IndexWriterConfig config) : base
public bool IsClosing { get; set; }
}

internal class IndexReaderPool : IDisposable
internal sealed class IndexReaderPool : IDisposable
{
private bool _dirty;
private int _count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async ValueTask<string> EvaluateAsync(string identifier, Arguments argume
return result;
}

internal class Content : LiquidContentAccessor
internal sealed class Content : LiquidContentAccessor
{
public readonly string _content;
public Content(string content) => _content = content;
Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Taxonomies/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ await SchemaBuilder.AlterIndexTableAsync<TaxonomyIndex>(table => table
}
}

internal class AliasPartSettings
internal sealed class AliasPartSettings
{
public string Pattern { get; set; }
}

internal class AutoroutePartSettings
internal sealed class AutoroutePartSettings
{
public string Pattern { get; set; }
public bool AllowRouteContainedItems { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ namespace OrchardCore.Users.GraphQL;
/// <summary>
/// Registers the current user including its custom user settings as a query.
/// </summary>
internal class CurrentUserQuery : ISchemaBuilder
internal sealed class CurrentUserQuery : ISchemaBuilder
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IOptions<GraphQLContentOptions> _contentOptionsAccessor;
protected readonly IStringLocalizer S;
private readonly IStringLocalizer S;

public CurrentUserQuery(
IHttpContextAccessor httpContextAccessor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OrchardCore.Workflows.Http.Filters
{
internal class WorkflowActionFilter : IAsyncActionFilter
internal sealed class WorkflowActionFilter : IAsyncActionFilter
{
private readonly IWorkflowManager _workflowManager;
private readonly IWorkflowTypeRouteEntries _workflowTypeRouteEntries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OrchardCore.Workflows.Http.Handlers
{
internal class WorkflowRoutesHandler : WorkflowHandlerBase
internal sealed class WorkflowRoutesHandler : WorkflowHandlerBase
{
private readonly IWorkflowInstanceRouteEntries _workflowRouteEntries;
private readonly IWorkflowTypeStore _workflowTypeStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OrchardCore.Workflows.Http.Handlers
{
internal class WorkflowTypeRoutesHandler : WorkflowTypeHandlerBase
internal sealed class WorkflowTypeRoutesHandler : WorkflowTypeHandlerBase
{
private readonly IWorkflowTypeRouteEntries _workflowRouteEntries;
private readonly IActivityLibrary _activityLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OrchardCore.Workflows.Http.Services
{
internal class WorkflowInstanceRouteEntries : WorkflowRouteEntries<WorkflowRouteDocument>, IWorkflowInstanceRouteEntries
internal sealed class WorkflowInstanceRouteEntries : WorkflowRouteEntries<WorkflowRouteDocument>, IWorkflowInstanceRouteEntries
{
public WorkflowInstanceRouteEntries(IVolatileDocumentManager<WorkflowRouteDocument> documentManager) : base(documentManager) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OrchardCore.Workflows.Http.Services
{
internal class WorkflowTypeRouteEntries : WorkflowRouteEntries<WorkflowTypeRouteDocument>, IWorkflowTypeRouteEntries
internal sealed class WorkflowTypeRouteEntries : WorkflowRouteEntries<WorkflowTypeRouteDocument>, IWorkflowTypeRouteEntries
{
public WorkflowTypeRouteEntries(IVolatileDocumentManager<WorkflowTypeRouteDocument> documentManager) : base(documentManager) { }

Expand Down
Loading
Loading