From f7d202f31da8d2038629cc1b64865a4d5d66ec02 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Mon, 12 Oct 2026 18:48:39 +0200 Subject: [PATCH] remove license leftovers --- README.md | 4 +--- src/Client/ModrinthAPIClient.php | 2 -- src/Client/Tags/License.php | 35 ----------------------------- tests/Unit/Client/Tags/TagsTest.php | 28 ----------------------- 4 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 src/Client/Tags/License.php diff --git a/README.md b/README.md index f40abab..498a3a5 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ $teams = $modrinthClient->getTeams(["ThaUQrOs"]); ``` ## Tags -You can fetch all available categories, loaders, game versions and licenses from the API. +You can fetch all available categories, loaders and game versions from the API. Our library provides methods to search projects by these directly: ```php $categories = $modrinthClient->getCategories(); @@ -232,8 +232,6 @@ $loaders = $modrinthClient->getLoaders(); $loaders[0]->searchProjects(); $gameVersions = $modrinthClient->getGameVersions(); $gameVersions[0]->searchProjects(); -$licenses = $modrinthClient->getLicenses(); -$licenses[0]->searchProjects(); ``` You can also fetch donation platforms and report types: diff --git a/src/Client/ModrinthAPIClient.php b/src/Client/ModrinthAPIClient.php index 565d307..d6accb8 100644 --- a/src/Client/ModrinthAPIClient.php +++ b/src/Client/ModrinthAPIClient.php @@ -17,7 +17,6 @@ use Aternos\ModrinthApi\Client\Tags\Category; use Aternos\ModrinthApi\Client\Tags\DonationPlatform; use Aternos\ModrinthApi\Client\Tags\GameVersion; -use Aternos\ModrinthApi\Client\Tags\License; use Aternos\ModrinthApi\Client\Tags\Loader; use Aternos\ModrinthApi\Client\Tags\ProjectType; use Aternos\ModrinthApi\Client\Threads\Report; @@ -34,7 +33,6 @@ use Aternos\ModrinthApi\Model\GetLatestVersionsFromHashesBody; use Aternos\ModrinthApi\Model\HashList; use Aternos\ModrinthApi\Model\InvalidInputError; -use Aternos\ModrinthApi\Model\LicenseTag; use Aternos\ModrinthApi\Model\LoaderTag; use Aternos\ModrinthApi\Model\ModifyReportRequest; use Aternos\ModrinthApi\Model\Notification as NotificationModel; diff --git a/src/Client/Tags/License.php b/src/Client/Tags/License.php deleted file mode 100644 index e8a3119..0000000 --- a/src/Client/Tags/License.php +++ /dev/null @@ -1,35 +0,0 @@ -container); - } - - /** - * Convert this loader to a facet to use it in a search - * @return Facet - */ - public function toFacet(): Facet - { - return new Facet(FacetType::LICENSE, $this->getShort()); - } - - function getClient(): ModrinthAPIClient - { - return $this->client; - } -} diff --git a/tests/Unit/Client/Tags/TagsTest.php b/tests/Unit/Client/Tags/TagsTest.php index d88c6e6..0b5dbaa 100644 --- a/tests/Unit/Client/Tags/TagsTest.php +++ b/tests/Unit/Client/Tags/TagsTest.php @@ -12,13 +12,11 @@ use Aternos\ModrinthApi\Client\Tags\Category; use Aternos\ModrinthApi\Client\Tags\DonationPlatform; use Aternos\ModrinthApi\Client\Tags\GameVersion; -use Aternos\ModrinthApi\Client\Tags\License; use Aternos\ModrinthApi\Client\Tags\Loader; use Aternos\ModrinthApi\Client\Tags\ProjectType; use Aternos\ModrinthApi\Model\CategoryTag; use Aternos\ModrinthApi\Model\DonationPlatformTag; use Aternos\ModrinthApi\Model\GameVersionTag; -use Aternos\ModrinthApi\Model\LicenseTag; use Aternos\ModrinthApi\Model\LoaderTag; use Aternos\ModrinthApi\Tests\Unit\Client\ClientTestCase; @@ -66,14 +64,6 @@ protected function gameVersion(ModrinthAPIClient $client): GameVersion ])); } - protected function license(ModrinthAPIClient $client): License - { - return new License($client, new LicenseTag([ - "short" => "MIT", - "name" => "MIT License", - ])); - } - public function testCategoryToFacet(): void { $facet = $this->category($this->createClient())->toFacet(); @@ -100,14 +90,6 @@ public function testGameVersionToFacet(): void $this->assertEquals("1.20.1", $facet->getValue()); } - public function testLicenseToFacet(): void - { - $facet = $this->license($this->createClient())->toFacet(); - - $this->assertEquals(FacetType::LICENSE, $facet->getType()); - $this->assertEquals("MIT", $facet->getValue()); - } - public function testProjectTypeGetNameAndToFacet(): void { $projectType = new ProjectType($this->createClient(), "modpack"); @@ -174,14 +156,4 @@ public function testProjectTypeSearchProjects(): void parse_str($this->getRequest()->getUri()->getQuery(), $query); $this->assertEquals('[["project_type = shader"]]', $query["facets"]); } - - public function testLicenseSearchProjects(): void - { - $client = $this->createClient([$this->emptySearchResponse()]); - - $this->license($client)->searchProjects(); - - parse_str($this->getRequest()->getUri()->getQuery(), $query); - $this->assertEquals('[["license = MIT"]]', $query["facets"]); - } }