generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
raw()
method to execute raw request to TMDB API (for non implem…
…ented methods)
- Loading branch information
1 parent
e3ec58d
commit 1f7fe9c
Showing
10 changed files
with
1,686 additions
and
10 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
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,30 @@ | ||
<?php | ||
|
||
namespace Kiwilan\Tmdb\Repositories; | ||
|
||
/** | ||
* Raw repository, used to send raw requests to the API. | ||
* | ||
* @docs https://developer.themoviedb.org/reference/intro/getting-started | ||
*/ | ||
class RawRepository extends Repository | ||
{ | ||
/** | ||
* Execute a request on the API, the API key will be associated with the request. | ||
* | ||
* @param string $url The URL to send the request, like `/movie/now_playing` | ||
* @param string[] $params The query parameters, like `['language' => 'en-US', 'page' => 1]` | ||
* | ||
* @docs https://developer.themoviedb.org/reference/intro/getting-started | ||
*/ | ||
public function url(string $url, ?array $params = null): ?RawRepository | ||
{ | ||
if (! $params) { | ||
$params = []; | ||
} | ||
|
||
$this->get($url, $params); | ||
|
||
return $this->isSuccess ? $this : null; | ||
} | ||
} |
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
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
Oops, something went wrong.