From 3172ba961a5b23d73654ea62f048549679677923 Mon Sep 17 00:00:00 2001 From: Bilge Date: Mon, 18 Mar 2024 23:50:34 +0000 Subject: [PATCH] Removed obsolete and unlinked "owners" rankings. --- src/Ranking/Impl/OwnersOldRanking.php | 30 --------------------------- src/Ranking/Impl/OwnersRanking.php | 30 --------------------------- src/Ranking/PageContainerFactory.php | 15 ++++---------- src/Ranking/RankingName.php | 5 ----- 4 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 src/Ranking/Impl/OwnersOldRanking.php delete mode 100644 src/Ranking/Impl/OwnersRanking.php diff --git a/src/Ranking/Impl/OwnersOldRanking.php b/src/Ranking/Impl/OwnersOldRanking.php deleted file mode 100644 index 27b76fe8220..00000000000 --- a/src/Ranking/Impl/OwnersOldRanking.php +++ /dev/null @@ -1,30 +0,0 @@ -setId('owners/old'); - $this->setTemplate('owners'); - $this->setAlgorithm(null); - } - - public function customizeQuery(QueryBuilder $builder): void - { - parent::customizeQuery($builder); - - $builder - ->andWhere('app.price > 0') - ->orderBy('app.owners', SortDirection::DESC) - ; - } -} diff --git a/src/Ranking/Impl/OwnersRanking.php b/src/Ranking/Impl/OwnersRanking.php deleted file mode 100644 index 55fe3511a8a..00000000000 --- a/src/Ranking/Impl/OwnersRanking.php +++ /dev/null @@ -1,30 +0,0 @@ -setId("owners/$year"); - $this->setTemplate('owners'); - $this->setAlgorithm(null); - } - - public function customizeQuery(QueryBuilder $builder): void - { - parent::customizeQuery($builder); - - $builder - ->andWhere('app.price > 0') - ->orderBy('owners', SortDirection::DESC) - ; - } -} diff --git a/src/Ranking/PageContainerFactory.php b/src/Ranking/PageContainerFactory.php index 7d33cc46602..4ee32d65539 100644 --- a/src/Ranking/PageContainerFactory.php +++ b/src/Ranking/PageContainerFactory.php @@ -9,7 +9,6 @@ use ScriptFUSION\Steam250\SiteGenerator\Page\StaticPageName; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\AnnualRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\EarlyAccessRanking; -use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\OwnersRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\ReviewsRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\TagRanking; use ScriptFUSION\Steam250\SiteGenerator\Tag\Tag; @@ -35,13 +34,6 @@ public function create(Container $parent): Container $container->set($ranking->getId(), $ranking); ++$counter; - // Owners data is no longer current, so only show historical rankings. - if ($year <= 2017) { - $ranking = new OwnersRanking($dependencies, $year); - $container->set($ranking->getId(), $ranking); - ++$counter; - } - $ranking = new ReviewsRanking($dependencies, $year); $container->set($ranking->getId(), $ranking); ++$counter; @@ -57,9 +49,10 @@ public function create(Container $parent): Container } // Replace Early Access tag using special-cased implementation. - $container->set(Tag::convertTagToId(EarlyAccessRanking::TAG), static function () use ($parent): Ranking { - return new EarlyAccessRanking($parent->get(RankingDependencies::class)); - }); + $container->set( + Tag::convertTagToId(EarlyAccessRanking::TAG), + fn () => new EarlyAccessRanking($parent->get(RankingDependencies::class)) + ); $container->set( 'home', diff --git a/src/Ranking/RankingName.php b/src/Ranking/RankingName.php index 772aefa895e..c858911fe7f 100644 --- a/src/Ranking/RankingName.php +++ b/src/Ranking/RankingName.php @@ -7,7 +7,6 @@ use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\AdultRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\Bottom100Ranking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\BuyersRemorseRanking; -use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\Club250Ranking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\CollageRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\DeveloperRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\DiscountRanking; @@ -18,7 +17,6 @@ use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\Mac250Ranking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\MostPlayedRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\OldRanking; -use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\OwnersOldRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\PublisherRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\ReviewsFullRanking; use ScriptFUSION\Steam250\SiteGenerator\Ranking\Impl\ReviewsOldRanking; @@ -53,7 +51,6 @@ final class RankingName extends AbstractEnumeration public const D_90 = 'D_90'; public const D_365 = 'D_365'; public const OLD = 'OLD'; - public const OLD_OWN = 'OLD_OWN'; public const REVIEW = 'REVIEW'; public const OLD_REVIEW = 'OLD_REVIEW'; public const MAC = 'MAC'; @@ -86,7 +83,6 @@ final class RankingName extends AbstractEnumeration self::D_90 => RollingQuarterRanking::class, self::D_365 => RollingYearRanking::class, self::OLD => OldRanking::class, - self::OLD_OWN => OwnersOldRanking::class, self::REVIEW => ReviewsFullRanking::class, self::OLD_REVIEW => ReviewsOldRanking::class, self::MAC => Mac250Ranking::class, @@ -120,7 +116,6 @@ final class RankingName extends AbstractEnumeration self::D_90 => '90d', self::D_365 => '365d', self::OLD => 'old', - self::OLD_OWN => 'oold', self::REVIEW => 'review', self::OLD_REVIEW => 'rold', self::MAC => 'mac',