Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/Client/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,4 @@ public function fetchProjects(): PaginatedAuthorProjectList
{
return $this->client->getAuthorProjects($this->getId());
}

/**
* Fetch the projects of this author from the API (paginated).
*
* This sends a request to the SpigotMC API every time it is called. The result is not cached.
*
* @deprecated Use {@see fetchProjects()} instead. Methods that send a request to the API are prefixed with "fetch".
* @return PaginatedAuthorProjectList
* @throws ApiException
*/
public function getProjects(): PaginatedAuthorProjectList
{
return $this->fetchProjects();
}
}
21 changes: 0 additions & 21 deletions src/Client/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,4 @@ public function fetchVersions(
{
return $this->client->getProjectVersions($this->getId(), $page, $order, $direction);
}

/**
* Fetch the versions of this project from the API (paginated).
*
* This sends a request to the SpigotMC API every time it is called. The result is not cached.
*
* @deprecated Use {@see fetchVersions()} instead. Methods that send a request to the API are prefixed with "fetch".
* @param int $page
* @param VersionOrder|null $order Field to order the results by. When null, the API default (id) is used.
* @param SortDirection|null $direction Direction to order the results by. When null, the API default (asc) is used.
* @return PaginatedVersionList
* @throws ApiException
*/
public function getVersions(
int $page = 1,
?VersionOrder $order = null,
?SortDirection $direction = null,
): PaginatedVersionList
{
return $this->fetchVersions($page, $order, $direction);
}
}
14 changes: 0 additions & 14 deletions src/Client/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,4 @@ public function fetchProject(): Project
{
return $this->client->getProject($this->getProjectId());
}

/**
* Fetch the project this version belongs to from the API.
*
* This sends a request to the SpigotMC API every time it is called. The result is not cached.
*
* @deprecated Use {@see fetchProject()} instead. Methods that send a request to the API are prefixed with "fetch".
* @return Project
* @throws ApiException
*/
public function getProject(): Project
{
return $this->fetchProject();
}
}
17 changes: 0 additions & 17 deletions tests/Unit/Client/AuthorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,4 @@ public function testFetchProjects(): void
$this->assertEquals($author->getId(), $project->getData()->getAuthor()->getId());
}
}

/**
* @throws ApiException
*/
public function testDeprecatedGetProjectsFetchesProjects(): void
{
$handler = new MockHandler([
new Response(200, [], file_get_contents(__DIR__ . "/Fixtures/getResourcesByAuthor.json")),
]);
$this->apiClient->setHttpClient(new Client(['handler' => HandlerStack::create($handler)]));
$author = new Author($this->apiClient, $this->getAuthorModel());

$projects = $author->getProjects();
$this->assertNotEmpty($projects);
$this->assertSame(0, $handler->count());
}

}
18 changes: 0 additions & 18 deletions tests/Unit/Client/ProjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,4 @@ public function testFetchVersions(): void
$this->assertEquals($project->getId(), $version->getProjectId());
}
}

/**
* @throws ApiException
*/
public function testDeprecatedGetVersionsFetchesVersions(): void
{
$handler = new MockHandler([
new Response(200, [], file_get_contents(__DIR__ . "/Fixtures/getResourceUpdates.json")),
]);
$this->apiClient->setHttpClient(new Client(['handler' => HandlerStack::create($handler)]));
$project = new Project($this->apiClient, $this->getResourceModel());

$versions = $project->getVersions();
$this->assertNotEmpty($versions);
$this->assertSame(0, $handler->count());
}


}
17 changes: 0 additions & 17 deletions tests/Unit/Client/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,4 @@ public function testFetchProject(): void
$this->assertEquals(57242, $project->getData()->getId());
$this->assertEquals("spark", $project->getData()->getTitle());
}

/**
* @throws ApiException
*/
public function testDeprecatedGetProjectFetchesProject(): void
{
$handler = new MockHandler([
new Response(200, [], file_get_contents(__DIR__ . "/Fixtures/getResource.json")),
]);
$this->apiClient->setHttpClient(new Client(['handler' => HandlerStack::create($handler)]));
$version = new Version($this->apiClient, $this->getResourceUpdateModel());

$project = $version->getProject();
$this->assertEquals(57242, $project->getId());
$this->assertSame(0, $handler->count());
}

}
Loading