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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seal internal types #677

Merged
merged 3 commits into from
Apr 26, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal struct DatabaseEntry
public string? Timestamp { get; set; }
}

internal class Database
internal sealed class Database
{
private const string TableName = "SKMemoryTable";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.SemanticKernel.Connectors.WebApi.Rest.Model;
/// <summary>
/// The REST API operation.
/// </summary>
internal class RestApiOperation
internal sealed class RestApiOperation
{
/// <summary>
/// An artificial parameter that is added to be able to override RESP API operation server url.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.SemanticKernel.Connectors.WebApi.Rest.Model;
/// <summary>
/// The REST API operation parameter.
/// </summary>
internal class RestApiOperationParameter
internal sealed class RestApiOperationParameter
{
/// <summary>
/// The parameter name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.SemanticKernel.Connectors.WebApi.Rest.Model;
/// <summary>
/// The REST API operation payload property.
/// </summary>
internal class RestApiOperationPayloadProperty
internal sealed class RestApiOperationPayloadProperty
{
/// <summary>
/// The property name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.SemanticKernel.Connectors.WebApi.Rest;
/// <summary>
/// Runs REST API operation represented by RestApiOperation model class.
/// </summary>
internal class RestApiOperationRunner : IRestApiOperationRunner
internal sealed class RestApiOperationRunner : IRestApiOperationRunner
{
private const string MediaTypeApplicationJson = "application/json";
private const string MediaTypeTextPlain = "text/plain";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ internal interface IDelayProvider
Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken);
}

internal class TaskDelayProvider : IDelayProvider
internal sealed class TaskDelayProvider : IDelayProvider
{
public Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)
{
Expand All @@ -152,7 +152,7 @@ internal interface ITimeProvider
DateTimeOffset GetCurrentTime();
}

internal class DefaultTimeProvider : ITimeProvider
internal sealed class DefaultTimeProvider : ITimeProvider
{
public DateTimeOffset GetCurrentTime()
{
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/SemanticKernel/CoreSkills/WaitSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface IWaitProvider
Task DelayAsync(int milliSeconds);
}

private class WaitProvider : IWaitProvider
private sealed class WaitProvider : IWaitProvider
{
public Task DelayAsync(int milliSeconds)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.SemanticKernel.SkillDefinition;
/// <summary>
/// Access the collection in read-only mode, e.g. allow templates to search and execute functions.
/// </summary>
internal class ReadOnlySkillCollection : IReadOnlySkillCollection
internal sealed class ReadOnlySkillCollection : IReadOnlySkillCollection
{
private readonly ISkillCollection _skillCollection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.SemanticKernel.TemplateEngine.Blocks;

#pragma warning disable CA2254 // error strings are used also internally, not just for logging
// ReSharper disable TemplateIsNotCompileTimeConstantProblem
internal class CodeBlock : Block, ICodeRendering
internal sealed class CodeBlock : Block, ICodeRendering
{
internal override BlockTypes Type => BlockTypes.Code;

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

namespace Microsoft.SemanticKernel.TemplateEngine.Blocks;

internal class FunctionIdBlock : Block, ITextRendering
internal sealed class FunctionIdBlock : Block, ITextRendering
{
internal override BlockTypes Type => BlockTypes.FunctionId;

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

namespace Microsoft.SemanticKernel.TemplateEngine.Blocks;

internal class TextBlock : Block, ITextRendering
internal sealed class TextBlock : Block, ITextRendering
{
internal override BlockTypes Type => BlockTypes.Text;

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

namespace Microsoft.SemanticKernel.TemplateEngine.Blocks;

internal class ValBlock : Block, ITextRendering
internal sealed class ValBlock : Block, ITextRendering
{
internal override BlockTypes Type => BlockTypes.Value;

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

namespace Microsoft.SemanticKernel.TemplateEngine.Blocks;

internal class VarBlock : Block, ITextRendering
internal sealed class VarBlock : Block, ITextRendering
{
internal override BlockTypes Type => BlockTypes.Variable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Microsoft.SemanticKernel.TemplateEngine;
/// [letter] ::= "a" | "b" ... | "z" | "A" | "B" ... | "Z"
/// [digit] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
/// </summary>
internal class CodeTokenizer
internal sealed class CodeTokenizer
{
private enum TokenTypes
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Microsoft.SemanticKernel.TemplateEngine;
/// [letter] ::= "a" | "b" ... | "z" | "A" | "B" ... | "Z"
/// [digit] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
/// </summary>
internal class TemplateTokenizer
internal sealed class TemplateTokenizer
{
/// <summary>
/// Create a new instance of SK tokenizer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.SemanticKernel.Skills.OpenAPI.OpenApi;
/// <summary>
/// Parser for OpenAPI documents.
/// </summary>
internal class OpenApiDocumentParser : IOpenApiDocumentParser
internal sealed class OpenApiDocumentParser : IOpenApiDocumentParser
{
/// <inheritdoc/>
public async Task<IList<RestApiOperation>> ParseAsync(Stream stream, CancellationToken cancellationToken = default)
Expand Down