-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
david_smith
committed
Dec 30, 2024
1 parent
72a4528
commit 035a369
Showing
2 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
|
||
namespace Zerotoprod\OmdbApi; | ||
|
||
/** | ||
* A wrapper for https://www.omdbapi.com/ | ||
*/ | ||
interface OmdbApiInterface | ||
{ | ||
/** | ||
* Returns the Poster Image. | ||
* | ||
* @link https://www.omdbapi.com/ | ||
*/ | ||
public function poster(string $imdbID): string; | ||
|
||
/** | ||
* Retrieve detailed information about a specific movie, TV series, or episode by either its IMDb ID or title. | ||
* | ||
* @param string|null $title *Optional. Production title to search for (e.g. 'Avatar'). *Either `$t` or `$i` must be specified. | ||
* @param string|null $imdbID *Optional. A valid IMDb ID (e.g. 'tt1285016'). *Either `$t` or `$i` must be specified. | ||
* @param string|null $type Optional. Type of result to return (movie, series, episode) | ||
* @param int|null $year Optional. Year of release. | ||
* @param bool $full_plot Optional. Return short or full plot. | ||
* @param mixed|null $callback Optional. JSONP callback name. | ||
* @param string|null $version Optional. API version (reserved for future use). | ||
* @param array|null $CURLOPT cURL options. | ||
* | ||
* @return array{ | ||
* Title: string, | ||
* Year: string, | ||
* Rated: string, | ||
* Released: string, | ||
* Runtime: string, | ||
* Genre: string, | ||
* Director: string, | ||
* Writer: string, | ||
* Actors: string, | ||
* Plot: string, | ||
* Language: string, | ||
* Country: string, | ||
* Awards: string, | ||
* Poster: string, | ||
* Ratings?: array<array{ Source: string, Value: string}>, | ||
* Metascore: int, | ||
* imdbRating: float, | ||
* imdbVotes: string, | ||
* imdbID: string, | ||
* Type: string, | ||
* DVD: string, | ||
* BoxOffice: string, | ||
* Production: string, | ||
* Website: string, | ||
* Response: bool | ||
* }|array{ | ||
* ErrorType: string, | ||
* message: string, | ||
* extra?: mixed | ||
* } | ||
* | ||
* | ||
* @link https://www.omdbapi.com/ | ||
*/ | ||
public function byIdOrTitle( | ||
?string $title = null, | ||
?string $imdbID = null, | ||
?string $type = null, | ||
?int $year = null, | ||
?bool $full_plot = false, | ||
mixed $callback = null, | ||
?string $version = null, | ||
?array $CURLOPT = [CURLOPT_TIMEOUT => 10] | ||
): array; | ||
|
||
/** | ||
* Search for multiple titles using a keyword. | ||
* | ||
* @param string $title Required. Production title to search for (e.g. 'Avatar'). | ||
* @param string|null $type Optional. Type of result to return (movie, series, episode) | ||
* @param int|null $year Optional. Year of release. | ||
* @param int|null $page Optional. Search page number. | ||
* @param mixed|null $callback Optional. JSONP callback name. | ||
* @param string|null $version Optional. API version (reserved for future use). | ||
* @param array|null $CURLOPT cURL options. | ||
* | ||
* @return array{ | ||
* Search: array<array{ | ||
* Title: string, | ||
* Year: string, | ||
* imdbID: string, | ||
* Type: string, | ||
* Poster: string | ||
* }>, | ||
* totalResults: int, | ||
* Response: bool | ||
* }|array{ | ||
* ErrorType: string, | ||
* message: string, | ||
* extra?: mixed | ||
* } | ||
* | ||
* @link https://www.omdbapi.com/ | ||
*/ | ||
public function search( | ||
string $title, | ||
?string $type = null, | ||
?int $year = null, | ||
?int $page = 1, | ||
mixed $callback = null, | ||
?string $version = null, | ||
?array $CURLOPT = [CURLOPT_TIMEOUT => 10] | ||
): array; | ||
} |