Skip to content
Open
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions src/Client/ModrinthAPIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
35 changes: 0 additions & 35 deletions src/Client/Tags/License.php

This file was deleted.

28 changes: 0 additions & 28 deletions tests/Unit/Client/Tags/TagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand All @@ -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");
Expand Down Expand Up @@ -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"]);
}
}
Loading