2023-09-26 06:24:03 +00:00
|
|
|
/**
|
|
|
|
* Get the books in a translation
|
|
|
|
*
|
|
|
|
* @param string $translation The translation.
|
|
|
|
*
|
|
|
|
* @return object|null The response object or null if an error occurs.
|
|
|
|
* @since 2.0.1
|
|
|
|
*/
|
|
|
|
public function get(string $translation = 'kjv'): ?object
|
|
|
|
{
|
|
|
|
return $this->response->get(
|
|
|
|
$this->http->get(
|
|
|
|
$this->uri->get($translation . '.json')
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List the books in a translation
|
|
|
|
*
|
|
|
|
* @param string $translation The translation.
|
|
|
|
*
|
|
|
|
* @return object|null The response object or null if an error occurs.
|
|
|
|
* @since 2.0.1
|
|
|
|
*/
|
|
|
|
public function list(string $translation = 'kjv'): ?object
|
|
|
|
{
|
|
|
|
return $this->response->get(
|
|
|
|
$this->http->get(
|
|
|
|
$this->uri->get($translation . '/books.json')
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List the books checksums in a translation
|
|
|
|
*
|
|
|
|
* @param string $translation The translation.
|
|
|
|
*
|
|
|
|
* @return object|null The response object or null if an error occurs.
|
|
|
|
* @since 2.0.1
|
|
|
|
*/
|
|
|
|
public function checksum(string $translation = 'kjv'): ?object
|
|
|
|
{
|
|
|
|
return $this->response->get(
|
|
|
|
$this->http->get(
|
|
|
|
$this->uri->get($translation . '/checksum.json')
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the book's checksums in a translation
|
|
|
|
*
|
|
|
|
* @param string $translation The translation.
|
|
|
|
* @param int $book The book number.
|
|
|
|
*
|
|
|
|
* @return string|null The response checksums or null if an error occurs.
|
|
|
|
* @since 2.0.1
|
|
|
|
*/
|
|
|
|
public function sha(string $translation, int $book): ?string
|
|
|
|
{
|
|
|
|
return trim(
|
|
|
|
$this->response->get(
|
|
|
|
$this->http->get(
|
|
|
|
$this->uri->get($translation . '/' . $book . '.sha')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|