Remove useless extension classes

This commit is contained in:
jvyden 2022-05-15 00:27:03 -04:00
parent 330c01317d
commit ce5e327011
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
9 changed files with 4 additions and 40 deletions

View file

@ -1,20 +0,0 @@
using System;
namespace LBPUnion.ProjectLighthouse.Extensions;
internal static class ConsoleColorExtensions
{
internal static ConsoleColor ToDark(this ConsoleColor color)
=> color switch
{
ConsoleColor.Blue => ConsoleColor.DarkBlue,
ConsoleColor.Cyan => ConsoleColor.DarkCyan,
ConsoleColor.Green => ConsoleColor.DarkGreen,
ConsoleColor.Gray => ConsoleColor.DarkGray,
ConsoleColor.Magenta => ConsoleColor.DarkMagenta,
ConsoleColor.Red => ConsoleColor.DarkRed,
ConsoleColor.White => ConsoleColor.Gray,
ConsoleColor.Yellow => ConsoleColor.DarkYellow,
_ => color,
};
}

View file

@ -15,10 +15,11 @@ namespace LBPUnion.ProjectLighthouse.Extensions;
public static class RequestExtensions public static class RequestExtensions
{ {
// yoinked and adapted from https://stackoverflow.com/a/68641796
#region Mobile Checking #region Mobile Checking
// yoinked and adapted from https://stackoverflow.com/a/68641796
private static readonly Regex mobileCheck = new private static readonly Regex mobileCheck = new
( (
"Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|PlayStation Vita", "Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|PlayStation Vita",

View file

@ -1,9 +0,0 @@
using System.IO;
using System.Linq;
namespace LBPUnion.ProjectLighthouse.Extensions;
public static class StringExtensions
{
public static string ToFileName(this string text) => Path.GetInvalidFileNameChars().Aggregate(text, (current, c) => current.Replace(c.ToString(), ""));
}

View file

@ -1,6 +1,5 @@
#nullable enable #nullable enable
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types;
@ -8,7 +7,6 @@ using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands;
[UsedImplicitly]
public class CreateUserCommand : ICommand public class CreateUserCommand : ICommand
{ {
private readonly Database _database = new(); private readonly Database _database = new();

View file

@ -1,13 +1,11 @@
#nullable enable #nullable enable
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands;
[UsedImplicitly]
public class DeleteUserCommand : ICommand public class DeleteUserCommand : ICommand
{ {
private readonly Database database = new(); private readonly Database database = new();

View file

@ -1,13 +1,11 @@
#nullable enable #nullable enable
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands;
[UsedImplicitly]
public class MakeUserAdminCommand : ICommand public class MakeUserAdminCommand : ICommand
{ {
private readonly Database database = new(); private readonly Database database = new();

View file

@ -1,14 +1,12 @@
#nullable enable #nullable enable
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types; using LBPUnion.ProjectLighthouse.Types;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands;
[UsedImplicitly]
public class ResetPasswordCommand : ICommand public class ResetPasswordCommand : ICommand
{ {
private readonly Database database = new(); private readonly Database database = new();

View file

@ -1,10 +1,8 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.Helpers;
namespace LBPUnion.ProjectLighthouse.Maintenance.Commands; namespace LBPUnion.ProjectLighthouse.Maintenance.Commands;
[UsedImplicitly]
public class TestWebhookCommand : ICommand public class TestWebhookCommand : ICommand
{ {
public async Task Run(string[] args) public async Task Run(string[] args)

View file

@ -1,7 +1,9 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using JetBrains.Annotations;
namespace LBPUnion.ProjectLighthouse.Maintenance; namespace LBPUnion.ProjectLighthouse.Maintenance;
[UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)]
public interface ICommand public interface ICommand
{ {