diff --git a/.gitignore b/.gitignore
index b0e719e9..1a5e850a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,9 @@
/bin
/docs
+/build/*
+!/build/phpunit.xml
+!/build/phpmd.xml
+!/build/phpdox.xml
/vendor/
/composer.lock
/*.php
@@ -7,3 +11,4 @@
/apikey.php
/phpunit
/public_html
+/cache.properties
diff --git a/build.xml b/build.xml
new file mode 100644
index 00000000..3942b6ff
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/phpdox.xml b/build/phpdox.xml
new file mode 100644
index 00000000..a86602dc
--- /dev/null
+++ b/build/phpdox.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/phpmd.xml b/build/phpmd.xml
new file mode 100644
index 00000000..865291ae
--- /dev/null
+++ b/build/phpmd.xml
@@ -0,0 +1,13 @@
+
+
+
+ Custom ruleset.
+
+
+
+
+
+
+
+
diff --git a/build/phpunit.xml b/build/phpunit.xml
new file mode 100644
index 00000000..a33344bf
--- /dev/null
+++ b/build/phpunit.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ ../test/Tmdb/
+
+
+
+
+
+ functional
+
+
+
+
+
+ ../lib/Tmdb/
+
+
+
+
+
+
+
+
diff --git a/composer.json b/composer.json
index 91c276e2..ff3b1a87 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,11 @@
"guzzle/guzzle": ">=0.7"
},
"require-dev": {
- "phpunit/phpunit": ">=3.7"
+ "phpunit/phpunit": ">=3.7",
+ "doctrine/cache": ">=1.3.0"
+ },
+ "suggest": {
+ "doctrine/cache": "This library is required if you want to make use of caching features."
},
"autoload": {
"psr-0": { "Tmdb\\": "lib/" }
diff --git a/examples/account/api/account.php b/examples/account/api/account.php
index fe1fd5a8..e0170eca 100644
--- a/examples/account/api/account.php
+++ b/examples/account/api/account.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$account = $client->getAccountApi()->getAccount();
-var_dump($account);
\ No newline at end of file
+var_dump($account);
diff --git a/examples/account/api/favorite.php b/examples/account/api/favorite.php
index ad3219bb..7f34319c 100644
--- a/examples/account/api/favorite.php
+++ b/examples/account/api/favorite.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$favorite = $client->getAccountApi()->favorite(TMDB_ACCOUNT_ID, 97020, true);
-var_dump($favorite);
\ No newline at end of file
+var_dump($favorite);
diff --git a/examples/account/api/favorite_movies.php b/examples/account/api/favorite_movies.php
index 6b38f291..c6dd5397 100644
--- a/examples/account/api/favorite_movies.php
+++ b/examples/account/api/favorite_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$favorite_movies = $client->getAccountApi()->getFavoriteMovies(TMDB_ACCOUNT_ID);
-var_dump($favorite_movies);
\ No newline at end of file
+var_dump($favorite_movies);
diff --git a/examples/account/api/lists.php b/examples/account/api/lists.php
index 318fcbcf..0fe404b5 100644
--- a/examples/account/api/lists.php
+++ b/examples/account/api/lists.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$lists = $client->getAccountApi()->getLists(TMDB_ACCOUNT_ID);
-var_dump($lists);
\ No newline at end of file
+var_dump($lists);
diff --git a/examples/account/api/rated_movies.php b/examples/account/api/rated_movies.php
index 6c33811b..d51efa36 100644
--- a/examples/account/api/rated_movies.php
+++ b/examples/account/api/rated_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$rated_movies = $client->getAccountApi()->getRatedMovies(TMDB_ACCOUNT_ID);
-var_dump($rated_movies);
\ No newline at end of file
+var_dump($rated_movies);
diff --git a/examples/account/api/watchlist.php b/examples/account/api/watchlist.php
index aa7da6b8..03dca924 100644
--- a/examples/account/api/watchlist.php
+++ b/examples/account/api/watchlist.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$watchlist = $client->getAccountApi()->watchlist(TMDB_ACCOUNT_ID, 97020, true);
-var_dump($watchlist);
\ No newline at end of file
+var_dump($watchlist);
diff --git a/examples/account/api/watchlist_movies.php b/examples/account/api/watchlist_movies.php
index d4ec787c..6e4b6a0d 100644
--- a/examples/account/api/watchlist_movies.php
+++ b/examples/account/api/watchlist_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$watchlist_movies = $client->getAccountApi()->getMovieWatchlist(TMDB_ACCOUNT_ID);
-var_dump($watchlist_movies);
\ No newline at end of file
+var_dump($watchlist_movies);
diff --git a/examples/account/model/account.php b/examples/account/model/account.php
index aa109d22..f7415cf3 100644
--- a/examples/account/model/account.php
+++ b/examples/account/model/account.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,3 @@
$account = $accountRepository->getAccount();
var_dump($account);
-
diff --git a/examples/account/model/favorite.php b/examples/account/model/favorite.php
index 4d195cb4..075c9121 100644
--- a/examples/account/model/favorite.php
+++ b/examples/account/model/favorite.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->favorite(TMDB_ACCOUNT_ID, 150);
var_dump($lists);
-
diff --git a/examples/account/model/favorite_movies.php b/examples/account/model/favorite_movies.php
index 77b4d28c..87b8bf0d 100644
--- a/examples/account/model/favorite_movies.php
+++ b/examples/account/model/favorite_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->getFavoriteMovies(TMDB_ACCOUNT_ID);
var_dump($lists);
-
diff --git a/examples/account/model/lists.php b/examples/account/model/lists.php
index 6f8f6ca1..31a3aae3 100644
--- a/examples/account/model/lists.php
+++ b/examples/account/model/lists.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->getLists(TMDB_ACCOUNT_ID);
var_dump($lists);
-
diff --git a/examples/account/model/movie_watchlist.php b/examples/account/model/movie_watchlist.php
index 18542f82..a79fdc67 100644
--- a/examples/account/model/movie_watchlist.php
+++ b/examples/account/model/movie_watchlist.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->getMovieWatchlist(TMDB_ACCOUNT_ID);
var_dump($lists);
-
diff --git a/examples/account/model/rated_movies.php b/examples/account/model/rated_movies.php
index a1e0f957..272cacbf 100644
--- a/examples/account/model/rated_movies.php
+++ b/examples/account/model/rated_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->getRatedMovies(TMDB_ACCOUNT_ID);
var_dump($lists);
-
diff --git a/examples/account/model/watchlist.php b/examples/account/model/watchlist.php
index 00de319e..879caa6d 100644
--- a/examples/account/model/watchlist.php
+++ b/examples/account/model/watchlist.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -26,4 +26,3 @@
$lists = $accountRepository->watchlist(TMDB_ACCOUNT_ID, 49047);
var_dump($lists);
-
diff --git a/examples/authentication/api/authenticate-token.php b/examples/authentication/api/authenticate-token.php
index 6e37987d..c0bd1853 100644
--- a/examples/authentication/api/authenticate-token.php
+++ b/examples/authentication/api/authenticate-token.php
@@ -10,12 +10,12 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$requestToken = new \Tmdb\RequestToken(TMDB_REQUEST_TOKEN);
-$client->getAuthenticationApi()->authenticateRequestToken($requestToken->getToken());
\ No newline at end of file
+$client->getAuthenticationApi()->authenticateRequestToken($requestToken->getToken());
diff --git a/examples/authentication/api/get-guest-session.php b/examples/authentication/api/get-guest-session.php
index 8712ffb5..1e88bcc4 100644
--- a/examples/authentication/api/get-guest-session.php
+++ b/examples/authentication/api/get-guest-session.php
@@ -10,12 +10,12 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$sessionToken = $client->getAuthenticationApi()->getNewGuestSession();
-var_dump($sessionToken);
\ No newline at end of file
+var_dump($sessionToken);
diff --git a/examples/authentication/api/get-session.php b/examples/authentication/api/get-session.php
index 534ab100..d3a23626 100644
--- a/examples/authentication/api/get-session.php
+++ b/examples/authentication/api/get-session.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -20,4 +20,4 @@
$sessionToken = $client->getAuthenticationApi()->getNewSession($requestToken->getToken());
-var_dump($sessionToken);
\ No newline at end of file
+var_dump($sessionToken);
diff --git a/examples/authentication/api/get-token.php b/examples/authentication/api/get-token.php
index 5f9ec2fe..6d9a8065 100644
--- a/examples/authentication/api/get-token.php
+++ b/examples/authentication/api/get-token.php
@@ -10,12 +10,12 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$requestToken = $client->getAuthenticationApi()->getNewToken();
-var_dump($requestToken);
\ No newline at end of file
+var_dump($requestToken);
diff --git a/examples/authentication/model/authenticate_request_token.php b/examples/authentication/model/authenticate_request_token.php
index 16b1e29d..de971160 100644
--- a/examples/authentication/model/authenticate_request_token.php
+++ b/examples/authentication/model/authenticate_request_token.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
diff --git a/examples/authentication/model/guest_session_token.php b/examples/authentication/model/guest_session_token.php
index 33e4ecf5..05074cc4 100644
--- a/examples/authentication/model/guest_session_token.php
+++ b/examples/authentication/model/guest_session_token.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
diff --git a/examples/authentication/model/request_token.php b/examples/authentication/model/request_token.php
index 6685084f..ff706eec 100644
--- a/examples/authentication/model/request_token.php
+++ b/examples/authentication/model/request_token.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -20,4 +20,3 @@
$requestToken = $authenticationRepository->getRequestToken();
var_dump($requestToken);
-
diff --git a/examples/authentication/model/session_token.php b/examples/authentication/model/session_token.php
index 00e28599..8a68dbdb 100644
--- a/examples/authentication/model/session_token.php
+++ b/examples/authentication/model/session_token.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,3 @@
$sessionToken = $authenticationRepository->getSessionToken($requestToken);
var_dump($sessionToken);
-
diff --git a/examples/certifications/api/get.php b/examples/certifications/api/get.php
index 96d01c0e..6990759e 100644
--- a/examples/certifications/api/get.php
+++ b/examples/certifications/api/get.php
@@ -10,12 +10,12 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$credit = $client->getCertificationsApi()->getMovieList();
-var_dump($credit);
\ No newline at end of file
+var_dump($credit);
diff --git a/examples/certifications/model/get.php b/examples/certifications/model/get.php
index 83231228..ec98645b 100644
--- a/examples/certifications/model/get.php
+++ b/examples/certifications/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -20,4 +20,3 @@
$certificationList = $certificationRepository->getMovieList();
var_dump($certificationList);
-
diff --git a/examples/changes/model/movies.php b/examples/changes/model/movies.php
index 973794c0..309aea34 100644
--- a/examples/changes/model/movies.php
+++ b/examples/changes/model/movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -31,4 +31,3 @@
$response = $repository->getMovieChanges($query);
var_dump($response);
-
diff --git a/examples/changes/model/people.php b/examples/changes/model/people.php
index 21bf229c..f6a90c17 100644
--- a/examples/changes/model/people.php
+++ b/examples/changes/model/people.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -31,4 +31,3 @@
$response = $repository->getPeopleChanges($query);
var_dump($response);
-
diff --git a/examples/collection/model/all.php b/examples/collection/model/all.php
index 1f8c844c..210740fd 100644
--- a/examples/collection/model/all.php
+++ b/examples/collection/model/all.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\CollectionRepository($client);
$collection = $repository->load(10);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/collection/model/images.php b/examples/collection/model/images.php
index 1f8c844c..210740fd 100644
--- a/examples/collection/model/images.php
+++ b/examples/collection/model/images.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\CollectionRepository($client);
$collection = $repository->load(10);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/companies/model/get.php b/examples/companies/model/get.php
index 07f11c85..e542c2ae 100644
--- a/examples/companies/model/get.php
+++ b/examples/companies/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\CompanyRepository($client);
$company = $repository->load(1);
-var_dump($company);
\ No newline at end of file
+var_dump($company);
diff --git a/examples/configuration/model/get.php b/examples/configuration/model/get.php
index 410e076f..98009355 100644
--- a/examples/configuration/model/get.php
+++ b/examples/configuration/model/get.php
@@ -12,8 +12,8 @@
*/
header('Content-Type: text/html; charset=utf-8');
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$configRepository = new \Tmdb\Repository\ConfigurationRepository($client);
$config = $configRepository->load();
-var_dump($config);
\ No newline at end of file
+var_dump($config);
diff --git a/examples/credits/api/get.php b/examples/credits/api/get.php
index f1dd4ede..a84e445d 100644
--- a/examples/credits/api/get.php
+++ b/examples/credits/api/get.php
@@ -10,12 +10,12 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$credit = $client->getCreditsApi()->getCredit('52542282760ee313280017f9');
-var_dump($credit);
\ No newline at end of file
+var_dump($credit);
diff --git a/examples/credits/model/get.php b/examples/credits/model/get.php
index 31b26985..f1a1ddfc 100644
--- a/examples/credits/model/get.php
+++ b/examples/credits/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\CreditsRepository($client);
$credits = $repository->load('52542282760ee313280017f9');
-var_dump($credits);
\ No newline at end of file
+var_dump($credits);
diff --git a/examples/discover/model/movies.php b/examples/discover/model/movies.php
index b792b3cf..97a21179 100644
--- a/examples/discover/model/movies.php
+++ b/examples/discover/model/movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -27,4 +27,3 @@
$response = $repository->discoverMovies($query);
var_dump($response);
-
diff --git a/examples/discover/model/tv.php b/examples/discover/model/tv.php
index 78b7ec80..0942e10a 100644
--- a/examples/discover/model/tv.php
+++ b/examples/discover/model/tv.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -27,4 +27,3 @@
$response = $repository->discoverTv($query);
var_dump($response);
-
diff --git a/examples/find/model/get.php b/examples/find/model/get.php
index 8cb8acb6..6ab5e09b 100644
--- a/examples/find/model/get.php
+++ b/examples/find/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\FindRepository($client);
$find = $repository->find('tt0120737', array('external_source' => 'imdb_id'));
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/genres/model/all.php b/examples/genres/model/all.php
index b4746bc6..1378e308 100644
--- a/examples/genres/model/all.php
+++ b/examples/genres/model/all.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,6 +19,6 @@
$repository = new \Tmdb\Repository\GenreRepository($client);
$genres = $repository->loadCollection();
-foreach($genres as $genre) {
+foreach ($genres as $genre) {
var_dump($genre);
-}
\ No newline at end of file
+}
diff --git a/examples/genres/model/get.php b/examples/genres/model/get.php
index 0a9e0bea..212f7471 100644
--- a/examples/genres/model/get.php
+++ b/examples/genres/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\GenreRepository($client);
$genre = $repository->load(28);
-var_dump($genre);
\ No newline at end of file
+var_dump($genre);
diff --git a/examples/genres/model/movies.php b/examples/genres/model/movies.php
index ef77531b..03eb1915 100644
--- a/examples/genres/model/movies.php
+++ b/examples/genres/model/movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\GenreRepository($client);
$genre = $repository->getMovies(18);
-var_dump($genre);
\ No newline at end of file
+var_dump($genre);
diff --git a/examples/jobs/model/all.php b/examples/jobs/model/all.php
index 75f39a8b..a4fa258f 100644
--- a/examples/jobs/model/all.php
+++ b/examples/jobs/model/all.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,6 +19,6 @@
$repository = new \Tmdb\Repository\JobsRepository($client);
$jobs = $repository->loadCollection();
-foreach($jobs as $job) {
+foreach ($jobs as $job) {
var_dump($job);
-}
\ No newline at end of file
+}
diff --git a/examples/keywords/model/get.php b/examples/keywords/model/get.php
index 2f9dd9b6..8babf524 100644
--- a/examples/keywords/model/get.php
+++ b/examples/keywords/model/get.php
@@ -10,14 +10,13 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
-
$repository = new \Tmdb\Repository\KeywordRepository($client);
$keyword = $repository->load(1721);
-var_dump($keyword);
\ No newline at end of file
+var_dump($keyword);
diff --git a/examples/keywords/model/movies.php b/examples/keywords/model/movies.php
index 7630afce..556c6c23 100644
--- a/examples/keywords/model/movies.php
+++ b/examples/keywords/model/movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\KeywordRepository($client);
$movies = $repository->getMovies(1721);
-var_dump($movies);
\ No newline at end of file
+var_dump($movies);
diff --git a/examples/lists/api/add.php b/examples/lists/api/add.php
index 99da6017..a65935e6 100644
--- a/examples/lists/api/add.php
+++ b/examples/lists/api/add.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$add = $client->getListsApi()->addMediaToList(TMDB_LIST_ID, 49047);
-var_dump($add);
\ No newline at end of file
+var_dump($add);
diff --git a/examples/lists/api/item_status.php b/examples/lists/api/item_status.php
index 947af66e..691fb44f 100644
--- a/examples/lists/api/item_status.php
+++ b/examples/lists/api/item_status.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$remove = $client->getListsApi()->getItemStatus(TMDB_LIST_ID, 49047);
-var_dump($remove);
\ No newline at end of file
+var_dump($remove);
diff --git a/examples/lists/api/list_create.php b/examples/lists/api/list_create.php
index fb09fbed..5c2f1cee 100644
--- a/examples/lists/api/list_create.php
+++ b/examples/lists/api/list_create.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$create = $client->getListsApi()->createList('test', 'test description');
-var_dump($create);
\ No newline at end of file
+var_dump($create);
diff --git a/examples/lists/api/list_delete.php b/examples/lists/api/list_delete.php
index 7e658876..1671caf8 100644
--- a/examples/lists/api/list_delete.php
+++ b/examples/lists/api/list_delete.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$create = $client->getListsApi()->deleteList(TMDB_LIST_ID);
-var_dump($create);
\ No newline at end of file
+var_dump($create);
diff --git a/examples/lists/api/remove.php b/examples/lists/api/remove.php
index 1e2e5cc1..789f521d 100644
--- a/examples/lists/api/remove.php
+++ b/examples/lists/api/remove.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$remove = $client->getListsApi()->removeMediaFromList(TMDB_LIST_ID, 49047);
-var_dump($remove);
\ No newline at end of file
+var_dump($remove);
diff --git a/examples/lists/model/add.php b/examples/lists/model/add.php
index 93f6e8c8..55abd05b 100644
--- a/examples/lists/model/add.php
+++ b/examples/lists/model/add.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\ListRepository($client);
$result = $repository->add(TMDB_LIST_ID, 150);
-var_dump($result);
\ No newline at end of file
+var_dump($result);
diff --git a/examples/lists/model/create_list.php b/examples/lists/model/create_list.php
index de82a8ef..012c3999 100644
--- a/examples/lists/model/create_list.php
+++ b/examples/lists/model/create_list.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\ListRepository($client);
$result = $repository->createList('php-tmdb-api', 'just a test');
-var_dump($result);
\ No newline at end of file
+var_dump($result);
diff --git a/examples/lists/model/get.php b/examples/lists/model/get.php
index 8107437c..4cea0f20 100644
--- a/examples/lists/model/get.php
+++ b/examples/lists/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\ListRepository($client);
$list = $repository->load('509ec17b19c2950a0600050d');
-var_dump($list);
\ No newline at end of file
+var_dump($list);
diff --git a/examples/lists/model/item_status.php b/examples/lists/model/item_status.php
index 570aa4ac..b3f7d7bc 100644
--- a/examples/lists/model/item_status.php
+++ b/examples/lists/model/item_status.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\ListRepository($client);
$list = $repository->getItemStatus('509ec17b19c2950a0600050d', 150);
-var_dump($list);
\ No newline at end of file
+var_dump($list);
diff --git a/examples/lists/model/remove.php b/examples/lists/model/remove.php
index 6ecaa480..f2e7c34b 100644
--- a/examples/lists/model/remove.php
+++ b/examples/lists/model/remove.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\ListRepository($client);
$result = $repository->remove(TMDB_LIST_ID, 150);
-var_dump($result);
\ No newline at end of file
+var_dump($result);
diff --git a/examples/movies/api/account_states.php b/examples/movies/api/account_states.php
index 2d7b3b4f..acd242c7 100644
--- a/examples/movies/api/account_states.php
+++ b/examples/movies/api/account_states.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$accountStates = $client->getMoviesApi()->getAccountStates(550, true);
-var_dump($accountStates);
\ No newline at end of file
+var_dump($accountStates);
diff --git a/examples/movies/api/images.php b/examples/movies/api/images.php
index 30d9c029..1d701df4 100644
--- a/examples/movies/api/images.php
+++ b/examples/movies/api/images.php
@@ -10,10 +10,10 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
-$images = $client->getMoviesApi()->getImages(550);
\ No newline at end of file
+$images = $client->getMoviesApi()->getImages(550);
diff --git a/examples/movies/api/movie_rating.php b/examples/movies/api/movie_rating.php
index 0699d95d..f026ee77 100644
--- a/examples/movies/api/movie_rating.php
+++ b/examples/movies/api/movie_rating.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -21,4 +21,4 @@
$rating = $client->getMoviesApi()->rateMovie(550, 8.5);
-var_dump($rating);
\ No newline at end of file
+var_dump($rating);
diff --git a/examples/movies/model/account_states.php b/examples/movies/model/account_states.php
index 921e9712..83e30e57 100644
--- a/examples/movies/model/account_states.php
+++ b/examples/movies/model/account_states.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$accountStates = $repository->getAccountStates(97020);
-var_dump($accountStates);
\ No newline at end of file
+var_dump($accountStates);
diff --git a/examples/movies/model/all.php b/examples/movies/model/all.php
index 70bba794..a26afdc8 100644
--- a/examples/movies/model/all.php
+++ b/examples/movies/model/all.php
@@ -12,8 +12,8 @@
*/
header('Content-Type: text/html; charset=utf-8');
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -33,20 +33,20 @@
echo "Alternative Titles
";
-foreach($movie->getAlternativeTitles()->filterCountry('US') as $title) {
+foreach ($movie->getAlternativeTitles()->filterCountry('US') as $title) {
printf(" - %s [%s]
", $title->getTitle(), $title->getIso31661());
}
echo "Cast
";
-foreach($movie->getCredits()->getCast() as $person) {
+foreach ($movie->getCredits()->getCast() as $person) {
echo $imageHelper->getHtml($person->getProfileImage(), 'w45');
printf(" - %s as %s
", $person->getName(), $person->getCharacter());
}
echo "Crew
";
-foreach($movie->getCredits()->getCrew() as $person) {
+foreach ($movie->getCredits()->getCrew() as $person) {
echo $imageHelper->getHtml($person->getProfileImage(), 'w45');
printf(" - %s as %s
", $person->getName(), $person->getJob());
}
@@ -55,7 +55,7 @@
// All collection classes support filtering by closure functions, provided by the generic collection implementation.
foreach($movie->getImages()->filter(
- function($key, $value){
+ function ($key, $value) {
if ($value->getIso6391() == 'en' && $value instanceof \Tmdb\Model\Image\PosterImage) { return true; }
}
) as $image) {
@@ -75,31 +75,31 @@ function($key, $value){
echo "Genres
";
-foreach($movie->getGenres() as $genre) {
+foreach ($movie->getGenres() as $genre) {
printf(" - %s
", $genre->getName());
}
echo "Keywords
";
-foreach($movie->getKeywords() as $keyword) {
+foreach ($movie->getKeywords() as $keyword) {
printf(" - %s [%s]
", $keyword->getName(), $keyword->getId());
}
echo "Releases
";
-foreach($movie->getReleases()->filterCountry('US') as $release) {
+foreach ($movie->getReleases()->filterCountry('US') as $release) {
printf(" - %s on %s
", $release->getIso31661(), $release->getReleaseDate()->format('d-m-Y'));
}
echo "Translations
";
-foreach($movie->getTranslations()->filterLanguage('en') as $translation) {
+foreach ($movie->getTranslations()->filterLanguage('en') as $translation) {
printf(" - %s
", $translation->getName());
}
echo "Trailers
";
-foreach($movie->getTrailers() as $trailer) {
+foreach ($movie->getTrailers() as $trailer) {
printf(" - %s
", $trailer->getUrl());
}
@@ -107,7 +107,7 @@ function($key, $value){
echo "Popular titles
";
-foreach($popular as $p) {
+foreach ($popular as $p) {
printf(" - %s
", $p->getTitle());
}
@@ -115,6 +115,6 @@ function($key, $value){
echo "Top rated
";
-foreach($topRated as $t) {
+foreach ($topRated as $t) {
printf(" - %s
", $t->getTitle());
-}
\ No newline at end of file
+}
diff --git a/examples/movies/model/alternative_titles.php b/examples/movies/model/alternative_titles.php
index f06f6740..cf130c04 100644
--- a/examples/movies/model/alternative_titles.php
+++ b/examples/movies/model/alternative_titles.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getAlternativeTitles(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/cache/basic_doctrine_cache.php b/examples/movies/model/cache/basic_doctrine_cache.php
new file mode 100644
index 00000000..3d6d3eba
--- /dev/null
+++ b/examples/movies/model/cache/basic_doctrine_cache.php
@@ -0,0 +1,24 @@
+
+ * @copyright (c) 2013, Michael Roterman
+ * @version 0.0.1
+ */
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
+
+$token = new \Tmdb\ApiToken(TMDB_API_KEY);
+$client = new \Tmdb\Client($token);
+
+$client->setCaching(true);
+
+$repository = new \Tmdb\Repository\MovieRepository($client);
+$movie = $repository->load(87421);
+
+var_dump($movie);
diff --git a/examples/movies/model/cache/built-in.php b/examples/movies/model/cache/built-in.php
new file mode 100644
index 00000000..50fea79c
--- /dev/null
+++ b/examples/movies/model/cache/built-in.php
@@ -0,0 +1,24 @@
+
+ * @copyright (c) 2013, Michael Roterman
+ * @version 0.0.1
+ */
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
+
+$token = new \Tmdb\ApiToken(TMDB_API_KEY);
+$client = new \Tmdb\Client($token);
+
+$client->setCaching(true, '/tmp/php-tmdb-api');
+
+$repository = new \Tmdb\Repository\MovieRepository($client);
+$movie = $repository->load(87421);
+
+echo $movie->getTitle();
diff --git a/examples/movies/model/changes.php b/examples/movies/model/changes.php
index c4e4e308..21ca4e71 100644
--- a/examples/movies/model/changes.php
+++ b/examples/movies/model/changes.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getChanges(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/credits.php b/examples/movies/model/credits.php
index f9dbb099..835e3cd6 100644
--- a/examples/movies/model/credits.php
+++ b/examples/movies/model/credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getCredits(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/get.php b/examples/movies/model/get.php
index 904b9ce0..b5f8fe57 100644
--- a/examples/movies/model/get.php
+++ b/examples/movies/model/get.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$movie = $repository->load(87421);
-var_dump($movie);
\ No newline at end of file
+var_dump($movie);
diff --git a/examples/movies/model/images.php b/examples/movies/model/images.php
index 803a84ce..ce9fdcc0 100644
--- a/examples/movies/model/images.php
+++ b/examples/movies/model/images.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getImages(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/keywords.php b/examples/movies/model/keywords.php
index 4fd83521..d8ae94b3 100644
--- a/examples/movies/model/keywords.php
+++ b/examples/movies/model/keywords.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getKeywords(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/lists.php b/examples/movies/model/lists.php
index 3a806fce..a53feb58 100644
--- a/examples/movies/model/lists.php
+++ b/examples/movies/model/lists.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getLists(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/rate.php b/examples/movies/model/rate.php
index e24ed605..d60c257e 100644
--- a/examples/movies/model/rate.php
+++ b/examples/movies/model/rate.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -22,4 +22,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$rate = $repository->rate(49047, 6.5);
-var_dump($rate);
\ No newline at end of file
+var_dump($rate);
diff --git a/examples/movies/model/releases.php b/examples/movies/model/releases.php
index b7127471..4b5f6c33 100644
--- a/examples/movies/model/releases.php
+++ b/examples/movies/model/releases.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getReleases(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/reviews.php b/examples/movies/model/reviews.php
index c132a120..0331307e 100644
--- a/examples/movies/model/reviews.php
+++ b/examples/movies/model/reviews.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getReviews(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/similar_movies.php b/examples/movies/model/similar_movies.php
index 378fa3ba..723d4882 100644
--- a/examples/movies/model/similar_movies.php
+++ b/examples/movies/model/similar_movies.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getSimilarMovies(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/movies/model/trailers.php b/examples/movies/model/trailers.php
index 51364014..a1cc3f84 100644
--- a/examples/movies/model/trailers.php
+++ b/examples/movies/model/trailers.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getTrailers(87421);
-var_dump($collection);
\ No newline at end of file
+var_dump($collection);
diff --git a/examples/networks/model/get.php b/examples/networks/model/get.php
index c15f2701..bd8a8466 100644
--- a/examples/networks/model/get.php
+++ b/examples/networks/model/get.php
@@ -10,14 +10,13 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
-
$repository = new \Tmdb\Repository\NetworkRepository($client);
$network = $repository->load(49);
-var_dump($network);
\ No newline at end of file
+var_dump($network);
diff --git a/examples/people/model/all.php b/examples/people/model/all.php
index 62700185..5d54e105 100644
--- a/examples/people/model/all.php
+++ b/examples/people/model/all.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$person = $repository->load(33);
-var_dump($person);
\ No newline at end of file
+var_dump($person);
diff --git a/examples/people/model/combined_credits.php b/examples/people/model/combined_credits.php
index 21f36725..4c2acb08 100644
--- a/examples/people/model/combined_credits.php
+++ b/examples/people/model/combined_credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$person = $repository->getCombinedCredits(33);
-var_dump($person);
\ No newline at end of file
+var_dump($person);
diff --git a/examples/people/model/external_ids.php b/examples/people/model/external_ids.php
index 76fa3fa3..c182f7cb 100644
--- a/examples/people/model/external_ids.php
+++ b/examples/people/model/external_ids.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$externalIds = $repository->getExternalIds(287);
-var_dump($externalIds);
\ No newline at end of file
+var_dump($externalIds);
diff --git a/examples/people/model/latest.php b/examples/people/model/latest.php
index 54015664..4f0474db 100644
--- a/examples/people/model/latest.php
+++ b/examples/people/model/latest.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$latest = $repository->getLatest();
-var_dump($latest);
\ No newline at end of file
+var_dump($latest);
diff --git a/examples/people/model/movie_credits.php b/examples/people/model/movie_credits.php
index cc5b1df2..cf0e4581 100644
--- a/examples/people/model/movie_credits.php
+++ b/examples/people/model/movie_credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$person = $repository->getMovieCredits(33);
-var_dump($person);
\ No newline at end of file
+var_dump($person);
diff --git a/examples/people/model/popular.php b/examples/people/model/popular.php
index 3d348597..bc84b48c 100644
--- a/examples/people/model/popular.php
+++ b/examples/people/model/popular.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$popular = $repository->getPopular();
-var_dump($popular);
\ No newline at end of file
+var_dump($popular);
diff --git a/examples/people/model/tv_credits.php b/examples/people/model/tv_credits.php
index ab75c741..d526dec3 100644
--- a/examples/people/model/tv_credits.php
+++ b/examples/people/model/tv_credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\PeopleRepository($client);
$person = $repository->getTvCredits(33);
-var_dump($person);
\ No newline at end of file
+var_dump($person);
diff --git a/examples/reviews/model/get.php b/examples/reviews/model/get.php
index e902e5a4..d2ecc925 100644
--- a/examples/reviews/model/get.php
+++ b/examples/reviews/model/get.php
@@ -10,14 +10,13 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
-
$repository = new \Tmdb\Repository\ReviewRepository($client);
$review = $repository->load('5013bc76760ee372cb00253e');
-var_dump($review);
\ No newline at end of file
+var_dump($review);
diff --git a/examples/search/model/collection.php b/examples/search/model/collection.php
index 49e8bfa6..68739cbd 100644
--- a/examples/search/model/collection.php
+++ b/examples/search/model/collection.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchCollection('star wars', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/company.php b/examples/search/model/company.php
index c7da9292..ed83814f 100644
--- a/examples/search/model/company.php
+++ b/examples/search/model/company.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchCompany('warner bros', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/keyword.php b/examples/search/model/keyword.php
index 2a64d187..f1020e33 100644
--- a/examples/search/model/keyword.php
+++ b/examples/search/model/keyword.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchKeyword('scary', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/list.php b/examples/search/model/list.php
index a8e01ec3..e2d8c621 100644
--- a/examples/search/model/list.php
+++ b/examples/search/model/list.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchList('award', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/movie.php b/examples/search/model/movie.php
index 8b9e259c..bee0b527 100644
--- a/examples/search/model/movie.php
+++ b/examples/search/model/movie.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchMovie('batman', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/person.php b/examples/search/model/person.php
index 41a00b84..2407a083 100644
--- a/examples/search/model/person.php
+++ b/examples/search/model/person.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchPerson('bruce lee', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/search/model/tv.php b/examples/search/model/tv.php
index ba1d81e6..a3fc32d9 100644
--- a/examples/search/model/tv.php
+++ b/examples/search/model/tv.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -23,4 +23,4 @@
$find = $repository->searchTv('breaking bad', $query);
-var_dump($find);
\ No newline at end of file
+var_dump($find);
diff --git a/examples/tv/model/episode.php b/examples/tv/model/episode.php
index e58f7030..0cc52b3a 100644
--- a/examples/tv/model/episode.php
+++ b/examples/tv/model/episode.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$episode = $repository->load(1396, 2, 1);
-var_dump($episode);
\ No newline at end of file
+var_dump($episode);
diff --git a/examples/tv/model/episode/credits.php b/examples/tv/model/episode/credits.php
index c5bfce65..3560e6b4 100644
--- a/examples/tv/model/episode/credits.php
+++ b/examples/tv/model/episode/credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$tvShow = $repository->getCredits(1396, 1, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/episode/external_ids.php b/examples/tv/model/episode/external_ids.php
index 617917b3..2c8ef730 100644
--- a/examples/tv/model/episode/external_ids.php
+++ b/examples/tv/model/episode/external_ids.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$tvShow = $repository->getExternalIds(1396, 1, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/episode/images.php b/examples/tv/model/episode/images.php
index 647a5513..37298d8d 100644
--- a/examples/tv/model/episode/images.php
+++ b/examples/tv/model/episode/images.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$tvShow = $repository->getImages(1396, 1, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/season.php b/examples/tv/model/season.php
index cc51e365..5fb3b6f6 100644
--- a/examples/tv/model/season.php
+++ b/examples/tv/model/season.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvSeasonRepository($client);
$season = $repository->load(1396, 2);
-var_dump($season);
\ No newline at end of file
+var_dump($season);
diff --git a/examples/tv/model/season/credits.php b/examples/tv/model/season/credits.php
index cc1b43ff..70edda5b 100644
--- a/examples/tv/model/season/credits.php
+++ b/examples/tv/model/season/credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvSeasonRepository($client);
$tvShow = $repository->getCredits(1396, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/season/external_ids.php b/examples/tv/model/season/external_ids.php
index ac07c45f..19203b83 100644
--- a/examples/tv/model/season/external_ids.php
+++ b/examples/tv/model/season/external_ids.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvSeasonRepository($client);
$tvShow = $repository->getExternalIds(1396, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/season/images.php b/examples/tv/model/season/images.php
index 84ecddbe..4e236004 100644
--- a/examples/tv/model/season/images.php
+++ b/examples/tv/model/season/images.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvSeasonRepository($client);
$tvShow = $repository->getImages(1396, 1);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/show.php b/examples/tv/model/show.php
index e5f51809..b2be9280 100644
--- a/examples/tv/model/show.php
+++ b/examples/tv/model/show.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../vendor/autoload.php');
-require_once('../../../apikey.php');
+require_once '../../../vendor/autoload.php';
+require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->load(1396);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/tv/credits.php b/examples/tv/model/tv/credits.php
index 497c6161..89614d98 100644
--- a/examples/tv/model/tv/credits.php
+++ b/examples/tv/model/tv/credits.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getCredits(1396);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/tv/external_ids.php b/examples/tv/model/tv/external_ids.php
index 8ee689ae..fb09fc4c 100644
--- a/examples/tv/model/tv/external_ids.php
+++ b/examples/tv/model/tv/external_ids.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getExternalIds(1396);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/tv/images.php b/examples/tv/model/tv/images.php
index fea43b3a..bf04b60b 100644
--- a/examples/tv/model/tv/images.php
+++ b/examples/tv/model/tv/images.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getImages(1396);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/tv/on_the_air.php b/examples/tv/model/tv/on_the_air.php
index fb8bd45d..6feac069 100644
--- a/examples/tv/model/tv/on_the_air.php
+++ b/examples/tv/model/tv/on_the_air.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getOnTheAir();
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/examples/tv/model/tv/translations.php b/examples/tv/model/tv/translations.php
index c69304ac..a94dbad4 100644
--- a/examples/tv/model/tv/translations.php
+++ b/examples/tv/model/tv/translations.php
@@ -10,8 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-require_once('../../../../vendor/autoload.php');
-require_once('../../../../apikey.php');
+require_once '../../../../vendor/autoload.php';
+require_once '../../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
@@ -19,4 +19,4 @@
$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getTranslations(1396);
-var_dump($tvShow);
\ No newline at end of file
+var_dump($tvShow);
diff --git a/lib/Tmdb/Api/AbstractApi.php b/lib/Tmdb/Api/AbstractApi.php
index 3e4f2437..4e75af21 100644
--- a/lib/Tmdb/Api/AbstractApi.php
+++ b/lib/Tmdb/Api/AbstractApi.php
@@ -19,8 +19,7 @@
* Class AbstractApi
* @package Tmdb\Api
*/
-abstract class AbstractApi
- implements ApiInterface
+abstract class AbstractApi implements ApiInterface
{
/**
* The client
@@ -42,9 +41,9 @@ public function __construct(Client $client)
/**
* Send a GET request
*
- * @param string $path
- * @param array $parameters
- * @param array $headers
+ * @param string $path
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function get($path, array $parameters = array(), $headers = array())
@@ -53,6 +52,7 @@ public function get($path, array $parameters = array(), $headers = array())
* @var Response $response
*/
$response = $this->client->getHttpClient()->get($path, $parameters, $headers);
+
return $response->json();
}
@@ -60,8 +60,8 @@ public function get($path, array $parameters = array(), $headers = array())
* Send a HEAD request
*
* @param $path
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function head($path, array $parameters = array(), $headers = array())
@@ -70,6 +70,7 @@ public function head($path, array $parameters = array(), $headers = array())
* @var Response $response
*/
$response = $this->client->getHttpClient()->head($path, $parameters, $headers);
+
return $response->json();
}
@@ -77,9 +78,9 @@ public function head($path, array $parameters = array(), $headers = array())
* Send a POST request
*
* @param $path
- * @param null $postBody
- * @param array $parameters
- * @param array $headers
+ * @param null $postBody
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function post($path, $postBody = null, array $parameters = array(), $headers = array())
@@ -88,6 +89,7 @@ public function post($path, $postBody = null, array $parameters = array(), $head
* @var Response $response
*/
$response = $this->client->getHttpClient()->post($path, $postBody, $parameters, $headers);
+
return $response->json();
}
@@ -95,9 +97,9 @@ public function post($path, $postBody = null, array $parameters = array(), $head
* Send a POST request but json_encode the post body in the request
*
* @param $path
- * @param null $postBody
- * @param array $parameters
- * @param array $headers
+ * @param null $postBody
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function postJson($path, $postBody = null, array $parameters = array(), $headers = array())
@@ -110,6 +112,7 @@ public function postJson($path, $postBody = null, array $parameters = array(), $
}
$response = $this->client->getHttpClient()->postJson($path, $postBody, $parameters, $headers);
+
return $response->json();
}
@@ -117,9 +120,9 @@ public function postJson($path, $postBody = null, array $parameters = array(), $
* Send a PUT request
*
* @param $path
- * @param null $body
- * @param array $parameters
- * @param array $headers
+ * @param null $body
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function put($path, $body = null, array $parameters = array(), $headers = array())
@@ -128,6 +131,7 @@ public function put($path, $body = null, array $parameters = array(), $headers =
* @var Response $response
*/
$response = $this->client->getHttpClient()->put($path, $body, $parameters, $headers);
+
return $response->json();
}
@@ -135,9 +139,9 @@ public function put($path, $body = null, array $parameters = array(), $headers =
* Send a DELETE request
*
* @param $path
- * @param null $body
- * @param array $parameters
- * @param array $headers
+ * @param null $body
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function delete($path, $body = null, array $parameters = array(), $headers = array())
@@ -146,6 +150,7 @@ public function delete($path, $body = null, array $parameters = array(), $header
* @var Response $response
*/
$response = $this->client->getHttpClient()->delete($path, $body, $parameters, $headers);
+
return $response->json();
}
@@ -153,9 +158,9 @@ public function delete($path, $body = null, array $parameters = array(), $header
* Send a PATCH request
*
* @param $path
- * @param null $body
- * @param array $parameters
- * @param array $headers
+ * @param null $body
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function patch($path, $body = null, array $parameters = array(), $headers = array())
@@ -164,6 +169,7 @@ public function patch($path, $body = null, array $parameters = array(), $headers
* @var Response $response
*/
$response = $this->client->getHttpClient()->patch($path, $body, $parameters, $headers);
+
return $response->json();
}
}
diff --git a/lib/Tmdb/Api/Account.php b/lib/Tmdb/Api/Account.php
index 2bf4f5f5..80282464 100644
--- a/lib/Tmdb/Api/Account.php
+++ b/lib/Tmdb/Api/Account.php
@@ -17,14 +17,13 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#account
*/
-class Account
- extends AbstractApi
+class Account extends AbstractApi
{
/**
* Get the basic information for an account. You will need to have a valid session id.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getAccount(array $parameters = array(), array $headers = array())
@@ -35,9 +34,9 @@ public function getAccount(array $parameters = array(), array $headers = array()
/**
* Get the lists that you have created and marked as a favorite.
*
- * @param integer $accountId
- * @param array $parameters
- * @param array $headers
+ * @param integer $accountId
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getLists($accountId, array $parameters = array(), array $headers = array())
@@ -48,9 +47,9 @@ public function getLists($accountId, array $parameters = array(), array $headers
/**
* Get the list of favorite movies for an account.
*
- * @param integer $accountId
- * @param array $parameters
- * @param array $headers
+ * @param integer $accountId
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getFavoriteMovies($accountId, array $parameters = array(), array $headers = array())
@@ -61,9 +60,9 @@ public function getFavoriteMovies($accountId, array $parameters = array(), array
/**
* Add or remove a movie to an accounts favorite list.
*
- * @param integer $accountId
- * @param integer $movieId
- * @param boolean $isFavorite
+ * @param integer $accountId
+ * @param integer $movieId
+ * @param boolean $isFavorite
* @return mixed
*/
public function favorite($accountId, $movieId, $isFavorite = true)
@@ -77,9 +76,9 @@ public function favorite($accountId, $movieId, $isFavorite = true)
/**
* Get the list of rated movies (and associated rating) for an account.
*
- * @param integer $accountId
- * @param array $parameters
- * @param array $headers
+ * @param integer $accountId
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getRatedMovies($accountId, array $parameters = array(), array $headers = array())
@@ -90,9 +89,9 @@ public function getRatedMovies($accountId, array $parameters = array(), array $h
/**
* Get the list of movies on an accounts watchlist.
*
- * @param integer $accountId
- * @param array $parameters
- * @param array $headers
+ * @param integer $accountId
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovieWatchlist($accountId, array $parameters = array(), array $headers = array())
@@ -103,9 +102,9 @@ public function getMovieWatchlist($accountId, array $parameters = array(), array
/**
* Add or remove a movie to an accounts watch list.
*
- * @param integer $accountId
- * @param integer $movieId
- * @param boolean $isOnWatchlist
+ * @param integer $accountId
+ * @param integer $movieId
+ * @param boolean $isOnWatchlist
* @return mixed
*/
public function watchlist($accountId, $movieId, $isOnWatchlist = true)
diff --git a/lib/Tmdb/Api/ApiInterface.php b/lib/Tmdb/Api/ApiInterface.php
index 5719777c..351c7606 100644
--- a/lib/Tmdb/Api/ApiInterface.php
+++ b/lib/Tmdb/Api/ApiInterface.php
@@ -4,7 +4,7 @@
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
- *
+ *
* @package Tmdb
* @author Michael Roterman
* @copyright (c) 2013, Michael Roterman
@@ -16,5 +16,6 @@
* Interface ApiInterface
* @package Tmdb\Api
*/
-interface ApiInterface {
+interface ApiInterface
+{
}
diff --git a/lib/Tmdb/Api/Authentication.php b/lib/Tmdb/Api/Authentication.php
index f7c32607..a28862c9 100644
--- a/lib/Tmdb/Api/Authentication.php
+++ b/lib/Tmdb/Api/Authentication.php
@@ -12,7 +12,6 @@
*/
namespace Tmdb\Api;
-use Symfony\Component\Yaml\Exception\RuntimeException;
use Tmdb\Exception\UnauthorizedRequestTokenException;
/**
@@ -20,8 +19,7 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#authentication
*/
-class Authentication
- extends AbstractApi
+class Authentication extends AbstractApi
{
const REQUEST_TOKEN_URI = 'https://www.themoviedb.org/authenticate';
@@ -57,7 +55,7 @@ public function authenticateRequestToken($token)
* This method is used to generate a session id for user based authentication.
* A session id is required in order to use any of the write methods.
*
- * @param string $requestToken
+ * @param string $requestToken
* @throws UnauthorizedRequestTokenException
* @return mixed
*/
@@ -65,8 +63,7 @@ public function getNewSession($requestToken)
{
try {
return $this->get('authentication/session/new', array('request_token' => $requestToken));
- }
- catch(\Exception $e) {
+ } catch (\Exception $e) {
if ($e->getCode() == 401) {
throw new UnauthorizedRequestTokenException("The request token has not been validated yet.");
}
@@ -80,7 +77,8 @@ public function getNewSession($requestToken)
* You should only generate a single guest session per user (or device)
* as you will be able to attach the ratings to a TMDb user account in the future.
*
- * There is also IP limits in place so you should always make sure it's the end user doing the guest session actions.
+ * There is also IP limits in place so you should always make sure it's the end user
+ * doing the guest session actions.
*
* If a guest session is not used for the first time within 24 hours, it will be automatically discarded.
*
diff --git a/lib/Tmdb/Api/Certifications.php b/lib/Tmdb/Api/Certifications.php
index 30bff9be..6c676ed6 100644
--- a/lib/Tmdb/Api/Certifications.php
+++ b/lib/Tmdb/Api/Certifications.php
@@ -17,16 +17,16 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#certifications
*/
-class Certifications
- extends AbstractApi
+class Certifications extends AbstractApi
{
/**
* Get the list of supported certifications for movies.
*
- * These can be used in conjunction with the certification_country and certification.lte parameters when using discover.
+ * These can be used in conjunction with the certification_country and
+ * certification.lte parameters when using discover.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovieList(array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Changes.php b/lib/Tmdb/Api/Changes.php
index 0ae9093a..084d5926 100644
--- a/lib/Tmdb/Api/Changes.php
+++ b/lib/Tmdb/Api/Changes.php
@@ -17,8 +17,7 @@
* @package Tmdb\Api
* http://docs.themoviedb.apiary.io/#changes
*/
-class Changes
- extends AbstractApi
+class Changes extends AbstractApi
{
/**
* Get a list of movie ids that have been edited.
@@ -31,8 +30,8 @@ class Changes
* Please note that the change log system to support this was changed
* on October 5, 2012 and will only show movies that have been edited since.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovieChanges(array $parameters = array(), array $headers = array())
@@ -51,8 +50,8 @@ public function getMovieChanges(array $parameters = array(), array $headers = ar
* Please note that the change log system to support this was changed
* on October 5, 2012 and will only show movies that have been edited since.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getPersonChanges(array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Collections.php b/lib/Tmdb/Api/Collections.php
index e297484d..8d4c8ff0 100644
--- a/lib/Tmdb/Api/Collections.php
+++ b/lib/Tmdb/Api/Collections.php
@@ -17,8 +17,7 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#collections
*/
-class Collections
- extends AbstractApi
+class Collections extends AbstractApi
{
/**
* Get the basic collection information for a specific collection id.
@@ -30,8 +29,8 @@ class Collections
* If you would like to sort them yourself you can use the provided release_date.
*
* @param $collection_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCollection($collection_id, array $parameters = array(), array $headers = array())
@@ -43,8 +42,8 @@ public function getCollection($collection_id, array $parameters = array(), array
* Get all of the images for a particular collection by collection id.
*
* @param $collection_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getImages($collection_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Companies.php b/lib/Tmdb/Api/Companies.php
index 2f8d1696..738ebcc1 100644
--- a/lib/Tmdb/Api/Companies.php
+++ b/lib/Tmdb/Api/Companies.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#companies
*/
-class Companies
- extends AbstractApi
+class Companies extends AbstractApi
{
/**
* This method is used to retrieve all of the basic information about a company.
*
* @param $company_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCompany($company_id, array $parameters = array(), array $headers = array())
@@ -36,9 +35,9 @@ public function getCompany($company_id, array $parameters = array(), array $head
/**
* Get the list of movies associated with a particular company.
*
- * @param integer $company_id
- * @param array $parameters
- * @param array $headers
+ * @param integer $company_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovies($company_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Configuration.php b/lib/Tmdb/Api/Configuration.php
index f73986c0..d80da3b0 100644
--- a/lib/Tmdb/Api/Configuration.php
+++ b/lib/Tmdb/Api/Configuration.php
@@ -18,8 +18,7 @@
*
* @see http://docs.themoviedb.apiary.io/#configuration
*/
-class Configuration
- extends AbstractApi
+class Configuration extends AbstractApi
{
/**
* Get the system wide configuration information.
@@ -38,7 +37,7 @@ class Configuration
*
* http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg
*
- * @param array $headers
+ * @param array $headers
* @return mixed
*/
public function getConfiguration(array $headers = array())
diff --git a/lib/Tmdb/Api/Credits.php b/lib/Tmdb/Api/Credits.php
index d82372a1..b5754d53 100644
--- a/lib/Tmdb/Api/Credits.php
+++ b/lib/Tmdb/Api/Credits.php
@@ -17,12 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#credits
*/
-class Credits
- extends AbstractApi
+class Credits extends AbstractApi
{
/**
- * Get the detailed information about a particular credit record. This is currently only supported with the new credit model found in TV.
- * These ids can be found from any TV credit response as well as the tv_credits and combined_credits methods for people.
+ * Get the detailed information about a particular credit record.
+ *
+ * This is currently only supported with the new credit model found in TV.
+ * These ids can be found from any TV credit response as well as
+ * the tv_credits and combined_credits methods for people.
*
* The episodes object returns a list of episodes and are generally going to be guest stars.
* The season array will return a list of season numbers.
@@ -31,8 +33,8 @@ class Credits
* and are assumed to be "season regulars".
*
* @param $credit_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCredit($credit_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Discover.php b/lib/Tmdb/Api/Discover.php
index 69d236cc..f822e794 100644
--- a/lib/Tmdb/Api/Discover.php
+++ b/lib/Tmdb/Api/Discover.php
@@ -17,14 +17,13 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#discover
*/
-class Discover
- extends AbstractApi
+class Discover extends AbstractApi
{
/**
* Discover movies by different types of data like average rating, number of votes, genres and certifications.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function discoverMovies(array $parameters = array(), array $headers = array())
@@ -33,10 +32,11 @@ public function discoverMovies(array $parameters = array(), array $headers = arr
}
/**
- * Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.
+ * Discover TV shows by different types of data like average rating, number of votes, genres,
+ * the network they aired on and air dates.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function discoverTv(array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Find.php b/lib/Tmdb/Api/Find.php
index 8f783fa1..74913c5f 100644
--- a/lib/Tmdb/Api/Find.php
+++ b/lib/Tmdb/Api/Find.php
@@ -17,21 +17,24 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#find
*/
-class Find
- extends AbstractApi
+class Find extends AbstractApi
{
/**
- * The find method makes it easy to search for objects in our database by an external id. For instance, an IMDB ID. This will search all objects (movies, TV shows and people) and return the results in a single response. TV season and TV episode searches will be supported shortly.
+ * The find method makes it easy to search for objects in our database by an external id.
*
+ * For instance, an IMDB ID. This will search all objects (movies, TV shows and people)
+ * and return the results in a single response.
+ *
+ * TV season and TV episode searches will be supported shortly.
* The supported external sources for each object are as follows:
*
* Movies: imdb_id
* People: imdb_id, freebase_mid, freebase_id, tvrage_id
* TV Series: imdb_id, freebase_mid, freebase_id, tvdb_id, tvrage_id
*
- * @param string $id
- * @param array $parameters
- * @param array $headers
+ * @param string $id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function find($id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Genres.php b/lib/Tmdb/Api/Genres.php
index 789c96e6..00d88d5a 100644
--- a/lib/Tmdb/Api/Genres.php
+++ b/lib/Tmdb/Api/Genres.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#genres
*/
-class Genres
- extends AbstractApi
+class Genres extends AbstractApi
{
/**
* Get the list of genres, and return one by id
*
- * @param integer $id
- * @param array $parameters
- * @param array $headers
+ * @param integer $id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getGenre($id, array $parameters = array(), array $headers = array())
@@ -42,8 +41,8 @@ public function getGenre($id, array $parameters = array(), array $headers = arra
/**
* Get the list of genres.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getGenres(array $parameters = array(), array $headers = array())
@@ -55,8 +54,8 @@ public function getGenres(array $parameters = array(), array $headers = array())
* Get the list of movies for a particular genre by id. By default, only movies with 10 or more votes are included.
*
* @param $genre_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovies($genre_id, array $parameters = array(), array $headers = array())
@@ -65,15 +64,16 @@ public function getMovies($genre_id, array $parameters = array(), array $headers
}
/**
- * @param integer $id
- * @param array $data
+ * @param integer $id
+ * @param array $data
* @return mixed
*/
private function extractGenreByIdFromResponse($id, array $data = array())
{
- foreach($data as $genre) {
- if ($id == $genre['id'])
+ foreach ($data as $genre) {
+ if ($id == $genre['id']) {
return $genre;
+ }
}
return null;
diff --git a/lib/Tmdb/Api/Jobs.php b/lib/Tmdb/Api/Jobs.php
index 5afed498..7341b1ee 100644
--- a/lib/Tmdb/Api/Jobs.php
+++ b/lib/Tmdb/Api/Jobs.php
@@ -17,14 +17,13 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#jobs
*/
-class Jobs
- extends AbstractApi
+class Jobs extends AbstractApi
{
/**
* Get a list of valid jobs.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getJobs(array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Keywords.php b/lib/Tmdb/Api/Keywords.php
index 80ed4f80..e47a41b0 100644
--- a/lib/Tmdb/Api/Keywords.php
+++ b/lib/Tmdb/Api/Keywords.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#keywords
*/
-class Keywords
- extends AbstractApi
+class Keywords extends AbstractApi
{
/**
* Get the basic information for a specific keyword id.
*
- * @param int $keyword_id
- * @param array $parameters
- * @param array $headers
+ * @param int $keyword_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getKeyword($keyword_id, array $parameters = array(), array $headers = array())
@@ -36,9 +35,9 @@ public function getKeyword($keyword_id, array $parameters = array(), array $head
/**
* Get the list of movies for a particular keyword by id.
*
- * @param int $keyword_id
- * @param array $parameters
- * @param array $headers
+ * @param int $keyword_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovies($keyword_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Lists.php b/lib/Tmdb/Api/Lists.php
index 1aa3b3f5..c4838f7e 100644
--- a/lib/Tmdb/Api/Lists.php
+++ b/lib/Tmdb/Api/Lists.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#lists
*/
-class Lists
- extends AbstractApi
+class Lists extends AbstractApi
{
/**
* Get a list by id.
*
* @param $list_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getList($list_id, array $parameters = array(), array $headers = array())
@@ -36,10 +35,10 @@ public function getList($list_id, array $parameters = array(), array $headers =
/**
* This method lets users create a new list. A valid session id is required.
*
- * @param string $name
- * @param string $description
- * @param array $parameters
- * @param array $headers
+ * @param string $name
+ * @param string $description
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function createList($name, $description, array $parameters = array(), array $headers = array())
@@ -50,10 +49,10 @@ public function createList($name, $description, array $parameters = array(), arr
/**
* Check to see if a movie ID is already added to a list.
*
- * @param string $id
- * @param int $movieId
- * @param array $parameters
- * @param array $headers
+ * @param string $id
+ * @param int $movieId
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getItemStatus($id, $movieId, array $parameters = array(), array $headers = array())
@@ -68,8 +67,8 @@ public function getItemStatus($id, $movieId, array $parameters = array(), array
/**
* This method lets users add new movies to a list that they created. A valid session id is required.
*
- * @param string $id
- * @param string $mediaId
+ * @param string $id
+ * @param string $mediaId
* @return mixed
*/
public function addMediaToList($id, $mediaId)
@@ -80,8 +79,8 @@ public function addMediaToList($id, $mediaId)
/**
* This method lets users delete movies from a list that they created. A valid session id is required.
*
- * @param string $id
- * @param string $mediaId
+ * @param string $id
+ * @param string $mediaId
* @return mixed
*/
public function removeMediaFromList($id, $mediaId)
@@ -92,7 +91,7 @@ public function removeMediaFromList($id, $mediaId)
/**
* This method lets users delete a list that they created. A valid session id is required.
*
- * @param string $id
+ * @param string $id
* @return mixed
*/
public function deleteList($id)
diff --git a/lib/Tmdb/Api/Movies.php b/lib/Tmdb/Api/Movies.php
index 960da006..38390d94 100644
--- a/lib/Tmdb/Api/Movies.php
+++ b/lib/Tmdb/Api/Movies.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#movies
*/
-class Movies
- extends AbstractApi
+class Movies extends AbstractApi
{
/**
* Get the basic movie information for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovie($movie_id, array $parameters = array(), array $headers = array())
@@ -37,8 +36,8 @@ public function getMovie($movie_id, array $parameters = array(), array $headers
* Get the alternative titles for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getAlternativeTitles($movie_id, array $parameters = array(), array $headers = array())
@@ -50,8 +49,8 @@ public function getAlternativeTitles($movie_id, array $parameters = array(), arr
* Get the cast and crew information for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCredits($movie_id, array $parameters = array(), array $headers = array())
@@ -63,8 +62,8 @@ public function getCredits($movie_id, array $parameters = array(), array $header
* Get the images (posters and backdrops) for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getImages($movie_id, array $parameters = array(), array $headers = array())
@@ -76,8 +75,8 @@ public function getImages($movie_id, array $parameters = array(), array $headers
* Get the plot keywords for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getKeywords($movie_id, array $parameters = array(), array $headers = array())
@@ -89,8 +88,8 @@ public function getKeywords($movie_id, array $parameters = array(), array $heade
* Get the release date by country for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getReleases($movie_id, array $parameters = array(), array $headers = array())
@@ -102,8 +101,8 @@ public function getReleases($movie_id, array $parameters = array(), array $heade
* Get the trailers for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTrailers($movie_id, array $parameters = array(), array $headers = array())
@@ -115,8 +114,8 @@ public function getTrailers($movie_id, array $parameters = array(), array $heade
* Get the translations for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTranslations($movie_id, array $parameters = array(), array $headers = array())
@@ -128,8 +127,8 @@ public function getTranslations($movie_id, array $parameters = array(), array $h
* Get the similar movies for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getSimilarMovies($movie_id, array $parameters = array(), array $headers = array())
@@ -141,8 +140,8 @@ public function getSimilarMovies($movie_id, array $parameters = array(), array $
* Get the reviews for a particular movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getReviews($movie_id, array $parameters = array(), array $headers = array())
@@ -154,8 +153,8 @@ public function getReviews($movie_id, array $parameters = array(), array $header
* Get the lists that the movie belongs to.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getLists($movie_id, array $parameters = array(), array $headers = array())
@@ -167,8 +166,8 @@ public function getLists($movie_id, array $parameters = array(), array $headers
* Get the changes for a specific movie id.
*
* @param $movie_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getChanges($movie_id, array $parameters = array(), array $headers = array())
@@ -179,8 +178,8 @@ public function getChanges($movie_id, array $parameters = array(), array $header
/**
* Get the latest movie id.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getLatest(array $parameters = array(), array $headers = array())
@@ -189,10 +188,11 @@ public function getLatest(array $parameters = array(), array $headers = array())
}
/**
- * Get the list of upcoming movies. This list refreshes every day. The maximum number of items this list will include is 100.
+ * Get the list of upcoming movies. This list refreshes every day.
+ * The maximum number of items this list will include is 100.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getUpcoming(array $parameters = array(), array $headers = array())
@@ -201,10 +201,11 @@ public function getUpcoming(array $parameters = array(), array $headers = array(
}
/**
- * Get the list of movies playing in theatres. This list refreshes every day. The maximum number of items this list will include is 100.
+ * Get the list of movies playing in theatres. This list refreshes every day.
+ * The maximum number of items this list will include is 100.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getNowPlaying(array $parameters = array(), array $headers = array())
@@ -213,10 +214,11 @@ public function getNowPlaying(array $parameters = array(), array $headers = arra
}
/**
- * Get the list of popular movies on The Movie Database. This list refreshes every day.
+ * Get the list of popular movies on The Movie Database.
+ * This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getPopular(array $parameters = array(), array $headers = array())
@@ -225,10 +227,11 @@ public function getPopular(array $parameters = array(), array $headers = array()
}
/**
- * Get the list of top rated movies. By default, this list will only include movies that have 10 or more votes. This list refreshes every day.
+ * Get the list of top rated movies. By default, this list will only include
+ * movies that have 10 or more votes. This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTopRated(array $parameters = array(), array $headers = array())
@@ -237,7 +240,8 @@ public function getTopRated(array $parameters = array(), array $headers = array(
}
/**
- * This method lets users get the status of whether or not the movie has been rated or added to their favourite or watch lists.
+ * This method lets users get the status of whether or not the movie has been rated
+ * or added to their favourite or watch lists.
*
* A valid session id is required.
*
diff --git a/lib/Tmdb/Api/Networks.php b/lib/Tmdb/Api/Networks.php
index 347aade3..1fb0d8e1 100644
--- a/lib/Tmdb/Api/Networks.php
+++ b/lib/Tmdb/Api/Networks.php
@@ -17,8 +17,7 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#networks
*/
-class Networks
- extends AbstractApi
+class Networks extends AbstractApi
{
/**
* This method is used to retrieve the basic information about a TV network.
@@ -26,9 +25,9 @@ class Networks
* You can use this ID to search for TV shows with the discover.
* At this time we don't have much but this will be fleshed out over time.
*
- * @param int $network_id
- * @param array $parameters
- * @param array $headers
+ * @param int $network_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getNetwork($network_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/People.php b/lib/Tmdb/Api/People.php
index 466e2220..cd379813 100644
--- a/lib/Tmdb/Api/People.php
+++ b/lib/Tmdb/Api/People.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#people
*/
-class People
- extends AbstractApi
+class People extends AbstractApi
{
/**
* Get the general person information for a specific id.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getPerson($person_id, array $parameters = array(), array $headers = array())
@@ -37,8 +36,8 @@ public function getPerson($person_id, array $parameters = array(), array $header
* Get the credits for a specific person id.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCredits($person_id, array $parameters = array(), array $headers = array())
@@ -50,8 +49,8 @@ public function getCredits($person_id, array $parameters = array(), array $heade
* Get the movie credits for a specific person id.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getMovieCredits($person_id, array $parameters = array(), array $headers = array())
@@ -66,8 +65,8 @@ public function getMovieCredits($person_id, array $parameters = array(), array $
* This will provide details about which episode and/or season the credit is for.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTvCredits($person_id, array $parameters = array(), array $headers = array())
@@ -82,8 +81,8 @@ public function getTvCredits($person_id, array $parameters = array(), array $hea
* This will provide details about which episode and/or season the credit is for.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCombinedCredits($person_id, array $parameters = array(), array $headers = array())
@@ -95,8 +94,8 @@ public function getCombinedCredits($person_id, array $parameters = array(), arra
* Get the images for a specific person id.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getImages($person_id, array $parameters = array(), array $headers = array())
@@ -114,8 +113,8 @@ public function getImages($person_id, array $parameters = array(), array $header
* The language is present on fields that are translatable.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getChanges($person_id, array $parameters = array(), array $headers = array())
@@ -127,8 +126,8 @@ public function getChanges($person_id, array $parameters = array(), array $heade
* Get the external ids for a specific person id.
*
* @param $person_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getExternalIds($person_id, array $parameters = array(), array $headers = array())
@@ -139,8 +138,8 @@ public function getExternalIds($person_id, array $parameters = array(), array $h
/**
* Get the list of popular people on The Movie Database. This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getPopular(array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Reviews.php b/lib/Tmdb/Api/Reviews.php
index 11b0f1d6..2d630b16 100644
--- a/lib/Tmdb/Api/Reviews.php
+++ b/lib/Tmdb/Api/Reviews.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#reviews
*/
-class Reviews
- extends AbstractApi
+class Reviews extends AbstractApi
{
/**
* Get the full details of a review by ID.
*
* @param $review_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getReview($review_id, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Search.php b/lib/Tmdb/Api/Search.php
index 539f3f1b..8e5f1f1b 100644
--- a/lib/Tmdb/Api/Search.php
+++ b/lib/Tmdb/Api/Search.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#search
*/
-class Search
- extends AbstractApi
+class Search extends AbstractApi
{
/**
* Search for movies by title.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchMovies($query, array $parameters = array(), array $headers = array())
@@ -39,8 +38,8 @@ public function searchMovies($query, array $parameters = array(), array $headers
* Search for collections by name.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchCollection($query, array $parameters = array(), array $headers = array())
@@ -54,8 +53,8 @@ public function searchCollection($query, array $parameters = array(), array $hea
* Search for TV shows by title.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchTv($query, array $parameters = array(), array $headers = array())
@@ -69,8 +68,8 @@ public function searchTv($query, array $parameters = array(), array $headers = a
* Search for people by name.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchPersons($query, array $parameters = array(), array $headers = array())
@@ -84,8 +83,8 @@ public function searchPersons($query, array $parameters = array(), array $header
* Search for lists by name and description.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchList($query, array $parameters = array(), array $headers = array())
@@ -99,8 +98,8 @@ public function searchList($query, array $parameters = array(), array $headers =
* Search for companies by name.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchCompany($query, array $parameters = array(), array $headers = array())
@@ -114,8 +113,8 @@ public function searchCompany($query, array $parameters = array(), array $header
* Search for companies by name.
*
* @param $query
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function searchKeyword($query, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/Api/Tv.php b/lib/Tmdb/Api/Tv.php
index 40a4e27c..c0a91214 100644
--- a/lib/Tmdb/Api/Tv.php
+++ b/lib/Tmdb/Api/Tv.php
@@ -17,15 +17,14 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#tv
*/
-class Tv
- extends AbstractApi
+class Tv extends AbstractApi
{
/**
* Get the primary information about a TV series by id.
*
- * @param integer $tvshow_id
- * @param array $parameters
- * @param array $headers
+ * @param integer $tvshow_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTvshow($tvshow_id, array $parameters = array(), array $headers = array())
@@ -38,8 +37,8 @@ public function getTvshow($tvshow_id, array $parameters = array(), array $header
* Just like the website, we pull this information from the last season of the series.
*
* @param $tvshow_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCredits($tvshow_id, array $parameters = array(), array $headers = array())
@@ -51,8 +50,8 @@ public function getCredits($tvshow_id, array $parameters = array(), array $heade
* Get the external ids that we have stored for a TV series.
*
* @param $tvshow_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getExternalIds($tvshow_id, array $parameters = array(), array $headers = array())
@@ -64,8 +63,8 @@ public function getExternalIds($tvshow_id, array $parameters = array(), array $h
* Get the images (posters and backdrops) for a TV series.
*
* @param $tvshow_id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getImages($tvshow_id, array $parameters = array(), array $headers = array())
@@ -76,8 +75,8 @@ public function getImages($tvshow_id, array $parameters = array(), array $header
/**
* Get the list of popular TV shows. This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getPopular(array $parameters = array(), array $headers = array())
@@ -91,8 +90,8 @@ public function getPopular(array $parameters = array(), array $headers = array()
* By default, this list will only include TV shows that have 2 or more votes.
* This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTopRated(array $parameters = array(), array $headers = array())
@@ -105,14 +104,13 @@ public function getTopRated(array $parameters = array(), array $headers = array(
*
* These translations cascade down to the episode level.
*
- * @param int $tvshow_id
- * @param array $parameters
- * @param array $headers
+ * @param int $tvshow_id
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getTranslations($tvshow_id, array $parameters = array(), array $headers = array())
{
$this->get('tv/' . $tvshow_id . '/translations', $parameters, $headers);
}
-
}
diff --git a/lib/Tmdb/Api/TvEpisode.php b/lib/Tmdb/Api/TvEpisode.php
index 3c09594d..e05cb3e1 100644
--- a/lib/Tmdb/Api/TvEpisode.php
+++ b/lib/Tmdb/Api/TvEpisode.php
@@ -17,8 +17,7 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#tvepisodes
*/
-class TvEpisode
- extends AbstractApi
+class TvEpisode extends AbstractApi
{
/**
* Get the primary information about a TV episode by combination of a season and episode number.
@@ -26,13 +25,27 @@ class TvEpisode
* @param $tvshow_id
* @param $season_number
* @param $episode_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
- public function getEpisode($tvshow_id, $season_number, $episode_number, array $parameters = array(), array $headers = array())
- {
- return $this->get(sprintf('tv/%s/season/%s/episode/%s', $tvshow_id, $season_number,$episode_number), $parameters, $headers);
+ public function getEpisode(
+ $tvshow_id,
+ $season_number,
+ $episode_number,
+ array $parameters = array(),
+ array $headers = array()
+ ) {
+ return $this->get(
+ sprintf(
+ 'tv/%s/season/%s/episode/%s',
+ $tvshow_id,
+ $season_number,
+ $episode_number
+ ),
+ $parameters,
+ $headers
+ );
}
/**
@@ -41,13 +54,27 @@ public function getEpisode($tvshow_id, $season_number, $episode_number, array $p
* @param $tvshow_id
* @param $season_number
* @param $episode_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
- public function getCredits($tvshow_id, $season_number, $episode_number, array $parameters = array(), array $headers = array())
- {
- return $this->get(sprintf('tv/%s/season/%s/episode/%s/credits', $tvshow_id, $season_number,$episode_number), $parameters, $headers);
+ public function getCredits(
+ $tvshow_id,
+ $season_number,
+ $episode_number,
+ array $parameters = array(),
+ array $headers = array()
+ ) {
+ return $this->get(
+ sprintf(
+ 'tv/%s/season/%s/episode/%s/credits',
+ $tvshow_id,
+ $season_number,
+ $episode_number
+ ),
+ $parameters,
+ $headers
+ );
}
/**
@@ -56,13 +83,27 @@ public function getCredits($tvshow_id, $season_number, $episode_number, array $p
* @param $tvshow_id
* @param $season_number
* @param $episode_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
- public function getExternalIds($tvshow_id, $season_number, $episode_number, array $parameters = array(), array $headers = array())
- {
- return $this->get(sprintf('tv/%s/season/%s/episode/%s/external_ids', $tvshow_id, $season_number,$episode_number), $parameters, $headers);
+ public function getExternalIds(
+ $tvshow_id,
+ $season_number,
+ $episode_number,
+ array $parameters = array(),
+ array $headers = array()
+ ) {
+ return $this->get(
+ sprintf(
+ 'tv/%s/season/%s/episode/%s/external_ids',
+ $tvshow_id,
+ $season_number,
+ $episode_number
+ ),
+ $parameters,
+ $headers
+ );
}
/**
@@ -71,12 +112,26 @@ public function getExternalIds($tvshow_id, $season_number, $episode_number, arra
* @param $tvshow_id
* @param $season_number
* @param $episode_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
- public function getImages($tvshow_id, $season_number, $episode_number, array $parameters = array(), array $headers = array())
- {
- return $this->get(sprintf('tv/%s/season/%s/episode/%s/images', $tvshow_id, $season_number,$episode_number), $parameters, $headers);
+ public function getImages(
+ $tvshow_id,
+ $season_number,
+ $episode_number,
+ array $parameters = array(),
+ array $headers = array()
+ ) {
+ return $this->get(
+ sprintf(
+ 'tv/%s/season/%s/episode/%s/images',
+ $tvshow_id,
+ $season_number,
+ $episode_number
+ ),
+ $parameters,
+ $headers
+ );
}
}
diff --git a/lib/Tmdb/Api/TvSeason.php b/lib/Tmdb/Api/TvSeason.php
index cc0e8544..b4785359 100644
--- a/lib/Tmdb/Api/TvSeason.php
+++ b/lib/Tmdb/Api/TvSeason.php
@@ -17,16 +17,15 @@
* @package Tmdb\Api
* @see http://docs.themoviedb.apiary.io/#tvseasons
*/
-class TvSeason
- extends AbstractApi
+class TvSeason extends AbstractApi
{
/**
* Get the primary information about a TV season by its season number.
*
* @param $tvshow_id
* @param $season_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getSeason($tvshow_id, $season_number, array $parameters = array(), array $headers = array())
@@ -39,8 +38,8 @@ public function getSeason($tvshow_id, $season_number, array $parameters = array(
*
* @param $tvshow_id
* @param $season_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getCredits($tvshow_id, $season_number, array $parameters = array(), array $headers = array())
@@ -53,8 +52,8 @@ public function getCredits($tvshow_id, $season_number, array $parameters = array
*
* @param $tvshow_id
* @param $season_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getExternalIds($tvshow_id, $season_number, array $parameters = array(), array $headers = array())
@@ -67,8 +66,8 @@ public function getExternalIds($tvshow_id, $season_number, array $parameters = a
*
* @param $tvshow_id
* @param $season_number
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return mixed
*/
public function getImages($tvshow_id, $season_number, array $parameters = array(), array $headers = array())
diff --git a/lib/Tmdb/ApiToken.php b/lib/Tmdb/ApiToken.php
index 0f6bffa3..06e30938 100644
--- a/lib/Tmdb/ApiToken.php
+++ b/lib/Tmdb/ApiToken.php
@@ -16,7 +16,8 @@
* Class ApiToken
* @package Tmdb
*/
-class ApiToken {
+class ApiToken
+{
private $apiToken = null;
/**
@@ -30,12 +31,13 @@ public function __construct($api_token = null)
}
/**
- * @param null $apiToken
+ * @param null $apiToken
* @return $this
*/
public function setToken($apiToken)
{
$this->apiToken = $apiToken;
+
return $this;
}
diff --git a/lib/Tmdb/Client.php b/lib/Tmdb/Client.php
index 743ad5e6..0d4c2a74 100644
--- a/lib/Tmdb/Client.php
+++ b/lib/Tmdb/Client.php
@@ -12,8 +12,13 @@
*/
namespace Tmdb;
+use Guzzle\Cache\DoctrineCacheAdapter;
+use Guzzle\Common\Exception\RuntimeException;
+use Guzzle\Common\HasDispatcherInterface;
use Guzzle\Http\Client as GuzzleClient;
use Guzzle\Http\ClientInterface;
+use Guzzle\Plugin\Cache\CachePlugin;
+use Guzzle\Plugin\Cache\DefaultCacheStorage;
use Tmdb\HttpClient\HttpClient;
use Tmdb\HttpClient\HttpClientInterface;
use Tmdb\ApiToken as Token;
@@ -25,7 +30,8 @@
* Client wrapper for TMDB
* @package Tmdb
*/
-class Client {
+class Client
+{
/**
* Base API URI
*/
@@ -69,26 +75,79 @@ class Client {
*/
private $httpClient;
+ /**
+ * Stores the cache path
+ *
+ * @var string
+ */
+ private $cachePath;
+
+ /**
+ * Stores wether the cache is enabled or not
+ *
+ * @var boolean
+ */
+ private $cacheEnabled = false;
+
/**
* Construct our client
*
* @param ClientInterface|null $httpClient
- * @param ApiToken $token
- * @param boolean $secure
+ * @param ApiToken $token
+ * @param boolean $secure
*/
- public function __construct(Token $token, ClientInterface $httpClient = null, $secure = false)
+ public function __construct(ApiToken $token, ClientInterface $httpClient = null, $secure = false)
{
$this->setToken($token);
$this->setSecure($secure);
+ $this->constructHttpClient($httpClient);
+ }
+ /**
+ * Construct the http client
+ *
+ * @param ClientInterface $httpClient
+ * @throws RuntimeException
+ * @return void
+ */
+ private function constructHttpClient(ClientInterface $httpClient = null)
+ {
$httpClient = $httpClient ?: new GuzzleClient($this->getBaseUrl());
- if ($httpClient instanceof \Guzzle\Common\HasDispatcherInterface) {
- $apiTokenPlugin = new ApiTokenPlugin($token);
- $httpClient->addSubscriber($apiTokenPlugin);
-
+ if ($httpClient instanceof HasDispatcherInterface) {
$acceptJsonHeaderPlugin = new AcceptJsonHeaderPlugin();
$httpClient->addSubscriber($acceptJsonHeaderPlugin);
+
+ if ($this->getToken() instanceof ApiToken) {
+ $apiTokenPlugin = new ApiTokenPlugin($this->getToken());
+ $httpClient->addSubscriber($apiTokenPlugin);
+ }
+
+ if ($this->cacheEnabled && !empty($this->cachePath)) {
+ if (!class_exists('Doctrine\Common\Cache\FilesystemCache')) {
+ /** @codeCoverageIgnoreStart */
+ throw new RuntimeException(
+ 'Could not find the doctrine cache library, have you added doctrone-cache to your composer.json?'
+ );
+ /** @codeCoverageIgnoreEnd */
+ }
+
+ $cachePlugin = new CachePlugin(array(
+ 'storage' => new DefaultCacheStorage(
+ new DoctrineCacheAdapter(
+ new \Doctrine\Common\Cache\FilesystemCache($this->cachePath)
+ )
+ )
+ )
+ );
+
+ $httpClient->addSubscriber($cachePlugin);
+ }
+
+ if ($this->getSessionToken() instanceof SessionToken) {
+ $sessionTokenPlugin = new SessionTokenPlugin($this->getSessionToken());
+ $httpClient->addSubscriber($sessionTokenPlugin);
+ }
}
$this->httpClient = new HttpClient($this->getBaseUrl(), array(), $httpClient);
@@ -97,12 +156,23 @@ public function __construct(Token $token, ClientInterface $httpClient = null, $s
/**
* Add the token subscriber
*
- * @param Token $token
+ * @return Token
+ */
+ public function getToken()
+ {
+ return $this->token !== null ? $this->token : null;
+ }
+
+ /**
+ * Add the token subscriber
+ *
+ * @param Token $token
* @return $this
*/
public function setToken(Token $token)
{
$this->token = $token;
+
return $this;
}
@@ -283,7 +353,7 @@ public function getCertificationsApi()
}
/**
- * @return HttpClientInterface
+ * @return HttpClient|HttpClientInterface
*/
public function getHttpClient()
{
@@ -313,12 +383,13 @@ public function getBaseUrl()
}
/**
- * @param boolean $secure
+ * @param boolean $secure
* @return $this
*/
public function setSecure($secure)
{
$this->secure = $secure;
+
return $this;
}
@@ -331,17 +402,15 @@ public function getSecure()
}
/**
- * @param SessionToken $sessionToken
+ * @param SessionToken $sessionToken
* @return $this
*/
public function setSessionToken($sessionToken)
{
- if ($this->httpClient->getClient() instanceof \Guzzle\Common\HasDispatcherInterface) {
- $sessionTokenPlugin = new SessionTokenPlugin($sessionToken);
- $this->httpClient->getClient()->addSubscriber($sessionTokenPlugin);
- }
-
$this->sessionToken = $sessionToken;
+
+ $this->constructHttpClient();
+
return $this;
}
@@ -352,4 +421,43 @@ public function getSessionToken()
{
return $this->sessionToken;
}
+
+ /**
+ * @return boolean
+ */
+ public function getCacheEnabled()
+ {
+ return $this->cacheEnabled;
+ }
+
+ /**
+ * Set cache path
+ *
+ * You could simply pass an empty string to let the sys_get_temp_dir be used
+ *
+ * @param boolean $enabled
+ * @param string $path
+ * @return $this
+ */
+ public function setCaching($enabled = true, $path = null)
+ {
+ $this->cacheEnabled = $enabled;
+ $this->cachePath = (null === $path) ?
+ sys_get_temp_dir() . '/php-tmdb-api' :
+ $path
+ ;
+
+ // @todo doesn't cover a custom client, would require un-registering all known plugins
+ $this->constructHttpClient();
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCachePath()
+ {
+ return $this->cachePath;
+ }
}
diff --git a/lib/Tmdb/Common/ObjectHydrator.php b/lib/Tmdb/Common/ObjectHydrator.php
index be4c66c6..979437ae 100644
--- a/lib/Tmdb/Common/ObjectHydrator.php
+++ b/lib/Tmdb/Common/ObjectHydrator.php
@@ -21,12 +21,13 @@
* Class ObjectHydrator
* @package Tmdb\Common
*/
-class ObjectHydrator {
+class ObjectHydrator
+{
/**
* Hydrate the object with data
*
- * @param AbstractModel $object
- * @param array $data
+ * @param AbstractModel $object
+ * @param array $data
* @return AbstractModel
* @throws RuntimeException
*/
@@ -35,7 +36,7 @@ public function hydrate(AbstractModel $object, $data = array())
if (!empty($data)) {
foreach ($data as $k => $v) {
- if (in_array($k, $object::$_properties)) {
+ if (in_array($k, $object::$properties)) {
$method = $this->camelize(
sprintf('set_%s', $k)
@@ -47,7 +48,7 @@ public function hydrate(AbstractModel $object, $data = array())
$method,
get_class($object)
));
- }else{
+ } else {
$object->$method($v);
}
}
@@ -62,20 +63,25 @@ public function hydrate(AbstractModel $object, $data = array())
*
* @see https://gist.github.com/troelskn/751517
*
- * @param string $candidate
+ * @param string $candidate
* @return string
*/
public function camelize($candidate)
{
return lcfirst(
- implode('',
- array_map('ucfirst',
- array_map('strtolower',
- explode('_', $candidate
+ implode(
+ '',
+ array_map(
+ 'ucfirst',
+ array_map(
+ 'strtolower',
+ explode(
+ '_',
+ $candidate
)
)
)
)
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Exception/InvalidArgumentException.php b/lib/Tmdb/Exception/InvalidArgumentException.php
index 023ce8b7..a9ab221f 100644
--- a/lib/Tmdb/Exception/InvalidArgumentException.php
+++ b/lib/Tmdb/Exception/InvalidArgumentException.php
@@ -16,6 +16,6 @@
* Class InvalidArgumentException
* @package Tmdb\Exception
*/
-class InvalidArgumentException extends \InvalidArgumentException {
-
+class InvalidArgumentException extends \InvalidArgumentException
+{
}
diff --git a/lib/Tmdb/Exception/MissingArgumentException.php b/lib/Tmdb/Exception/MissingArgumentException.php
index edbedd87..f2941f92 100644
--- a/lib/Tmdb/Exception/MissingArgumentException.php
+++ b/lib/Tmdb/Exception/MissingArgumentException.php
@@ -16,6 +16,6 @@
* Class MissingArgumentException
* @package Tmdb\Exception
*/
-class MissingArgumentException extends \InvalidArgumentException {
-
+class MissingArgumentException extends \InvalidArgumentException
+{
}
diff --git a/lib/Tmdb/Exception/NotImplementedException.php b/lib/Tmdb/Exception/NotImplementedException.php
index 65659f48..5d26f11a 100644
--- a/lib/Tmdb/Exception/NotImplementedException.php
+++ b/lib/Tmdb/Exception/NotImplementedException.php
@@ -16,6 +16,6 @@
* Class NotImplementedException
* @package Tmdb\Exception
*/
-class NotImplementedException extends \Exception {
-
+class NotImplementedException extends \Exception
+{
}
diff --git a/lib/Tmdb/Exception/RuntimeException.php b/lib/Tmdb/Exception/RuntimeException.php
index a3f6c3e6..f7d8537e 100644
--- a/lib/Tmdb/Exception/RuntimeException.php
+++ b/lib/Tmdb/Exception/RuntimeException.php
@@ -16,6 +16,6 @@
* Class RuntimeException
* @package Tmdb\Exception
*/
-class RuntimeException extends \RuntimeException {
-
+class RuntimeException extends \RuntimeException
+{
}
diff --git a/lib/Tmdb/Exception/UnauthorizedRequestTokenException.php b/lib/Tmdb/Exception/UnauthorizedRequestTokenException.php
index d96a8b58..99e33442 100644
--- a/lib/Tmdb/Exception/UnauthorizedRequestTokenException.php
+++ b/lib/Tmdb/Exception/UnauthorizedRequestTokenException.php
@@ -16,6 +16,6 @@
* Class UnauthorizedRequestTokenException
* @package Tmdb\Exception
*/
-class UnauthorizedRequestTokenException extends \RuntimeException {
-
+class UnauthorizedRequestTokenException extends \RuntimeException
+{
}
diff --git a/lib/Tmdb/Factory/AbstractFactory.php b/lib/Tmdb/Factory/AbstractFactory.php
index f11e9902..d6a8623e 100644
--- a/lib/Tmdb/Factory/AbstractFactory.php
+++ b/lib/Tmdb/Factory/AbstractFactory.php
@@ -21,11 +21,12 @@
* Class AbstractFactory
* @package Tmdb\Factory
*/
-abstract class AbstractFactory {
+abstract class AbstractFactory
+{
/**
* Convert an array to an hydrated object
*
- * @param array $data
+ * @param array $data
* @return AbstractModel
*/
abstract public function create(array $data = array());
@@ -33,19 +34,19 @@ abstract public function create(array $data = array());
/**
* Convert an array with an collection of items to an hydrated object collection
*
- * @param array $data
+ * @param array $data
* @return GenericCollection
*/
abstract public function createCollection(array $data = array());
/**
- * Create a generic collection of data and map it on the class by it's static parameter $_properties
+ * Create a generic collection of data and map it on the class by it's static parameter $properties
*
- * @param array $data
+ * @param array $data
* @param $class
* @return GenericCollection
*/
- protected function createGenericCollection(array $data = array(), $class)
+ protected function createGenericCollection(array $data, $class)
{
if (is_object($class)) {
$class = get_class($class);
@@ -53,7 +54,7 @@ protected function createGenericCollection(array $data = array(), $class)
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->hydrate(new $class(), $item));
}
@@ -63,8 +64,8 @@ protected function createGenericCollection(array $data = array(), $class)
/**
* Create a result collection
*
- * @param array $data
- * @param string $method
+ * @param array $data
+ * @param string $method
* @return ResultCollection
*/
public function createResultCollection(array $data = array(), $method = 'create')
@@ -87,7 +88,7 @@ public function createResultCollection(array $data = array(), $method = 'create'
$data = $data['results'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->$method($item));
}
@@ -97,8 +98,8 @@ public function createResultCollection(array $data = array(), $method = 'create'
/**
* Hydrate the object with data
*
- * @param AbstractModel $object
- * @param array $data
+ * @param AbstractModel $object
+ * @param array $data
* @return AbstractModel
*/
protected function hydrate(AbstractModel $object, $data = array())
diff --git a/lib/Tmdb/Factory/AccountFactory.php b/lib/Tmdb/Factory/AccountFactory.php
index 85c066ca..a3289bb9 100644
--- a/lib/Tmdb/Factory/AccountFactory.php
+++ b/lib/Tmdb/Factory/AccountFactory.php
@@ -61,17 +61,18 @@ public function createStatusResult(array $data = array())
/**
* Create movie
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\Movie
*/
- public function createMovie(array $data = array()) {
+ public function createMovie(array $data = array())
+ {
return $this->getMovieFactory()->create($data);
}
/**
* Create list item
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\AbstractModel
*/
public function createListItem(array $data = array())
@@ -94,12 +95,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\MovieFactory $movieFactory
+ * @param \Tmdb\Factory\MovieFactory $movieFactory
* @return $this
*/
public function setMovieFactory($movieFactory)
{
$this->movieFactory = $movieFactory;
+
return $this;
}
@@ -112,12 +114,13 @@ public function getMovieFactory()
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/AuthenticationFactory.php b/lib/Tmdb/Factory/AuthenticationFactory.php
index 38b61d9e..3ec8ffd4 100644
--- a/lib/Tmdb/Factory/AuthenticationFactory.php
+++ b/lib/Tmdb/Factory/AuthenticationFactory.php
@@ -47,7 +47,7 @@ public function createCollection(array $data = array())
/**
* Create request token
*
- * @param array $data
+ * @param array $data
* @return RequestToken
*/
public function createRequestToken(array $data = array())
@@ -72,7 +72,7 @@ public function createRequestToken(array $data = array())
/**
* Create session token for user
*
- * @param array $data
+ * @param array $data
* @return SessionToken
*/
public function createSessionToken(array $data = array())
@@ -93,7 +93,7 @@ public function createSessionToken(array $data = array())
/**
* Create session token for guest
*
- * @param array $data
+ * @param array $data
* @return SessionToken
*/
public function createGuestSessionToken(array $data = array())
diff --git a/lib/Tmdb/Factory/CertificationFactory.php b/lib/Tmdb/Factory/CertificationFactory.php
index 6b92f418..db86dfe9 100644
--- a/lib/Tmdb/Factory/CertificationFactory.php
+++ b/lib/Tmdb/Factory/CertificationFactory.php
@@ -42,11 +42,11 @@ public function createCollection(array $data = array())
$collection = new GenericCollection();
- foreach($data as $country => $certifications) {
+ foreach ($data as $country => $certifications) {
$certification = new Certification();
$certification->setCountry($country);
- foreach($certifications as $countryCertification) {
+ foreach ($certifications as $countryCertification) {
$object = $this->create($countryCertification);
$certification->getCertifications()->add(null, $object);
diff --git a/lib/Tmdb/Factory/ChangesFactory.php b/lib/Tmdb/Factory/ChangesFactory.php
index ba21489a..aca66433 100644
--- a/lib/Tmdb/Factory/ChangesFactory.php
+++ b/lib/Tmdb/Factory/ChangesFactory.php
@@ -53,7 +53,7 @@ public function createCollection(array $data = array())
$data = $data['results'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
diff --git a/lib/Tmdb/Factory/CollectionFactory.php b/lib/Tmdb/Factory/CollectionFactory.php
index f1c29e2d..b1ccf955 100644
--- a/lib/Tmdb/Factory/CollectionFactory.php
+++ b/lib/Tmdb/Factory/CollectionFactory.php
@@ -55,15 +55,21 @@ public function create(array $data = array())
}
if (array_key_exists('backdrop_path', $data)) {
- $collection->setBackdropImage($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path'));
+ $collection->setBackdropImage(
+ $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
+ );
}
if (array_key_exists('images', $data)) {
- $collection->setImages($this->getImageFactory()->createCollectionFromMovie($data['images']));
+ $collection->setImages(
+ $this->getImageFactory()->createCollectionFromMovie($data['images'])
+ );
}
if (array_key_exists('poster_path', $data)) {
- $collection->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
+ $collection->setPosterImage(
+ $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
+ );
}
return $this->hydrate($collection, $data);
@@ -76,7 +82,7 @@ public function createCollection(array $data = array())
{
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -84,12 +90,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -102,12 +109,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\MovieFactory $movieFactory
+ * @param \Tmdb\Factory\MovieFactory $movieFactory
* @return $this
*/
public function setMovieFactory($movieFactory)
{
$this->movieFactory = $movieFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/Common/ChangeFactory.php b/lib/Tmdb/Factory/Common/ChangeFactory.php
index 896ae1a7..37c6de9b 100644
--- a/lib/Tmdb/Factory/Common/ChangeFactory.php
+++ b/lib/Tmdb/Factory/Common/ChangeFactory.php
@@ -32,7 +32,7 @@ public function create(array $data = array())
if (array_key_exists('items', $data)) {
$items = new GenericCollection();
- foreach($data['items'] as $item) {
+ foreach ($data['items'] as $item) {
$item = $this->createChangeItem($item);
$items->add(null, $item);
@@ -47,7 +47,7 @@ public function create(array $data = array())
/**
* Create individual change items
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\AbstractModel
*/
private function createChangeItem(array $data = array())
@@ -66,7 +66,7 @@ public function createCollection(array $data = array())
$data = $data['changes'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
diff --git a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php
index 90cf3ce2..38fe2d67 100644
--- a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php
+++ b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php
@@ -21,23 +21,24 @@
* Class GenericCollectionFactory
* @package Tmdb\Factory\Common
*/
-class GenericCollectionFactory {
+class GenericCollectionFactory
+{
/**
- * @param array $data
+ * @param array $data
* @param $class
* @return GenericCollection
*/
- public function create(array $data = array(), $class)
+ public function create(array $data, $class)
{
return $this->createCollection($data, $class);
}
/**
- * @param array $data
+ * @param array $data
* @param $class
* @return GenericCollection
*/
- public function createCollection(array $data = array(), $class)
+ public function createCollection(array $data, $class)
{
if (is_object($class)) {
$class = get_class($class);
@@ -46,7 +47,7 @@ public function createCollection(array $data = array(), $class)
$collection = new GenericCollection();
$objectHydrator = new ObjectHydrator();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $objectHydrator->hydrate(new $class(), $item));
}
diff --git a/lib/Tmdb/Factory/CompanyFactory.php b/lib/Tmdb/Factory/CompanyFactory.php
index 7fac2dda..6065fefc 100644
--- a/lib/Tmdb/Factory/CompanyFactory.php
+++ b/lib/Tmdb/Factory/CompanyFactory.php
@@ -56,12 +56,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/CreditsFactory.php b/lib/Tmdb/Factory/CreditsFactory.php
index 5b33634d..ac6c129d 100644
--- a/lib/Tmdb/Factory/CreditsFactory.php
+++ b/lib/Tmdb/Factory/CreditsFactory.php
@@ -14,7 +14,6 @@
use Tmdb\Exception\NotImplementedException;
use Tmdb\Model\Genre;
-use Tmdb\Model\Movie;
use Tmdb\Model\Credits as Credits;
/**
@@ -85,16 +84,20 @@ public function create(array $data = array())
*/
public function createCollection(array $data = array())
{
- throw new NotImplementedException('Credits are usually obtained through the PeopleFactory, however we might add a shortcut for that here.');
+ throw new NotImplementedException(
+ 'Credits are usually obtained through the PeopleFactory,
+ however we might add a shortcut for that here.'
+ );
}
/**
- * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory
+ * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory
* @return $this
*/
public function setTvEpisodeFactory($tvEpisodeFactory)
{
$this->tvEpisodeFactory = $tvEpisodeFactory;
+
return $this;
}
@@ -107,12 +110,13 @@ public function getTvEpisodeFactory()
}
/**
- * @param \Tmdb\Factory\TvSeasonFactory $tvSeasonFactory
+ * @param \Tmdb\Factory\TvSeasonFactory $tvSeasonFactory
* @return $this
*/
public function setTvSeasonFactory($tvSeasonFactory)
{
$this->tvSeasonFactory = $tvSeasonFactory;
+
return $this;
}
@@ -125,12 +129,13 @@ public function getTvSeasonFactory()
}
/**
- * @param \Tmdb\Factory\PeopleFactory $peopleFactory
+ * @param \Tmdb\Factory\PeopleFactory $peopleFactory
* @return $this
*/
public function setPeopleFactory($peopleFactory)
{
$this->peopleFactory = $peopleFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/FindFactory.php b/lib/Tmdb/Factory/FindFactory.php
index cba3716d..dd6fb3d9 100644
--- a/lib/Tmdb/Factory/FindFactory.php
+++ b/lib/Tmdb/Factory/FindFactory.php
@@ -77,12 +77,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\MovieFactory $movieFactory
+ * @param \Tmdb\Factory\MovieFactory $movieFactory
* @return $this
*/
public function setMovieFactory($movieFactory)
{
$this->movieFactory = $movieFactory;
+
return $this;
}
@@ -95,12 +96,13 @@ public function getMovieFactory()
}
/**
- * @param \Tmdb\Factory\PeopleFactory $peopleFactory
+ * @param \Tmdb\Factory\PeopleFactory $peopleFactory
* @return $this
*/
public function setPeopleFactory($peopleFactory)
{
$this->peopleFactory = $peopleFactory;
+
return $this;
}
@@ -113,12 +115,13 @@ public function getPeopleFactory()
}
/**
- * @param \Tmdb\Factory\TvFactory $tvFactory
+ * @param \Tmdb\Factory\TvFactory $tvFactory
* @return $this
*/
public function setTvFactory($tvFactory)
{
$this->tvFactory = $tvFactory;
+
return $this;
}
@@ -129,6 +132,4 @@ public function getTvFactory()
{
return $this->tvFactory;
}
-
-
}
diff --git a/lib/Tmdb/Factory/GenreFactory.php b/lib/Tmdb/Factory/GenreFactory.php
index f87116d3..548d3ebd 100644
--- a/lib/Tmdb/Factory/GenreFactory.php
+++ b/lib/Tmdb/Factory/GenreFactory.php
@@ -14,7 +14,6 @@
use Tmdb\Model\Collection\Genres;
use Tmdb\Model\Genre;
-use Tmdb\Model\Movie;
/**
* Class GenreFactory
@@ -43,7 +42,7 @@ public function createCollection(array $data = array())
$data = $data['genres'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->addGenre($this->create($item));
}
diff --git a/lib/Tmdb/Factory/ImageFactory.php b/lib/Tmdb/Factory/ImageFactory.php
index f1d0a2e3..3d38d7fc 100644
--- a/lib/Tmdb/Factory/ImageFactory.php
+++ b/lib/Tmdb/Factory/ImageFactory.php
@@ -24,8 +24,8 @@ class ImageFactory extends AbstractFactory
/**
* Convert an array to an hydrated object
*
- * @param array $data
- * @param string|null $key
+ * @param array $data
+ * @param string|null $key
* @return Image
*/
public function create(array $data = array(), $key = null)
@@ -41,7 +41,7 @@ public function create(array $data = array(), $key = null)
* '/xkQ5yWnMjpC2bGmu7GsD66AAoKO.jpg', 'backdrop_path'
*
* @param $path
- * @param string $key
+ * @param string $key
* @return Image|Image\BackdropImage|Image\LogoImage|Image\PosterImage|Image\ProfileImage|Image\StillImage
*/
public function createFromPath($path, $key)
@@ -55,12 +55,12 @@ public function createFromPath($path, $key)
/**
* Helper function to obtain a new object for an image type
*
- * @param string|null $key
+ * @param string|null $key
* @return Image|Image\BackdropImage|Image\LogoImage|Image\PosterImage|Image\ProfileImage|Image\StillImage
*/
public function resolveImageType($key = null)
{
- switch($key) {
+ switch ($key) {
case 'poster':
case 'posters':
case 'poster_path':
@@ -103,14 +103,14 @@ public function resolveImageType($key = null)
/**
* Create generic collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollection(array $data = array())
{
$collection = new Images();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -120,21 +120,21 @@ public function createCollection(array $data = array())
/**
* Create full collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createImageCollection(array $data = array())
{
$collection = new Images();
- foreach($data as $format => $formatCollection) {
+ foreach ($data as $format => $formatCollection) {
if (!is_array($formatCollection)) {
continue;
}
- foreach($formatCollection as $item) {
- if (array_key_exists($format, Image::$_formats)) {
+ foreach ($formatCollection as $item) {
+ if (array_key_exists($format, Image::$formats)) {
$item = $this->create($item, $format);
$collection->addImage($item);
@@ -148,7 +148,7 @@ public function createImageCollection(array $data = array())
/**
* Create full movie collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollectionFromMovie(array $data = array())
@@ -159,7 +159,7 @@ public function createCollectionFromMovie(array $data = array())
/**
* Create full tv show collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollectionFromTv(array $data = array())
@@ -170,7 +170,7 @@ public function createCollectionFromTv(array $data = array())
/**
* Create full tv season collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollectionFromTvSeason(array $data = array())
@@ -181,7 +181,7 @@ public function createCollectionFromTvSeason(array $data = array())
/**
* Create full tv episode collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollectionFromTvEpisode(array $data = array())
@@ -192,7 +192,7 @@ public function createCollectionFromTvEpisode(array $data = array())
/**
* Create full people collection
*
- * @param array $data
+ * @param array $data
* @return Images
*/
public function createCollectionFromPeople(array $data = array())
diff --git a/lib/Tmdb/Factory/JobsFactory.php b/lib/Tmdb/Factory/JobsFactory.php
index 07725155..c644f2b3 100644
--- a/lib/Tmdb/Factory/JobsFactory.php
+++ b/lib/Tmdb/Factory/JobsFactory.php
@@ -40,7 +40,7 @@ public function createCollection(array $data = array())
$data = $data['jobs'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
diff --git a/lib/Tmdb/Factory/KeywordFactory.php b/lib/Tmdb/Factory/KeywordFactory.php
index 2fe2c650..e7d3a038 100644
--- a/lib/Tmdb/Factory/KeywordFactory.php
+++ b/lib/Tmdb/Factory/KeywordFactory.php
@@ -14,7 +14,6 @@
use Tmdb\Model\Collection\Keywords;
use Tmdb\Model\Keyword;
-use Tmdb\Model\Movie;
/**
* Class KeywordFactory
@@ -43,7 +42,7 @@ public function createCollection(array $data = array())
$data = $data['keywords'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->addKeyword($this->create($item));
}
diff --git a/lib/Tmdb/Factory/ListFactory.php b/lib/Tmdb/Factory/ListFactory.php
index 11e33b2d..363e047d 100644
--- a/lib/Tmdb/Factory/ListFactory.php
+++ b/lib/Tmdb/Factory/ListFactory.php
@@ -16,7 +16,6 @@
use Tmdb\Model\Common\GenericCollection;
use Tmdb\Model\Genre;
use Tmdb\Model\Lists;
-use Tmdb\Model\Movie;
/**
* Class ListFactory
@@ -100,7 +99,7 @@ public function createCollection(array $data = array())
{
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -108,12 +107,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -126,12 +126,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\Lists\ListItemFactory $listItemFactory
+ * @param \Tmdb\Factory\Lists\ListItemFactory $listItemFactory
* @return $this
*/
public function setListItemFactory($listItemFactory)
{
$this->listItemFactory = $listItemFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/Lists/ListItemFactory.php b/lib/Tmdb/Factory/Lists/ListItemFactory.php
index 208cc9db..cda36e06 100644
--- a/lib/Tmdb/Factory/Lists/ListItemFactory.php
+++ b/lib/Tmdb/Factory/Lists/ListItemFactory.php
@@ -44,11 +44,15 @@ public function create(array $data = array())
/** Images */
if (array_key_exists('backdrop_path', $data)) {
- $listItem->setBackdropImage($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path'));
+ $listItem->setBackdropImage(
+ $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
+ );
}
if (array_key_exists('poster_path', $data)) {
- $listItem->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
+ $listItem->setPosterImage(
+ $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
+ );
}
return $this->hydrate($listItem, $data);
@@ -65,7 +69,7 @@ public function createCollection(array $data = array())
$data = $data['items'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -73,12 +77,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/Movie/AlternativeTitleFactory.php b/lib/Tmdb/Factory/Movie/AlternativeTitleFactory.php
index 7195f5b0..138e9722 100644
--- a/lib/Tmdb/Factory/Movie/AlternativeTitleFactory.php
+++ b/lib/Tmdb/Factory/Movie/AlternativeTitleFactory.php
@@ -39,7 +39,7 @@ public function createCollection(array $data = array())
{
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
diff --git a/lib/Tmdb/Factory/Movie/ListItemFactory.php b/lib/Tmdb/Factory/Movie/ListItemFactory.php
index 3ca64eae..347a17b8 100644
--- a/lib/Tmdb/Factory/Movie/ListItemFactory.php
+++ b/lib/Tmdb/Factory/Movie/ListItemFactory.php
@@ -52,12 +52,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/MovieFactory.php b/lib/Tmdb/Factory/MovieFactory.php
index dac55bc5..8e4429d1 100644
--- a/lib/Tmdb/Factory/MovieFactory.php
+++ b/lib/Tmdb/Factory/MovieFactory.php
@@ -26,7 +26,8 @@
* Class MovieFactory
* @package Tmdb\Factory
*/
-class MovieFactory extends AbstractFactory {
+class MovieFactory extends AbstractFactory
+{
/**
* @var People\CastFactory
*/
@@ -83,7 +84,7 @@ public function __construct()
}
/**
- * @param array $data
+ * @param array $data
* @return Movie
*/
public function create(array $data = array())
@@ -138,14 +139,20 @@ public function create(array $data = array())
}
/**
- * @TODO actually implement more providers? ( Can't seem to find any quicktime related trailers anyways? ). For now KISS
+ * @TODO actually implement more providers?
+ * ( Can't seem to find any quicktime related trailers anyways? ). For now KISS
*/
if (array_key_exists('trailers', $data) && array_key_exists('youtube', $data['trailers'])) {
$movie->setTrailers($this->createGenericCollection($data['trailers']['youtube'], new Youtube()));
}
if (array_key_exists('translations', $data) && array_key_exists('translations', $data['translations'])) {
- $movie->setTranslations($this->createGenericCollection($data['translations']['translations'], new Translation()));
+ $movie->setTranslations(
+ $this->createGenericCollection(
+ $data['translations']['translations'],
+ new Translation()
+ )
+ );
}
if (array_key_exists('similar_movies', $data)) {
@@ -178,7 +185,7 @@ public function createCollection(array $data = array())
$data = $data['results'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -188,27 +195,29 @@ public function createCollection(array $data = array())
/**
* Create result
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\AbstractModel
*/
- public function createResult(array $data = array()) {
+ public function createResult(array $data = array())
+ {
return $this->hydrate(new Result(), $data);
}
/**
* Create rating
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\AbstractModel
*/
- public function createRating(array $data = array()) {
+ public function createRating(array $data = array())
+ {
return $this->hydrate(new Movie\Rating(), $data);
}
/**
* Create the account states
*
- * @param array $data
+ * @param array $data
* @return \Tmdb\Model\AbstractModel
*/
public function createAccountStates(array $data = array())
@@ -225,12 +234,13 @@ public function createAccountStates(array $data = array())
}
/**
- * @param \Tmdb\Factory\People\CastFactory $castFactory
+ * @param \Tmdb\Factory\People\CastFactory $castFactory
* @return $this
*/
public function setCastFactory($castFactory)
{
$this->castFactory = $castFactory;
+
return $this;
}
@@ -243,12 +253,13 @@ public function getCastFactory()
}
/**
- * @param \Tmdb\Factory\People\CrewFactory $crewFactory
+ * @param \Tmdb\Factory\People\CrewFactory $crewFactory
* @return $this
*/
public function setCrewFactory($crewFactory)
{
$this->crewFactory = $crewFactory;
+
return $this;
}
@@ -261,12 +272,13 @@ public function getCrewFactory()
}
/**
- * @param \Tmdb\Factory\GenreFactory $genreFactory
+ * @param \Tmdb\Factory\GenreFactory $genreFactory
* @return $this
*/
public function setGenreFactory($genreFactory)
{
$this->genreFactory = $genreFactory;
+
return $this;
}
@@ -279,12 +291,13 @@ public function getGenreFactory()
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -297,12 +310,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\Common\ChangeFactory $changeFactory
+ * @param \Tmdb\Factory\Common\ChangeFactory $changeFactory
* @return $this
*/
public function setChangeFactory($changeFactory)
{
$this->changeFactory = $changeFactory;
+
return $this;
}
@@ -315,12 +329,13 @@ public function getChangeFactory()
}
/**
- * @param \Tmdb\Factory\ReviewFactory $reviewFactory
+ * @param \Tmdb\Factory\ReviewFactory $reviewFactory
* @return $this
*/
public function setReviewFactory($reviewFactory)
{
$this->reviewFactory = $reviewFactory;
+
return $this;
}
@@ -333,12 +348,13 @@ public function getReviewFactory()
}
/**
- * @param \Tmdb\Factory\Movie\ListItemFactory $listItemFactory
+ * @param \Tmdb\Factory\Movie\ListItemFactory $listItemFactory
* @return $this
*/
public function setListItemFactory($listItemFactory)
{
$this->listItemFactory = $listItemFactory;
+
return $this;
}
@@ -351,12 +367,13 @@ public function getListItemFactory()
}
/**
- * @param \Tmdb\Factory\KeywordFactory $keywordFactory
+ * @param \Tmdb\Factory\KeywordFactory $keywordFactory
* @return $this
*/
public function setKeywordFactory($keywordFactory)
{
$this->keywordFactory = $keywordFactory;
+
return $this;
}
@@ -367,4 +384,4 @@ public function getKeywordFactory()
{
return $this->keywordFactory;
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Factory/NetworkFactory.php b/lib/Tmdb/Factory/NetworkFactory.php
index fd2cc67f..39a6b212 100644
--- a/lib/Tmdb/Factory/NetworkFactory.php
+++ b/lib/Tmdb/Factory/NetworkFactory.php
@@ -14,7 +14,6 @@
use Tmdb\Model\Common\GenericCollection;
use Tmdb\Model\Network;
-use Tmdb\Model\Movie;
/**
* Class NetworkFactory
@@ -43,7 +42,7 @@ public function createCollection(array $data = array())
$data = $data['networks'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
diff --git a/lib/Tmdb/Factory/People/CastFactory.php b/lib/Tmdb/Factory/People/CastFactory.php
index 09300754..f1b66d16 100644
--- a/lib/Tmdb/Factory/People/CastFactory.php
+++ b/lib/Tmdb/Factory/People/CastFactory.php
@@ -39,12 +39,11 @@ public function createCollection(array $data = array(), $person = null)
if (is_object($person)) {
$class = get_class($person);
- }
- else{
+ } else {
$class = '\Tmdb\Model\Person\CastMember';
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item, new $class()));
}
diff --git a/lib/Tmdb/Factory/People/CrewFactory.php b/lib/Tmdb/Factory/People/CrewFactory.php
index ae9bf8ec..841cb054 100644
--- a/lib/Tmdb/Factory/People/CrewFactory.php
+++ b/lib/Tmdb/Factory/People/CrewFactory.php
@@ -39,12 +39,11 @@ public function createCollection(array $data = array(), $person = null)
if (is_object($person)) {
$class = get_class($person);
- }
- else{
+ } else {
$class = '\Tmdb\Model\Person\CrewMember';
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item, new $class()));
}
diff --git a/lib/Tmdb/Factory/PeopleFactory.php b/lib/Tmdb/Factory/PeopleFactory.php
index a46b8901..91a04f44 100644
--- a/lib/Tmdb/Factory/PeopleFactory.php
+++ b/lib/Tmdb/Factory/PeopleFactory.php
@@ -24,7 +24,8 @@
* Class PeopleFactory
* @package Tmdb\Factory
*/
-class PeopleFactory extends AbstractFactory {
+class PeopleFactory extends AbstractFactory
+{
/**
* @var ImageFactory
*/
@@ -45,7 +46,7 @@ public function __construct()
}
/**
- * @param array $data
+ * @param array $data
* @param Person\AbstractMember|null $person
*
* @return Person|CrewMember|CastMember
@@ -97,14 +98,15 @@ public function create(array $data = array(), $person = null)
/**
* Apply credits
*
- * @param array $data
+ * @param array $data
* @param Person $person
*/
- protected function applyCredits(array $data = array(), Person $person) {
+ protected function applyCredits(array $data, Person $person)
+ {
$hydrator = new ObjectHydrator();
$types = array('movie_credits', 'tv_credits', 'combined_credits');
- foreach($types as $type) {
+ foreach ($types as $type) {
if (array_key_exists($type, $data)) {
$method = $hydrator->camelize(sprintf('get_%s', $type));
@@ -114,7 +116,7 @@ protected function applyCredits(array $data = array(), Person $person) {
new Person\MovieCredit()
);
- foreach($cast as $member) {
+ foreach ($cast as $member) {
$member->setPosterImage($member->getPosterPath());
}
@@ -127,7 +129,7 @@ protected function applyCredits(array $data = array(), Person $person) {
new Person\MovieCredit()
);
- foreach($crew as $member) {
+ foreach ($crew as $member) {
$member->setPosterImage($member->getPosterPath());
}
@@ -157,24 +159,25 @@ public function createCollection(array $data = array(), $person = null, $collect
if (is_object($person)) {
$class = get_class($person);
- }
- else{
+ } else {
$class = '\Tmdb\Model\Person';
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item, new $class()));
}
+
return $collection;
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -187,12 +190,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\Common\ChangeFactory $changeFactory
+ * @param \Tmdb\Factory\Common\ChangeFactory $changeFactory
* @return $this
*/
public function setChangeFactory($changeFactory)
{
$this->changeFactory = $changeFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/TvEpisodeFactory.php b/lib/Tmdb/Factory/TvEpisodeFactory.php
index bc40a9a1..e8ce8481 100644
--- a/lib/Tmdb/Factory/TvEpisodeFactory.php
+++ b/lib/Tmdb/Factory/TvEpisodeFactory.php
@@ -24,7 +24,8 @@
* Class TvEpisodeFactory
* @package Tmdb\Factory
*/
-class TvEpisodeFactory extends AbstractFactory {
+class TvEpisodeFactory extends AbstractFactory
+{
/**
* @var People\CastFactory
*/
@@ -63,16 +64,23 @@ public function create(array $data = array())
if (array_key_exists('credits', $data)) {
if (array_key_exists('cast', $data['credits'])) {
- $tvEpisode->getCredits()->setCast(
- $this->getCastFactory()->createCollection($data['credits']['cast'],
- new CastMember())
- );
+ $tvEpisode
+ ->getCredits()
+ ->setCast(
+ $this->getCastFactory()
+ ->createCollection(
+ $data['credits']['cast'],
+ new CastMember()
+ )
+ );
}
if (array_key_exists('crew', $data['credits'])) {
$tvEpisode->getCredits()->setCrew(
- $this->getCrewFactory()->createCollection($data['credits']['crew'],
- new CrewMember())
+ $this->getCrewFactory()->createCollection(
+ $data['credits']['crew'],
+ new CrewMember()
+ )
);
}
}
@@ -103,7 +111,7 @@ public function createCollection(array $data = array())
{
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -111,12 +119,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\People\CastFactory $castFactory
+ * @param \Tmdb\Factory\People\CastFactory $castFactory
* @return $this
*/
public function setCastFactory($castFactory)
{
$this->castFactory = $castFactory;
+
return $this;
}
@@ -129,12 +138,13 @@ public function getCastFactory()
}
/**
- * @param \Tmdb\Factory\People\CrewFactory $crewFactory
+ * @param \Tmdb\Factory\People\CrewFactory $crewFactory
* @return $this
*/
public function setCrewFactory($crewFactory)
{
$this->crewFactory = $crewFactory;
+
return $this;
}
@@ -147,12 +157,13 @@ public function getCrewFactory()
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/TvFactory.php b/lib/Tmdb/Factory/TvFactory.php
index 0b1d1091..1ad6c7e0 100644
--- a/lib/Tmdb/Factory/TvFactory.php
+++ b/lib/Tmdb/Factory/TvFactory.php
@@ -25,7 +25,8 @@
* Class TvFactory
* @package Tmdb\Factory
*/
-class TvFactory extends AbstractFactory {
+class TvFactory extends AbstractFactory
+{
/**
* @var People\CastFactory
*/
@@ -84,11 +85,21 @@ public function create(array $data = array())
if (array_key_exists('credits', $data)) {
if (array_key_exists('cast', $data['credits'])) {
- $tvShow->getCredits()->setCast($this->getCastFactory()->createCollection($data['credits']['cast'], new CastMember()));
+ $tvShow->getCredits()->setCast(
+ $this->getCastFactory()->createCollection(
+ $data['credits']['cast'],
+ new CastMember()
+ )
+ );
}
if (array_key_exists('crew', $data['credits'])) {
- $tvShow->getCredits()->setCrew($this->getCrewFactory()->createCollection($data['credits']['crew'], new CrewMember()));
+ $tvShow->getCredits()->setCrew(
+ $this->getCrewFactory()->createCollection(
+ $data['credits']['crew'],
+ new CrewMember()
+ )
+ );
}
}
@@ -106,20 +117,28 @@ public function create(array $data = array())
/** Images */
if (array_key_exists('images', $data)) {
- $tvShow->setImages($this->getImageFactory()->createCollectionFromTv($data['images']));
+ $tvShow->setImages(
+ $this->getImageFactory()->createCollectionFromTv($data['images'])
+ );
}
if (array_key_exists('backdrop_path', $data)) {
- $tvShow->setBackdropImage($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path'));
+ $tvShow->setBackdropImage(
+ $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
+ );
}
if (array_key_exists('poster_path', $data)) {
- $tvShow->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
+ $tvShow->setPosterImage(
+ $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
+ );
}
/** Translations */
if (array_key_exists('translations', $data) && null !== $data['translations']) {
- $tvShow->setTranslations($this->createGenericCollection($data['translations']['translations'], new Translation()));
+ $tvShow->setTranslations(
+ $this->createGenericCollection($data['translations']['translations'], new Translation())
+ );
}
/** Seasons */
@@ -146,7 +165,7 @@ public function createCollection(array $data = array())
$data = $data['results'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -154,12 +173,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\People\CastFactory $castFactory
+ * @param \Tmdb\Factory\People\CastFactory $castFactory
* @return $this
*/
public function setCastFactory($castFactory)
{
$this->castFactory = $castFactory;
+
return $this;
}
@@ -172,12 +192,13 @@ public function getCastFactory()
}
/**
- * @param \Tmdb\Factory\People\CrewFactory $crewFactory
+ * @param \Tmdb\Factory\People\CrewFactory $crewFactory
* @return $this
*/
public function setCrewFactory($crewFactory)
{
$this->crewFactory = $crewFactory;
+
return $this;
}
@@ -190,12 +211,13 @@ public function getCrewFactory()
}
/**
- * @param \Tmdb\Factory\GenreFactory $genreFactory
+ * @param \Tmdb\Factory\GenreFactory $genreFactory
* @return $this
*/
public function setGenreFactory($genreFactory)
{
$this->genreFactory = $genreFactory;
+
return $this;
}
@@ -208,12 +230,13 @@ public function getGenreFactory()
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -226,12 +249,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\TvSeasonFactory $tvSeasonFactory
+ * @param \Tmdb\Factory\TvSeasonFactory $tvSeasonFactory
* @return $this
*/
public function setTvSeasonFactory($tvSeasonFactory)
{
$this->tvSeasonFactory = $tvSeasonFactory;
+
return $this;
}
@@ -244,12 +268,13 @@ public function getTvSeasonFactory()
}
/**
- * @param \Tmdb\Factory\NetworkFactory $networkFactory
+ * @param \Tmdb\Factory\NetworkFactory $networkFactory
* @return $this
*/
public function setNetworkFactory($networkFactory)
{
$this->networkFactory = $networkFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Factory/TvSeasonFactory.php b/lib/Tmdb/Factory/TvSeasonFactory.php
index 78fc88d1..f3598a03 100644
--- a/lib/Tmdb/Factory/TvSeasonFactory.php
+++ b/lib/Tmdb/Factory/TvSeasonFactory.php
@@ -24,7 +24,8 @@
* Class TvSeasonFactory
* @package Tmdb\Factory
*/
-class TvSeasonFactory extends AbstractFactory {
+class TvSeasonFactory extends AbstractFactory
+{
/**
* @var People\CastFactory
*/
@@ -69,11 +70,21 @@ public function create(array $data = array())
if (array_key_exists('credits', $data)) {
if (array_key_exists('cast', $data['credits'])) {
- $tvSeason->getCredits()->setCast($this->getCastFactory()->createCollection($data['credits']['cast'], new CastMember()));
+ $tvSeason->getCredits()->setCast(
+ $this->getCastFactory()->createCollection(
+ $data['credits']['cast'],
+ new CastMember()
+ )
+ );
}
if (array_key_exists('crew', $data['credits'])) {
- $tvSeason->getCredits()->setCrew($this->getCrewFactory()->createCollection($data['credits']['crew'], new CrewMember()));
+ $tvSeason->getCredits()->setCrew(
+ $this->getCrewFactory()->createCollection(
+ $data['credits']['crew'],
+ new CrewMember()
+ )
+ );
}
}
@@ -108,7 +119,7 @@ public function createCollection(array $data = array())
{
$collection = new GenericCollection();
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->create($item));
}
@@ -116,12 +127,13 @@ public function createCollection(array $data = array())
}
/**
- * @param \Tmdb\Factory\People\CastFactory $castFactory
+ * @param \Tmdb\Factory\People\CastFactory $castFactory
* @return $this
*/
public function setCastFactory($castFactory)
{
$this->castFactory = $castFactory;
+
return $this;
}
@@ -134,12 +146,13 @@ public function getCastFactory()
}
/**
- * @param \Tmdb\Factory\People\CrewFactory $crewFactory
+ * @param \Tmdb\Factory\People\CrewFactory $crewFactory
* @return $this
*/
public function setCrewFactory($crewFactory)
{
$this->crewFactory = $crewFactory;
+
return $this;
}
@@ -152,12 +165,13 @@ public function getCrewFactory()
}
/**
- * @param \Tmdb\Factory\ImageFactory $imageFactory
+ * @param \Tmdb\Factory\ImageFactory $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -170,12 +184,13 @@ public function getImageFactory()
}
/**
- * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory
+ * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory
* @return $this
*/
public function setTvEpisodeFactory($tvEpisodeFactory)
{
$this->tvEpisodeFactory = $tvEpisodeFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Helper/ImageHelper.php b/lib/Tmdb/Helper/ImageHelper.php
index c5f94fce..6d2755f4 100644
--- a/lib/Tmdb/Helper/ImageHelper.php
+++ b/lib/Tmdb/Helper/ImageHelper.php
@@ -19,8 +19,8 @@
* Class ImageHelper
* @package Tmdb\Helper
*/
-class ImageHelper {
-
+class ImageHelper
+{
private $config;
public function __construct(Configuration $config)
@@ -41,11 +41,12 @@ public function getImageConfiguration()
/**
* Get the url for the image resource
*
- * @param Image $image
- * @param string $size
+ * @param Image $image
+ * @param string $size
* @return string
*/
- public function getUrl(Image $image, $size = 'original') {
+ public function getUrl(Image $image, $size = 'original')
+ {
$config = $this->getImageConfiguration();
return $config['base_url'] . $size . $image->getFilePath();
@@ -54,13 +55,14 @@ public function getUrl(Image $image, $size = 'original') {
/**
* Get an img html tag for the image in the specified size
*
- * @param Image $image
- * @param string $size
- * @param int|null $width
- * @param int|null $height
+ * @param Image $image
+ * @param string $size
+ * @param int|null $width
+ * @param int|null $height
* @return string
*/
- public function getHtml(Image $image, $size = 'original', $width = null, $height = null) {
+ public function getHtml(Image $image, $size = 'original', $width = null, $height = null)
+ {
if (null == $image->getFilePath()) {
return '';
}
diff --git a/lib/Tmdb/HttpClient/HttpClient.php b/lib/Tmdb/HttpClient/HttpClient.php
index 76554c25..8618e0c3 100644
--- a/lib/Tmdb/HttpClient/HttpClient.php
+++ b/lib/Tmdb/HttpClient/HttpClient.php
@@ -22,8 +22,7 @@
* Class HttpClient
* @package Tmdb\HttpClient
*/
-class HttpClient
- implements HttpClientInterface
+class HttpClient implements HttpClientInterface
{
/**
* @var \Guzzle\Http\ClientInterface
@@ -46,8 +45,8 @@ class HttpClient
/**
* Constructor
*
- * @param string $baseUrl
- * @param array $options
+ * @param string $baseUrl
+ * @param array $options
* @param ClientInterface $client
*/
public function __construct($baseUrl, array $options, ClientInterface $client)
@@ -171,9 +170,7 @@ public function request(RequestInterface $request)
try {
$response = $request->send();
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
// @TODO catch any API errors / timeouts / other specific information from Guzzle?
throw $e;
}
@@ -185,12 +182,13 @@ public function request(RequestInterface $request)
}
/**
- * @param \Guzzle\Http\ClientInterface $client
+ * @param \Guzzle\Http\ClientInterface $client
* @return $this
*/
public function setClient($client)
{
$this->client = $client;
+
return $this;
}
@@ -201,4 +199,42 @@ public function getClient()
{
return $this->client;
}
+
+ /**
+ * @param \Guzzle\Http\Message\Request $lastRequest
+ * @return $this
+ */
+ public function setLastRequest($lastRequest)
+ {
+ $this->lastRequest = $lastRequest;
+
+ return $this;
+ }
+
+ /**
+ * @return \Guzzle\Http\Message\Request
+ */
+ public function getLastRequest()
+ {
+ return $this->lastRequest;
+ }
+
+ /**
+ * @param \Guzzle\Http\Message\Response $lastResponse
+ * @return $this
+ */
+ public function setLastResponse($lastResponse)
+ {
+ $this->lastResponse = $lastResponse;
+
+ return $this;
+ }
+
+ /**
+ * @return \Guzzle\Http\Message\Response
+ */
+ public function getLastResponse()
+ {
+ return $this->lastResponse;
+ }
}
diff --git a/lib/Tmdb/HttpClient/HttpClientInterface.php b/lib/Tmdb/HttpClient/HttpClientInterface.php
index 1899df98..bbce4cbe 100644
--- a/lib/Tmdb/HttpClient/HttpClientInterface.php
+++ b/lib/Tmdb/HttpClient/HttpClientInterface.php
@@ -24,71 +24,71 @@ interface HttpClientInterface
/**
* Compose a GET request
*
- * @param string $path Request path
- * @param array $parameters GET Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param array $parameters GET Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function get($path, array $parameters = array(), array $headers = array());
/**
* Compose a POST request
*
- * @param string $path Request path
- * @param string $postBody The post BODY
- * @param array $parameters POST Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param string $postBody The post BODY
+ * @param array $parameters POST Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function post($path, $postBody, array $parameters = array(), array $headers = array());
/**
* Compose a POST request but json_encode the body
*
- * @param string $path Request path
- * @param array $postBody The post BODY
- * @param array $parameters POST Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param array $postBody The post BODY
+ * @param array $parameters POST Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function postJson($path, $postBody, array $parameters = array(), array $headers = array());
/**
* Compose a PATCH request
*
- * @param string $path Request path
- * @param string $body The body
- * @param array $parameters PATCH Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param string $body The body
+ * @param array $parameters PATCH Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function patch($path, $body = null, array $parameters = array(), array $headers = array());
/**
* Compose a PUT request
*
- * @param string $path Request path
- * @param string $body The body
- * @param array $parameters PUT Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param string $body The body
+ * @param array $parameters PUT Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function put($path, $body = null, array $parameters = array(), array $headers = array());
/**
* Compose a DELETE request
*
- * @param string $path Request path
- * @param string $body The body
- * @param array $parameters DELETE Parameters
- * @param array $headers Reconfigure the request headers for this call only
+ * @param string $path Request path
+ * @param string $body The body
+ * @param array $parameters DELETE Parameters
+ * @param array $headers Reconfigure the request headers for this call only
*
- * @return Response Data
+ * @return Response Data
*/
public function delete($path, $body = null, array $parameters = array(), array $headers = array());
@@ -99,5 +99,4 @@ public function delete($path, $body = null, array $parameters = array(), array $
* @return Response
*/
public function request(RequestInterface $request);
-
}
diff --git a/lib/Tmdb/Model/AbstractModel.php b/lib/Tmdb/Model/AbstractModel.php
index 4d40864f..6e561600 100644
--- a/lib/Tmdb/Model/AbstractModel.php
+++ b/lib/Tmdb/Model/AbstractModel.php
@@ -16,12 +16,12 @@
* Class AbstractModel
* @package Tmdb\Model
*/
-class AbstractModel {
+class AbstractModel
+{
/**
* List of properties to populate by the ObjectHydrator
*
* @var array
*/
- public static $_properties = array();
-
+ public static $properties = array();
}
diff --git a/lib/Tmdb/Model/Account.php b/lib/Tmdb/Model/Account.php
index a9334b51..feef5e10 100644
--- a/lib/Tmdb/Model/Account.php
+++ b/lib/Tmdb/Model/Account.php
@@ -16,7 +16,8 @@
* Class Account
* @package Tmdb\Model
*/
-class Account extends AbstractModel {
+class Account extends AbstractModel
+{
/**
* @var integer
*/
@@ -50,7 +51,7 @@ class Account extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'id',
'include_adult',
'iso_3166_1',
@@ -60,12 +61,13 @@ class Account extends AbstractModel {
);
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -78,12 +80,13 @@ public function getId()
}
/**
- * @param boolean $includeAdult
+ * @param boolean $includeAdult
* @return $this
*/
public function setIncludeAdult($includeAdult)
{
$this->includeAdult = $includeAdult;
+
return $this;
}
@@ -96,12 +99,13 @@ public function getIncludeAdult()
}
/**
- * @param string $iso31661
+ * @param string $iso31661
* @return $this
*/
public function setIso31661($iso31661)
{
$this->iso31661 = $iso31661;
+
return $this;
}
@@ -114,12 +118,13 @@ public function getIso31661()
}
/**
- * @param string $iso6391
+ * @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -132,12 +137,13 @@ public function getIso6391()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -150,12 +156,13 @@ public function getName()
}
/**
- * @param string $username
+ * @param string $username
* @return $this
*/
public function setUsername($username)
{
$this->username = $username;
+
return $this;
}
@@ -166,6 +173,4 @@ public function getUsername()
{
return $this->username;
}
-
-
}
diff --git a/lib/Tmdb/Model/Account/ListItem.php b/lib/Tmdb/Model/Account/ListItem.php
index 7ce61239..e9b1c989 100644
--- a/lib/Tmdb/Model/Account/ListItem.php
+++ b/lib/Tmdb/Model/Account/ListItem.php
@@ -19,7 +19,8 @@
* Class ListItem
* @package Tmdb\Model\Account
*/
-class ListItem extends AbstractModel {
+class ListItem extends AbstractModel
+{
/**
* @var string
*/
@@ -68,7 +69,7 @@ class ListItem extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'description',
'favorite_count',
'id',
@@ -80,12 +81,13 @@ class ListItem extends AbstractModel {
);
/**
- * @param string $description
+ * @param string $description
* @return $this
*/
public function setDescription($description)
{
$this->description = $description;
+
return $this;
}
@@ -98,12 +100,13 @@ public function getDescription()
}
/**
- * @param int $favoriteCount
+ * @param int $favoriteCount
* @return $this
*/
public function setFavoriteCount($favoriteCount)
{
$this->favoriteCount = $favoriteCount;
+
return $this;
}
@@ -116,12 +119,13 @@ public function getFavoriteCount()
}
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -134,12 +138,13 @@ public function getId()
}
/**
- * @param string $iso6391
+ * @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -152,12 +157,13 @@ public function getIso6391()
}
/**
- * @param int $itemCount
+ * @param int $itemCount
* @return $this
*/
public function setItemCount($itemCount)
{
$this->itemCount = $itemCount;
+
return $this;
}
@@ -170,12 +176,13 @@ public function getItemCount()
}
/**
- * @param string $listType
+ * @param string $listType
* @return $this
*/
public function setListType($listType)
{
$this->listType = $listType;
+
return $this;
}
@@ -188,12 +195,13 @@ public function getListType()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -206,12 +214,13 @@ public function getName()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $posterImage
+ * @param \Tmdb\Model\Image\PosterImage $posterImage
* @return $this
*/
public function setPosterImage($posterImage)
{
$this->posterImage = $posterImage;
+
return $this;
}
@@ -224,12 +233,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Certification.php b/lib/Tmdb/Model/Certification.php
index dea8b7f6..36e2e429 100644
--- a/lib/Tmdb/Model/Certification.php
+++ b/lib/Tmdb/Model/Certification.php
@@ -18,8 +18,8 @@
* Class Certification
* @package Tmdb\Model
*/
-class Certification extends AbstractModel {
-
+class Certification extends AbstractModel
+{
/**
* @var string
*/
@@ -30,7 +30,7 @@ class Certification extends AbstractModel {
*/
private $certifications;
- public static $_properties = array(
+ public static $properties = array(
'country',
);
@@ -40,12 +40,13 @@ public function __construct()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $certifications
+ * @param \Tmdb\Model\Common\GenericCollection $certifications
* @return $this
*/
public function setCertifications($certifications)
{
$this->certifications = $certifications;
+
return $this;
}
@@ -58,12 +59,13 @@ public function getCertifications()
}
/**
- * @param string $country
+ * @param string $country
* @return $this
*/
public function setCountry($country)
{
$this->country = $country;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Certification/CountryCertification.php b/lib/Tmdb/Model/Certification/CountryCertification.php
index 479a93d1..24e73655 100644
--- a/lib/Tmdb/Model/Certification/CountryCertification.php
+++ b/lib/Tmdb/Model/Certification/CountryCertification.php
@@ -18,8 +18,8 @@
* Class CountryCertification
* @package Tmdb\Model\Certification
*/
-class CountryCertification extends AbstractModel {
-
+class CountryCertification extends AbstractModel
+{
/**
* @var string
*/
@@ -35,19 +35,20 @@ class CountryCertification extends AbstractModel {
*/
private $order;
- public static $_properties = array(
+ public static $properties = array(
'certification',
'meaning',
'order',
);
/**
- * @param string $certification
+ * @param string $certification
* @return $this
*/
public function setCertification($certification)
{
$this->certification = $certification;
+
return $this;
}
@@ -60,12 +61,13 @@ public function getCertification()
}
/**
- * @param string $meaning
+ * @param string $meaning
* @return $this
*/
public function setMeaning($meaning)
{
$this->meaning = $meaning;
+
return $this;
}
@@ -78,12 +80,13 @@ public function getMeaning()
}
/**
- * @param int $order
+ * @param int $order
* @return $this
*/
public function setOrder($order)
{
$this->order = $order;
+
return $this;
}
@@ -94,6 +97,4 @@ public function getOrder()
{
return $this->order;
}
-
-
}
diff --git a/lib/Tmdb/Model/Change.php b/lib/Tmdb/Model/Change.php
index c3186cce..8e670b37 100644
--- a/lib/Tmdb/Model/Change.php
+++ b/lib/Tmdb/Model/Change.php
@@ -16,7 +16,8 @@
* Class Change
* @package Tmdb\Model
*/
-class Change extends AbstractModel {
+class Change extends AbstractModel
+{
/**
* @var integer
*/
@@ -30,18 +31,19 @@ class Change extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'id',
'adult'
);
/**
- * @param boolean $adult
+ * @param boolean $adult
* @return $this
*/
public function setAdult($adult)
{
$this->adult = (bool) $adult;
+
return $this;
}
@@ -54,12 +56,13 @@ public function getAdult()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Collection.php b/lib/Tmdb/Model/Collection.php
index e11948a9..bece1f07 100644
--- a/lib/Tmdb/Model/Collection.php
+++ b/lib/Tmdb/Model/Collection.php
@@ -21,8 +21,8 @@
* Class Collection
* @package Tmdb\Model
*/
-class Collection extends AbstractModel {
-
+class Collection extends AbstractModel
+{
/**
* @var string
*/
@@ -68,7 +68,7 @@ class Collection extends AbstractModel {
*/
private $poster;
- public static $_properties = array(
+ public static $properties = array(
'backdrop_path',
'id',
'name',
@@ -83,12 +83,13 @@ public function __construct()
}
/**
- * @param \Tmdb\Model\Image\BackdropImage $backdrop
+ * @param \Tmdb\Model\Image\BackdropImage $backdrop
* @return $this
*/
public function setBackdropImage(BackdropImage $backdrop)
{
$this->backdrop = $backdrop;
+
return $this;
}
@@ -101,12 +102,13 @@ public function getBackdropImage()
}
/**
- * @param string $backdropPath
+ * @param string $backdropPath
* @return $this
*/
public function setBackdropPath($backdropPath)
{
$this->backdropPath = $backdropPath;
+
return $this;
}
@@ -119,12 +121,13 @@ public function getBackdropPath()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -137,12 +140,13 @@ public function getId()
}
/**
- * @param \Tmdb\Model\Collection\Images $images
+ * @param \Tmdb\Model\Collection\Images $images
* @return $this
*/
public function setImages(Images $images)
{
$this->images = $images;
+
return $this;
}
@@ -155,12 +159,13 @@ public function getImages()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -173,12 +178,13 @@ public function getName()
}
/**
- * @param string $overview
+ * @param string $overview
* @return $this
*/
public function setOverview($overview)
{
$this->overview = $overview;
+
return $this;
}
@@ -191,12 +197,13 @@ public function getOverview()
}
/**
- * @param GenericCollection $parts
+ * @param GenericCollection $parts
* @return $this
*/
public function setParts($parts)
{
$this->parts = $parts;
+
return $this;
}
@@ -209,12 +216,13 @@ public function getParts()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $poster
+ * @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPosterImage(PosterImage $poster)
{
$this->poster = $poster;
+
return $this;
}
@@ -227,12 +235,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Collection/Changes.php b/lib/Tmdb/Model/Collection/Changes.php
index 1d047b89..3643b16f 100644
--- a/lib/Tmdb/Model/Collection/Changes.php
+++ b/lib/Tmdb/Model/Collection/Changes.php
@@ -16,4 +16,6 @@
* Class Changes
* @package Tmdb\Model\Collection
*/
-class Changes extends ResultCollection {}
+class Changes extends ResultCollection
+{
+}
diff --git a/lib/Tmdb/Model/Collection/CreditsCollection.php b/lib/Tmdb/Model/Collection/CreditsCollection.php
index d81f57ab..69d71747 100644
--- a/lib/Tmdb/Model/Collection/CreditsCollection.php
+++ b/lib/Tmdb/Model/Collection/CreditsCollection.php
@@ -20,7 +20,8 @@
* Class CreditsCollection
* @package Tmdb\Model\Collection
*/
-class CreditsCollection {
+class CreditsCollection
+{
/**
* @var Cast
*/
@@ -41,12 +42,13 @@ public function __construct()
}
/**
- * @param Cast|GenericCollection $cast
+ * @param Cast|GenericCollection $cast
* @return $this
*/
public function setCast(GenericCollection $cast)
{
$this->cast = $cast;
+
return $this;
}
@@ -59,12 +61,13 @@ public function getCast()
}
/**
- * @param Crew|GenericCollection $crew
+ * @param Crew|GenericCollection $crew
* @return $this
*/
public function setCrew(GenericCollection $crew)
{
$this->crew = $crew;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Collection/CreditsCollection/CombinedCredits.php b/lib/Tmdb/Model/Collection/CreditsCollection/CombinedCredits.php
index a321af2d..e363478b 100644
--- a/lib/Tmdb/Model/Collection/CreditsCollection/CombinedCredits.php
+++ b/lib/Tmdb/Model/Collection/CreditsCollection/CombinedCredits.php
@@ -18,4 +18,6 @@
* Class CombinedCredits
* @package Tmdb\Model\Collection\CreditsCollection
*/
-class CombinedCredits extends CreditsCollection {}
+class CombinedCredits extends CreditsCollection
+{
+}
diff --git a/lib/Tmdb/Model/Collection/CreditsCollection/MovieCredits.php b/lib/Tmdb/Model/Collection/CreditsCollection/MovieCredits.php
index 6d63d4cd..384e7872 100644
--- a/lib/Tmdb/Model/Collection/CreditsCollection/MovieCredits.php
+++ b/lib/Tmdb/Model/Collection/CreditsCollection/MovieCredits.php
@@ -18,4 +18,6 @@
* Class MovieCredits
* @package Tmdb\Model\Collection\CreditsCollection
*/
-class MovieCredits extends CreditsCollection {}
+class MovieCredits extends CreditsCollection
+{
+}
diff --git a/lib/Tmdb/Model/Collection/CreditsCollection/TvCredits.php b/lib/Tmdb/Model/Collection/CreditsCollection/TvCredits.php
index b2d91be7..bff00549 100644
--- a/lib/Tmdb/Model/Collection/CreditsCollection/TvCredits.php
+++ b/lib/Tmdb/Model/Collection/CreditsCollection/TvCredits.php
@@ -18,4 +18,6 @@
* Class TvCredits
* @package Tmdb\Model\Collection\CreditsCollection
*/
-class TvCredits extends CreditsCollection {}
+class TvCredits extends CreditsCollection
+{
+}
diff --git a/lib/Tmdb/Model/Collection/Genres.php b/lib/Tmdb/Model/Collection/Genres.php
index 169fc1a6..7317d94a 100644
--- a/lib/Tmdb/Model/Collection/Genres.php
+++ b/lib/Tmdb/Model/Collection/Genres.php
@@ -19,8 +19,8 @@
* Class Genres
* @package Tmdb\Model\Collection
*/
-class Genres extends GenericCollection {
-
+class Genres extends GenericCollection
+{
/**
* Returns all genres
*
@@ -37,8 +37,9 @@ public function getGenres()
* @param $id
* @return Genre|null
*/
- public function getGenre($id) {
- foreach($this->data as $genre) {
+ public function getGenre($id)
+ {
+ foreach ($this->data as $genre) {
if ($id === $genre->getId()) {
return $genre;
}
diff --git a/lib/Tmdb/Model/Collection/Images.php b/lib/Tmdb/Model/Collection/Images.php
index 38525357..7163afde 100644
--- a/lib/Tmdb/Model/Collection/Images.php
+++ b/lib/Tmdb/Model/Collection/Images.php
@@ -20,8 +20,8 @@
* Class Images
* @package Tmdb\Model\Collection
*/
-class Images extends GenericCollection {
-
+class Images extends GenericCollection
+{
/**
* Returns all images
*
@@ -38,7 +38,8 @@ public function getImages()
* @param $id
* @return null
*/
- public function getImage($id) {
+ public function getImage($id)
+ {
return $this->filterId($id);
}
@@ -60,8 +61,10 @@ public function addImage(Image $image)
public function filterPosters()
{
return $this->filter(
- function($key, $value) {
- if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) { return true; }
+ function ($key, $value) {
+ if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) {
+ return true;
+ }
}
);
}
@@ -74,8 +77,10 @@ function($key, $value) {
public function filterBackdrops()
{
return $this->filter(
- function($key, $value) {
- if ($value instanceof ImageFilter && $value instanceof Image\BackdropImage) { return true; }
+ function ($key, $value) {
+ if ($value instanceof ImageFilter && $value instanceof Image\BackdropImage) {
+ return true;
+ }
}
);
}
@@ -88,8 +93,10 @@ function($key, $value) {
public function filterProfile()
{
return $this->filter(
- function($key, $value) {
- if ($value instanceof ImageFilter && $value instanceof Image\ProfileImage) { return true; }
+ function ($key, $value) {
+ if ($value instanceof ImageFilter && $value instanceof Image\ProfileImage) {
+ return true;
+ }
}
);
}
@@ -102,8 +109,10 @@ function($key, $value) {
public function filterStills()
{
return $this->filter(
- function($key, $value) {
- if ($value instanceof ImageFilter && $value instanceof Image\StillImage) { return true; }
+ function ($key, $value) {
+ if ($value instanceof ImageFilter && $value instanceof Image\StillImage) {
+ return true;
+ }
}
);
}
@@ -117,8 +126,10 @@ function($key, $value) {
public function filterMaxWidth($width)
{
return $this->filter(
- function($key, $value) use ($width) {
- if ($value instanceof ImageFilter && $value->getWidth() <= $width && $value->getWidth() !== null) { return true; }
+ function ($key, $value) use ($width) {
+ if ($value instanceof ImageFilter && $value->getWidth() <= $width && $value->getWidth() !== null) {
+ return true;
+ }
}
);
}
@@ -132,8 +143,10 @@ function($key, $value) use ($width) {
public function filterMinWidth($width)
{
return $this->filter(
- function($key, $value) use ($width) {
- if ($value instanceof ImageFilter && $value->getWidth() >= $width && $value->getWidth() !== null) { return true; }
+ function ($key, $value) use ($width) {
+ if ($value instanceof ImageFilter && $value->getWidth() >= $width && $value->getWidth() !== null) {
+ return true;
+ }
}
);
}
@@ -147,8 +160,12 @@ function($key, $value) use ($width) {
public function filterMaxHeight($height)
{
return $this->filter(
- function($key, $value) use ($height) {
- if ($value instanceof ImageFilter && $value->getHeight() <= $height && $value->getHeight() !== null) { return true; }
+ function ($key, $value) use ($height) {
+ if ($value instanceof ImageFilter &&
+ $value->getHeight() <= $height && $value->getHeight() !== null
+ ) {
+ return true;
+ }
}
);
}
@@ -162,8 +179,12 @@ function($key, $value) use ($height) {
public function filterMinHeight($height)
{
return $this->filter(
- function($key, $value) use ($height) {
- if ($value instanceof ImageFilter && $value->getHeight() >= $height && $value->getHeight() !== null) { return true; }
+ function ($key, $value) use ($height) {
+ if ($value instanceof ImageFilter &&
+ $value->getHeight() >= $height &&
+ $value->getHeight() !== null) {
+ return true;
+ }
}
);
}
@@ -181,7 +202,7 @@ public function filterBestVotedImage()
/**
* @var $image Image
*/
- foreach($this->data as $image) {
+ foreach ($this->data as $image) {
if ($image->getVoteAverage() > $voteAverage) {
$voteAverage = $image->getVoteAverage();
$currentImage = $image;
diff --git a/lib/Tmdb/Model/Collection/Jobs.php b/lib/Tmdb/Model/Collection/Jobs.php
index 6f2312b6..0495749b 100644
--- a/lib/Tmdb/Model/Collection/Jobs.php
+++ b/lib/Tmdb/Model/Collection/Jobs.php
@@ -18,24 +18,27 @@
* Class Jobs
* @package Tmdb\Model\Collection
*/
-class Jobs extends GenericCollection {
-
+class Jobs extends GenericCollection
+{
/**
* Filter by department
*
- * @param string $department
+ * @param string $department
* @return $this
*/
public function filterByDepartment($department)
{
$result = $this->filter(
- function($key, $value) use ($department) {
- if ($value->getDepartment() == $department) { return true; }
+ function ($key, $value) use ($department) {
+ if ($value->getDepartment() == $department) {
+ return true;
+ }
}
);
if ($result && 1 === count($result)) {
$results = $result->toArray();
+
return array_shift($results);
}
@@ -45,14 +48,16 @@ function($key, $value) use ($department) {
/**
* Filter by department and return the jobs collection
*
- * @param string $department
+ * @param string $department
* @return $this
*/
public function filterByDepartmentAndReturnJobsList($department)
{
$result = $this->filter(
- function($key, $value) use ($department) {
- if ($value->getDepartment() == $department) { return true; }
+ function ($key, $value) use ($department) {
+ if ($value->getDepartment() == $department) {
+ return true;
+ }
}
);
@@ -69,23 +74,26 @@ function($key, $value) use ($department) {
/**
* Filter by job
*
- * @param string $filterByJob
+ * @param string $filterByJob
* @return $this
*/
public function filterByJob($filterByJob)
{
$result = $this->filter(
- function($key, $value) use ($filterByJob) {
+ function ($key, $value) use ($filterByJob) {
$jobList = $value->getJobList();
- foreach($jobList as $job) {
- if ($filterByJob == $job) { return true; }
+ foreach ($jobList as $job) {
+ if ($filterByJob == $job) {
+ return true;
+ }
}
}
);
if ($result && 1 === count($result)) {
$results = $result->toArray();
+
return array_shift($results);
}
diff --git a/lib/Tmdb/Model/Collection/Keywords.php b/lib/Tmdb/Model/Collection/Keywords.php
index d6d52a90..70d80439 100644
--- a/lib/Tmdb/Model/Collection/Keywords.php
+++ b/lib/Tmdb/Model/Collection/Keywords.php
@@ -19,8 +19,8 @@
* Class Keywords
* @package Tmdb\Model\Collection
*/
-class Keywords extends GenericCollection {
-
+class Keywords extends GenericCollection
+{
/**
* Returns all keywords
*
@@ -37,7 +37,8 @@ public function getKeywords()
* @param $id
* @return Keyword
*/
- public function getKeyword($id) {
+ public function getKeyword($id)
+ {
return $this->filterId($id);
}
diff --git a/lib/Tmdb/Model/Collection/People.php b/lib/Tmdb/Model/Collection/People.php
index 65a16784..b83c97d9 100644
--- a/lib/Tmdb/Model/Collection/People.php
+++ b/lib/Tmdb/Model/Collection/People.php
@@ -20,8 +20,8 @@
* Class People
* @package Tmdb\Model\Collection
*/
-class People extends GenericCollection {
-
+class People extends GenericCollection
+{
/**
* Returns all people
*
@@ -38,7 +38,8 @@ public function getPeople()
* @param $id
* @return Person
*/
- public function getPerson($id) {
+ public function getPerson($id)
+ {
return $this->filterId($id);
}
diff --git a/lib/Tmdb/Model/Collection/People/Cast.php b/lib/Tmdb/Model/Collection/People/Cast.php
index ff4b8dbc..99a1f75a 100644
--- a/lib/Tmdb/Model/Collection/People/Cast.php
+++ b/lib/Tmdb/Model/Collection/People/Cast.php
@@ -19,7 +19,8 @@
* Class Cast
* @package Tmdb\Model\Collection\People
*/
-class Cast extends People {
+class Cast extends People
+{
/**
* Returns all people
*
@@ -36,7 +37,8 @@ public function getCast()
* @param $id
* @return Person
*/
- public function getCastMember($id) {
+ public function getCastMember($id)
+ {
return parent::getPerson($id);
}
}
diff --git a/lib/Tmdb/Model/Collection/People/Crew.php b/lib/Tmdb/Model/Collection/People/Crew.php
index d3a06649..4dce220e 100644
--- a/lib/Tmdb/Model/Collection/People/Crew.php
+++ b/lib/Tmdb/Model/Collection/People/Crew.php
@@ -19,7 +19,8 @@
* Class Crew
* @package Tmdb\Model\Collection\People
*/
-class Crew extends People {
+class Crew extends People
+{
/**
* Returns all people
*
@@ -36,7 +37,8 @@ public function getCrew()
* @param $id
* @return Person
*/
- public function getCrewMember($id) {
+ public function getCrewMember($id)
+ {
return parent::getPerson($id);
}
}
diff --git a/lib/Tmdb/Model/Collection/People/PersonInterface.php b/lib/Tmdb/Model/Collection/People/PersonInterface.php
index 4f4538c1..3d3e0ad7 100644
--- a/lib/Tmdb/Model/Collection/People/PersonInterface.php
+++ b/lib/Tmdb/Model/Collection/People/PersonInterface.php
@@ -16,11 +16,12 @@
* Interface PersonInterface
* @package Tmdb\Model\Collection\People
*/
-interface PersonInterface {
- function getName();
+interface PersonInterface
+{
+ public function getName();
/**
* @return integer
*/
- function getId();
+ public function getId();
}
diff --git a/lib/Tmdb/Model/Collection/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Collection/QueryParameter/AppendToResponse.php
index 5523f6c2..5d70aaa2 100644
--- a/lib/Tmdb/Model/Collection/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Collection/QueryParameter/AppendToResponse.php
@@ -18,6 +18,7 @@
* Class AppendToResponse
* @package Tmdb\Model\Collection\QueryParameter
*/
-final class AppendToResponse extends BaseAppendToResponse {
+final class AppendToResponse extends BaseAppendToResponse
+{
const IMAGES = 'images';
}
diff --git a/lib/Tmdb/Model/Collection/QueryParametersCollection.php b/lib/Tmdb/Model/Collection/QueryParametersCollection.php
index b1f3cd21..0cfa2a30 100644
--- a/lib/Tmdb/Model/Collection/QueryParametersCollection.php
+++ b/lib/Tmdb/Model/Collection/QueryParametersCollection.php
@@ -18,4 +18,6 @@
* Class QueryParametersCollection
* @package Tmdb\Model\Collection
*/
-class QueryParametersCollection extends GenericCollection {}
+class QueryParametersCollection extends GenericCollection
+{
+}
diff --git a/lib/Tmdb/Model/Collection/ResultCollection.php b/lib/Tmdb/Model/Collection/ResultCollection.php
index aa0acbcc..bdf6a9d3 100644
--- a/lib/Tmdb/Model/Collection/ResultCollection.php
+++ b/lib/Tmdb/Model/Collection/ResultCollection.php
@@ -18,7 +18,8 @@
* Class ResultCollection
* @package Tmdb\Model\Collection
*/
-class ResultCollection extends GenericCollection {
+class ResultCollection extends GenericCollection
+{
/**
* @var int
*/
@@ -37,19 +38,20 @@ class ResultCollection extends GenericCollection {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'page',
'total_pages',
'total_results'
);
/**
- * @param int $page
+ * @param int $page
* @return $this
*/
public function setPage($page)
{
$this->page = (int) $page;
+
return $this;
}
@@ -62,12 +64,13 @@ public function getPage()
}
/**
- * @param int $totalPages
+ * @param int $totalPages
* @return $this
*/
public function setTotalPages($totalPages)
{
$this->totalPages = (int) $totalPages;
+
return $this;
}
@@ -80,12 +83,13 @@ public function getTotalPages()
}
/**
- * @param int $totalResults
+ * @param int $totalResults
* @return $this
*/
public function setTotalResults($totalResults)
{
$this->totalResults = (int) $totalResults;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Common/AbstractTrailer.php b/lib/Tmdb/Model/Common/AbstractTrailer.php
index 083a3c9e..233d461f 100644
--- a/lib/Tmdb/Model/Common/AbstractTrailer.php
+++ b/lib/Tmdb/Model/Common/AbstractTrailer.php
@@ -18,7 +18,8 @@
* Class AbstractTrailer
* @package Tmdb\Model\Common
*/
-abstract class AbstractTrailer extends AbstractModel {
+abstract class AbstractTrailer extends AbstractModel
+{
/**
* Returns the http url to the trailer
*
diff --git a/lib/Tmdb/Model/Common/Change.php b/lib/Tmdb/Model/Common/Change.php
index 2d4663f3..6aa86cce 100644
--- a/lib/Tmdb/Model/Common/Change.php
+++ b/lib/Tmdb/Model/Common/Change.php
@@ -18,8 +18,8 @@
* Class Change
* @package Tmdb\Model\Common
*/
-class Change extends AbstractModel {
-
+class Change extends AbstractModel
+{
/**
* @var string
*/
@@ -30,7 +30,7 @@ class Change extends AbstractModel {
*/
private $items;
- public static $_properties = array(
+ public static $properties = array(
'key',
);
@@ -40,12 +40,13 @@ public function __construct()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $items
+ * @param \Tmdb\Model\Common\GenericCollection $items
* @return $this
*/
public function setItems($items)
{
$this->items = $items;
+
return $this;
}
@@ -58,12 +59,13 @@ public function getItems()
}
/**
- * @param string $key
+ * @param string $key
* @return $this
*/
public function setKey($key)
{
$this->key = $key;
+
return $this;
}
@@ -74,6 +76,4 @@ public function getKey()
{
return $this->key;
}
-
-
}
diff --git a/lib/Tmdb/Model/Common/Change/Item.php b/lib/Tmdb/Model/Common/Change/Item.php
index 766483a4..c4267456 100644
--- a/lib/Tmdb/Model/Common/Change/Item.php
+++ b/lib/Tmdb/Model/Common/Change/Item.php
@@ -18,8 +18,8 @@
* Class Item
* @package Tmdb\Model\Common\Change
*/
-class Item extends AbstractModel {
-
+class Item extends AbstractModel
+{
/**
* @var string
*/
@@ -40,7 +40,7 @@ class Item extends AbstractModel {
*/
private $value;
- public static $_properties = array(
+ public static $properties = array(
'id',
'action',
'time',
@@ -48,12 +48,13 @@ class Item extends AbstractModel {
);
/**
- * @param string $action
+ * @param string $action
* @return $this
*/
public function setAction($action)
{
$this->action = $action;
+
return $this;
}
@@ -66,12 +67,13 @@ public function getAction()
}
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -84,7 +86,7 @@ public function getId()
}
/**
- * @param string|\DateTime $time
+ * @param string|\DateTime $time
* @return $this
*/
public function setTime($time)
@@ -94,6 +96,7 @@ public function setTime($time)
}
$this->time = $time;
+
return $this;
}
@@ -106,12 +109,13 @@ public function getTime()
}
/**
- * @param array $value
+ * @param array $value
* @return $this
*/
public function setValue($value)
{
$this->value = $value;
+
return $this;
}
@@ -122,7 +126,4 @@ public function getValue()
{
return $this->value;
}
-
-
-
}
diff --git a/lib/Tmdb/Model/Common/Country.php b/lib/Tmdb/Model/Common/Country.php
index 9e0dfcd4..70b662a3 100644
--- a/lib/Tmdb/Model/Common/Country.php
+++ b/lib/Tmdb/Model/Common/Country.php
@@ -19,23 +19,24 @@
* Class Country
* @package Tmdb\Model\Common
*/
-class Country extends AbstractModel implements CountryFilter {
-
+class Country extends AbstractModel implements CountryFilter
+{
private $iso31661;
private $name;
- public static $_properties = array(
+ public static $properties = array(
'iso_3166_1',
'name',
);
/**
- * @param string $iso31661
+ * @param string $iso31661
* @return $this
*/
public function setIso31661($iso31661)
{
$this->iso31661 = $iso31661;
+
return $this;
}
@@ -48,12 +49,13 @@ public function getIso31661()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Common/ExternalIds.php b/lib/Tmdb/Model/Common/ExternalIds.php
index a36a4b13..e064623c 100644
--- a/lib/Tmdb/Model/Common/ExternalIds.php
+++ b/lib/Tmdb/Model/Common/ExternalIds.php
@@ -18,8 +18,8 @@
* Class ExternalIds
* @package Tmdb\Model\Common
*/
-class ExternalIds extends AbstractModel {
-
+class ExternalIds extends AbstractModel
+{
private $imdbId;
private $freebaseId;
private $freebaseMid;
@@ -27,7 +27,7 @@ class ExternalIds extends AbstractModel {
private $tvdbId;
private $tvrageId;
- public static $_properties = array(
+ public static $properties = array(
'imdb_id',
'freebase_id',
'freebase_mid',
@@ -37,12 +37,13 @@ class ExternalIds extends AbstractModel {
);
/**
- * @param mixed $freebaseId
+ * @param mixed $freebaseId
* @return $this
*/
public function setFreebaseId($freebaseId)
{
$this->freebaseId = $freebaseId;
+
return $this;
}
@@ -55,12 +56,13 @@ public function getFreebaseId()
}
/**
- * @param mixed $freebaseMid
+ * @param mixed $freebaseMid
* @return $this
*/
public function setFreebaseMid($freebaseMid)
{
$this->freebaseMid = $freebaseMid;
+
return $this;
}
@@ -73,12 +75,13 @@ public function getFreebaseMid()
}
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -91,12 +94,13 @@ public function getId()
}
/**
- * @param mixed $imdbId
+ * @param mixed $imdbId
* @return $this
*/
public function setImdbId($imdbId)
{
$this->imdbId = $imdbId;
+
return $this;
}
@@ -109,12 +113,13 @@ public function getImdbId()
}
/**
- * @param mixed $tvdbId
+ * @param mixed $tvdbId
* @return $this
*/
public function setTvdbId($tvdbId)
{
$this->tvdbId = $tvdbId;
+
return $this;
}
@@ -127,12 +132,13 @@ public function getTvdbId()
}
/**
- * @param mixed $tvrageId
+ * @param mixed $tvrageId
* @return $this
*/
public function setTvrageId($tvrageId)
{
$this->tvrageId = $tvrageId;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Common/GenericCollection.php b/lib/Tmdb/Model/Common/GenericCollection.php
index bd9ef70c..8029c4f8 100644
--- a/lib/Tmdb/Model/Common/GenericCollection.php
+++ b/lib/Tmdb/Model/Common/GenericCollection.php
@@ -23,7 +23,8 @@
* Class GenericCollection
* @package Tmdb\Model\Common
*/
-class GenericCollection implements \ArrayAccess, \IteratorAggregate, \Countable {
+class GenericCollection implements \ArrayAccess, \IteratorAggregate, \Countable
+{
/** @var array Data associated with the object. */
protected $data = array();
@@ -309,14 +310,16 @@ public function offsetUnset($offset)
/**
* Filter by id
*
- * @param integer $id
+ * @param integer $id
* @return GenericCollection
*/
public function filterId($id)
{
$result = $this->filter(
- function($key, $value) use ($id) {
- if ($value->getId() == $id) { return true; }
+ function ($key, $value) use ($id) {
+ if ($value->getId() == $id) {
+ return true;
+ }
}
);
@@ -330,14 +333,16 @@ function($key, $value) use ($id) {
/**
* Filter by language ISO 639-1 code.
*
- * @param string $language
+ * @param string $language
* @return GenericCollection
*/
public function filterLanguage($language = 'en')
{
return $this->filter(
- function($key, $value) use ($language) {
- if ($value instanceof LanguageFilter && $value->getIso6391() == $language) { return true; }
+ function ($key, $value) use ($language) {
+ if ($value instanceof LanguageFilter && $value->getIso6391() == $language) {
+ return true;
+ }
}
);
}
@@ -345,14 +350,16 @@ function($key, $value) use ($language) {
/**
* Filter by country ISO 3166-1 code.
*
- * @param string $country
+ * @param string $country
* @return GenericCollection
*/
public function filterCountry($country = 'US')
{
return $this->filter(
- function($key, $value) use ($country) {
- if ($value instanceof CountryFilter && $value->getIso31661() == $country) { return true; }
+ function ($key, $value) use ($country) {
+ if ($value instanceof CountryFilter && $value->getIso31661() == $country) {
+ return true;
+ }
}
);
}
@@ -360,14 +367,16 @@ function($key, $value) use ($country) {
/**
* Filter by adult content
*
- * @param boolean $adult
+ * @param boolean $adult
* @return GenericCollection
*/
public function filterAdult($adult = false)
{
return $this->filter(
- function($key, $value) use ($adult) {
- if ($value instanceof AdultFilter && $value->getAdult() == $adult) { return true; }
+ function ($key, $value) use ($adult) {
+ if ($value instanceof AdultFilter && $value->getAdult() == $adult) {
+ return true;
+ }
}
);
}
diff --git a/lib/Tmdb/Model/Common/QueryParameter/Adult.php b/lib/Tmdb/Model/Common/QueryParameter/Adult.php
index 5aed8bb2..7130aac9 100644
--- a/lib/Tmdb/Model/Common/QueryParameter/Adult.php
+++ b/lib/Tmdb/Model/Common/QueryParameter/Adult.php
@@ -16,8 +16,8 @@
* Class Adult
* @package Tmdb\Model\Common\QueryParameter
*/
-class Adult implements QueryParameterInterface {
-
+class Adult implements QueryParameterInterface
+{
private $adult;
public function __construct($adult)
diff --git a/lib/Tmdb/Model/Common/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Common/QueryParameter/AppendToResponse.php
index a9c409d7..bf304e1f 100644
--- a/lib/Tmdb/Model/Common/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Common/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Common\QueryParameter
*/
-class AppendToResponse extends CollectionToCommaSeperatedString {
+class AppendToResponse extends CollectionToCommaSeperatedString
+{
/**
* @return string
*/
diff --git a/lib/Tmdb/Model/Common/QueryParameter/Language.php b/lib/Tmdb/Model/Common/QueryParameter/Language.php
index 4a91a10e..02e715be 100644
--- a/lib/Tmdb/Model/Common/QueryParameter/Language.php
+++ b/lib/Tmdb/Model/Common/QueryParameter/Language.php
@@ -16,8 +16,8 @@
* Class Language
* @package Tmdb\Model\Common\QueryParameter
*/
-class Language implements QueryParameterInterface {
-
+class Language implements QueryParameterInterface
+{
private $language;
public function __construct($language)
diff --git a/lib/Tmdb/Model/Common/QueryParameter/QueryParameterInterface.php b/lib/Tmdb/Model/Common/QueryParameter/QueryParameterInterface.php
index 87ab2154..d0e23763 100644
--- a/lib/Tmdb/Model/Common/QueryParameter/QueryParameterInterface.php
+++ b/lib/Tmdb/Model/Common/QueryParameter/QueryParameterInterface.php
@@ -16,14 +16,15 @@
* Interface QueryParameterInterface
* @package Tmdb\Model\Common\QueryParameter
*/
-interface QueryParameterInterface {
+interface QueryParameterInterface
+{
/**
* @return string
*/
- function getKey();
+ public function getKey();
/**
* @return string
*/
- function getValue();
+ public function getValue();
}
diff --git a/lib/Tmdb/Model/Common/QueryParameter/Type/CollectionToCommaSeperatedString.php b/lib/Tmdb/Model/Common/QueryParameter/Type/CollectionToCommaSeperatedString.php
index 05af7079..e6605039 100644
--- a/lib/Tmdb/Model/Common/QueryParameter/Type/CollectionToCommaSeperatedString.php
+++ b/lib/Tmdb/Model/Common/QueryParameter/Type/CollectionToCommaSeperatedString.php
@@ -19,7 +19,8 @@
* Class CollectionToCommaSeperatedString
* @package Tmdb\Model\Common\QueryParameter\Type
*/
-abstract class CollectionToCommaSeperatedString extends GenericCollection implements QueryParameterInterface {
+abstract class CollectionToCommaSeperatedString extends GenericCollection implements QueryParameterInterface
+{
/**
* @param array $collection
*/
@@ -27,7 +28,7 @@ public function __construct(array $collection = array())
{
$i = 0;
- foreach($collection as $item) {
+ foreach ($collection as $item) {
$this->add($i, $item);
$i++;
diff --git a/lib/Tmdb/Model/Common/SpokenLanguage.php b/lib/Tmdb/Model/Common/SpokenLanguage.php
index 0c441d85..47a87865 100644
--- a/lib/Tmdb/Model/Common/SpokenLanguage.php
+++ b/lib/Tmdb/Model/Common/SpokenLanguage.php
@@ -19,23 +19,24 @@
* Class SpokenLanguage
* @package Tmdb\Model\Common
*/
-class SpokenLanguage extends AbstractModel implements LanguageFilter {
-
+class SpokenLanguage extends AbstractModel implements LanguageFilter
+{
private $iso6391;
private $name;
- public static $_properties = array(
+ public static $properties = array(
'iso_369_1',
'name',
);
/**
- * @param string $iso6391
+ * @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -48,12 +49,13 @@ public function getIso6391()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Common/Trailer/Youtube.php b/lib/Tmdb/Model/Common/Trailer/Youtube.php
index bc00660b..3d78aeaf 100644
--- a/lib/Tmdb/Model/Common/Trailer/Youtube.php
+++ b/lib/Tmdb/Model/Common/Trailer/Youtube.php
@@ -18,8 +18,8 @@
* Class Youtube
* @package Tmdb\Model\Common\Trailer
*/
-class Youtube extends AbstractTrailer {
-
+class Youtube extends AbstractTrailer
+{
const URL = 'http://www.youtube.com/watch?v=%s';
private $name;
@@ -27,7 +27,7 @@ class Youtube extends AbstractTrailer {
private $source;
private $type;
- public static $_properties = array(
+ public static $properties = array(
'name',
'size',
'source',
@@ -47,12 +47,13 @@ public function getUrl()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -65,12 +66,13 @@ public function getName()
}
/**
- * @param string $size
+ * @param string $size
* @return $this
*/
public function setSize($size)
{
$this->size = $size;
+
return $this;
}
@@ -83,12 +85,13 @@ public function getSize()
}
/**
- * @param string $source
+ * @param string $source
* @return $this
*/
public function setSource($source)
{
$this->source = $source;
+
return $this;
}
@@ -101,12 +104,13 @@ public function getSource()
}
/**
- * @param string $type
+ * @param string $type
* @return $this
*/
public function setType($type)
{
$this->type = $type;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Common/Translation.php b/lib/Tmdb/Model/Common/Translation.php
index 6d0f9a64..bcc513b0 100644
--- a/lib/Tmdb/Model/Common/Translation.php
+++ b/lib/Tmdb/Model/Common/Translation.php
@@ -18,23 +18,24 @@
* Class Translation
* @package Tmdb\Model\Common
*/
-class Translation extends SpokenLanguage implements LanguageFilter {
-
+class Translation extends SpokenLanguage implements LanguageFilter
+{
private $englishName;
- public static $_properties = array(
+ public static $properties = array(
'iso_639_1',
'name',
'english_name'
);
/**
- * @param string $englishName
+ * @param string $englishName
* @return $this
*/
public function setEnglishName($englishName)
{
$this->englishName = $englishName;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Company.php b/lib/Tmdb/Model/Company.php
index 79b8a351..8bb70e0f 100644
--- a/lib/Tmdb/Model/Company.php
+++ b/lib/Tmdb/Model/Company.php
@@ -18,8 +18,8 @@
* Class Company
* @package Tmdb\Model
*/
-class Company extends AbstractModel {
-
+class Company extends AbstractModel
+{
private $description;
private $headquarters;
private $homepage;
@@ -29,7 +29,7 @@ class Company extends AbstractModel {
private $name;
private $parentCompany;
- public static $_properties = array(
+ public static $properties = array(
'description',
'headquarters',
'homepage',
@@ -40,12 +40,13 @@ class Company extends AbstractModel {
);
/**
- * @param mixed $description
+ * @param mixed $description
* @return $this
*/
public function setDescription($description)
{
$this->description = $description;
+
return $this;
}
@@ -58,12 +59,13 @@ public function getDescription()
}
/**
- * @param mixed $headquarters
+ * @param mixed $headquarters
* @return $this
*/
public function setHeadquarters($headquarters)
{
$this->headquarters = $headquarters;
+
return $this;
}
@@ -76,12 +78,13 @@ public function getHeadquarters()
}
/**
- * @param mixed $homepage
+ * @param mixed $homepage
* @return $this
*/
public function setHomepage($homepage)
{
$this->homepage = $homepage;
+
return $this;
}
@@ -94,12 +97,13 @@ public function getHomepage()
}
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -112,12 +116,13 @@ public function getId()
}
/**
- * @param LogoImage $logo
+ * @param LogoImage $logo
* @return $this
*/
public function setLogoImage(LogoImage $logo)
{
$this->logo = $logo;
+
return $this;
}
@@ -130,12 +135,13 @@ public function getLogoImage()
}
/**
- * @param mixed $logoPath
+ * @param mixed $logoPath
* @return $this
*/
public function setLogoPath($logoPath)
{
$this->logoPath = $logoPath;
+
return $this;
}
@@ -148,12 +154,13 @@ public function getLogoPath()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -166,12 +173,13 @@ public function getName()
}
/**
- * @param mixed $parentCompany
+ * @param mixed $parentCompany
* @return $this
*/
public function setParentCompany($parentCompany)
{
$this->parentCompany = $parentCompany;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Configuration.php b/lib/Tmdb/Model/Configuration.php
index 699dfeb7..8b71c5d4 100644
--- a/lib/Tmdb/Model/Configuration.php
+++ b/lib/Tmdb/Model/Configuration.php
@@ -16,8 +16,8 @@
* Class Configuration
* @package Tmdb\Model
*/
-class Configuration extends AbstractModel {
-
+class Configuration extends AbstractModel
+{
/**
* @var array
*/
@@ -28,18 +28,19 @@ class Configuration extends AbstractModel {
*/
private $change_keys;
- public static $_properties = array(
+ public static $properties = array(
'images',
'change_keys',
);
/**
- * @param array $change_keys
+ * @param array $change_keys
* @return $this
*/
public function setChangeKeys(array $change_keys = array())
{
$this->change_keys = $change_keys;
+
return $this;
}
@@ -52,12 +53,13 @@ public function getChangeKeys()
}
/**
- * @param array $images
+ * @param array $images
* @return $this
*/
public function setImages(array $images = array())
{
$this->images = $images;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Credits.php b/lib/Tmdb/Model/Credits.php
index 72688a31..24c0e88c 100644
--- a/lib/Tmdb/Model/Credits.php
+++ b/lib/Tmdb/Model/Credits.php
@@ -18,7 +18,8 @@
* Class Credits
* @package Tmdb\Model
*/
-class Credits extends AbstractModel {
+class Credits extends AbstractModel
+{
/**
* @var string
*/
@@ -57,7 +58,7 @@ class Credits extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'credit_type',
'department',
'job',
@@ -71,12 +72,13 @@ public function __construct()
}
/**
- * @param string $creditType
+ * @param string $creditType
* @return $this
*/
public function setCreditType($creditType)
{
$this->creditType = $creditType;
+
return $this;
}
@@ -89,12 +91,13 @@ public function getCreditType()
}
/**
- * @param string $department
+ * @param string $department
* @return $this
*/
public function setDepartment($department)
{
$this->department = $department;
+
return $this;
}
@@ -107,12 +110,13 @@ public function getDepartment()
}
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -125,12 +129,13 @@ public function getId()
}
/**
- * @param string $job
+ * @param string $job
* @return $this
*/
public function setJob($job)
{
$this->job = $job;
+
return $this;
}
@@ -143,12 +148,13 @@ public function getJob()
}
/**
- * @param \Tmdb\Model\Credits\Media $media
+ * @param \Tmdb\Model\Credits\Media $media
* @return $this
*/
public function setMedia($media)
{
$this->media = $media;
+
return $this;
}
@@ -161,12 +167,13 @@ public function getMedia()
}
/**
- * @param string $mediaType
+ * @param string $mediaType
* @return $this
*/
public function setMediaType($mediaType)
{
$this->mediaType = $mediaType;
+
return $this;
}
@@ -179,12 +186,13 @@ public function getMediaType()
}
/**
- * @param \Tmdb\Model\Person $person
+ * @param \Tmdb\Model\Person $person
* @return $this
*/
public function setPerson($person)
{
$this->person = $person;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Credits/Media.php b/lib/Tmdb/Model/Credits/Media.php
index 24b0e4b7..622b72fe 100644
--- a/lib/Tmdb/Model/Credits/Media.php
+++ b/lib/Tmdb/Model/Credits/Media.php
@@ -19,7 +19,8 @@
* Class Media
* @package Tmdb\Model\Credits
*/
-class Media extends AbstractModel {
+class Media extends AbstractModel
+{
/**
* @var integer
*/
@@ -50,7 +51,7 @@ class Media extends AbstractModel {
*/
private $seasons;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
'original_name',
@@ -58,12 +59,13 @@ class Media extends AbstractModel {
);
/**
- * @param string $character
+ * @param string $character
* @return $this
*/
public function setCharacter($character)
{
$this->character = $character;
+
return $this;
}
@@ -76,12 +78,13 @@ public function getCharacter()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $episodes
+ * @param \Tmdb\Model\Common\GenericCollection $episodes
* @return $this
*/
public function setEpisodes($episodes)
{
$this->episodes = $episodes;
+
return $this;
}
@@ -94,12 +97,13 @@ public function getEpisodes()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -112,12 +116,13 @@ public function getId()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -130,12 +135,13 @@ public function getName()
}
/**
- * @param string $originalName
+ * @param string $originalName
* @return $this
*/
public function setOriginalName($originalName)
{
$this->originalName = $originalName;
+
return $this;
}
@@ -148,12 +154,13 @@ public function getOriginalName()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $seasons
+ * @param \Tmdb\Model\Common\GenericCollection $seasons
* @return $this
*/
public function setSeasons($seasons)
{
$this->seasons = $seasons;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Filter/AdultFilter.php b/lib/Tmdb/Model/Filter/AdultFilter.php
index 71a612a8..0bf4020f 100644
--- a/lib/Tmdb/Model/Filter/AdultFilter.php
+++ b/lib/Tmdb/Model/Filter/AdultFilter.php
@@ -16,6 +16,7 @@
* Interface AdultFilter
* @package Tmdb\Model\Filter
*/
-interface AdultFilter {
+interface AdultFilter
+{
public function getAdult();
}
diff --git a/lib/Tmdb/Model/Filter/CountryFilter.php b/lib/Tmdb/Model/Filter/CountryFilter.php
index 4d6645f4..ddd8936f 100644
--- a/lib/Tmdb/Model/Filter/CountryFilter.php
+++ b/lib/Tmdb/Model/Filter/CountryFilter.php
@@ -16,8 +16,8 @@
* Interface CountryFilter
* @package Tmdb\Model\Filter
*/
-interface CountryFilter {
-
+interface CountryFilter
+{
/**
* @return string
*/
diff --git a/lib/Tmdb/Model/Filter/ImageFilter.php b/lib/Tmdb/Model/Filter/ImageFilter.php
index 593a8581..c4c307d0 100644
--- a/lib/Tmdb/Model/Filter/ImageFilter.php
+++ b/lib/Tmdb/Model/Filter/ImageFilter.php
@@ -16,5 +16,6 @@
* Interface ImageFilter
* @package Tmdb\Model\Filter
*/
-interface ImageFilter {
+interface ImageFilter
+{
}
diff --git a/lib/Tmdb/Model/Filter/LanguageFilter.php b/lib/Tmdb/Model/Filter/LanguageFilter.php
index cc1d8d31..69b27e75 100644
--- a/lib/Tmdb/Model/Filter/LanguageFilter.php
+++ b/lib/Tmdb/Model/Filter/LanguageFilter.php
@@ -16,6 +16,7 @@
* Interface LanguageFilter
* @package Tmdb\Model\Filter
*/
-interface LanguageFilter {
+interface LanguageFilter
+{
public function getIso6391();
}
diff --git a/lib/Tmdb/Model/Find.php b/lib/Tmdb/Model/Find.php
index 4812265b..7b50fbab 100644
--- a/lib/Tmdb/Model/Find.php
+++ b/lib/Tmdb/Model/Find.php
@@ -19,8 +19,8 @@
* Class Find
* @package Tmdb\Model
*/
-class Find extends AbstractModel {
-
+class Find extends AbstractModel
+{
/**
* @var GenericCollection
*/
@@ -37,12 +37,13 @@ class Find extends AbstractModel {
private $tvResults;
/**
- * @param \Tmdb\Model\Common\GenericCollection $movieResults
+ * @param \Tmdb\Model\Common\GenericCollection $movieResults
* @return $this
*/
public function setMovieResults($movieResults)
{
$this->movieResults = $movieResults;
+
return $this;
}
@@ -55,12 +56,13 @@ public function getMovieResults()
}
/**
- * @param \Tmdb\Model\Collection\People $personResults
+ * @param \Tmdb\Model\Collection\People $personResults
* @return $this
*/
public function setPersonResults($personResults)
{
$this->personResults = $personResults;
+
return $this;
}
@@ -73,12 +75,13 @@ public function getPersonResults()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $tvResults
+ * @param \Tmdb\Model\Common\GenericCollection $tvResults
* @return $this
*/
public function setTvResults($tvResults)
{
$this->tvResults = $tvResults;
+
return $this;
}
@@ -89,6 +92,4 @@ public function getTvResults()
{
return $this->tvResults;
}
-
-
}
diff --git a/lib/Tmdb/Model/Genre.php b/lib/Tmdb/Model/Genre.php
index 44569c02..d28876f7 100644
--- a/lib/Tmdb/Model/Genre.php
+++ b/lib/Tmdb/Model/Genre.php
@@ -16,23 +16,24 @@
* Class Genre
* @package Tmdb\Model
*/
-class Genre extends AbstractModel {
-
+class Genre extends AbstractModel
+{
private $id;
private $name;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
);
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -45,12 +46,13 @@ public function getId()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Image.php b/lib/Tmdb/Model/Image.php
index 28a77e4f..53020318 100644
--- a/lib/Tmdb/Model/Image.php
+++ b/lib/Tmdb/Model/Image.php
@@ -19,8 +19,8 @@
* Class Image
* @package Tmdb\Model
*/
-class Image extends AbstractModel implements ImageFilter, LanguageFilter {
-
+class Image extends AbstractModel implements ImageFilter, LanguageFilter
+{
const FORMAT_POSTER = 'poster';
const FORMAT_BACKDROP = 'backdrop';
const FORMAT_PROFILE = 'profile';
@@ -38,7 +38,7 @@ class Image extends AbstractModel implements ImageFilter, LanguageFilter {
protected $id;
protected $type;
- public static $_properties = array(
+ public static $properties = array(
'file_path',
'width',
'height',
@@ -48,7 +48,7 @@ class Image extends AbstractModel implements ImageFilter, LanguageFilter {
'vote_count'
);
- public static $_formats = array(
+ public static $formats = array(
'posters' => self::FORMAT_POSTER,
'backdrops' => self::FORMAT_BACKDROP,
'profiles' => self::FORMAT_PROFILE,
@@ -64,18 +64,19 @@ class Image extends AbstractModel implements ImageFilter, LanguageFilter {
*/
public static function getTypeFromCollectionName($name)
{
- if (array_key_exists($name, self::$_formats)) {
- return self::$_formats[$name];
+ if (array_key_exists($name, self::$formats)) {
+ return self::$formats[$name];
}
}
/**
- * @param float $aspectRatio
+ * @param float $aspectRatio
* @return $this
*/
public function setAspectRatio($aspectRatio)
{
$this->aspectRatio = (float) $aspectRatio;
+
return $this;
}
@@ -88,12 +89,13 @@ public function getAspectRatio()
}
/**
- * @param mixed $filePath
+ * @param mixed $filePath
* @return $this
*/
public function setFilePath($filePath)
{
$this->filePath = $filePath;
+
return $this;
}
@@ -106,12 +108,13 @@ public function getFilePath()
}
/**
- * @param mixed $height
+ * @param mixed $height
* @return $this
*/
public function setHeight($height)
{
$this->height = (int) $height;
+
return $this;
}
@@ -124,12 +127,13 @@ public function getHeight()
}
/**
- * @param mixed $iso6391
+ * @param mixed $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -142,12 +146,13 @@ public function getIso6391()
}
/**
- * @param float $voteAverage
+ * @param float $voteAverage
* @return $this
*/
public function setVoteAverage($voteAverage)
{
$this->voteAverage = (float) $voteAverage;
+
return $this;
}
@@ -160,12 +165,13 @@ public function getVoteAverage()
}
/**
- * @param int $voteCount
+ * @param int $voteCount
* @return $this
*/
public function setVoteCount($voteCount)
{
$this->voteCount = (int) $voteCount;
+
return $this;
}
@@ -178,12 +184,13 @@ public function getVoteCount()
}
/**
- * @param int $width
+ * @param int $width
* @return $this
*/
public function setWidth($width)
{
$this->width = (int) $width;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Image/BackdropImage.php b/lib/Tmdb/Model/Image/BackdropImage.php
index 81f9c6bb..628af20d 100644
--- a/lib/Tmdb/Model/Image/BackdropImage.php
+++ b/lib/Tmdb/Model/Image/BackdropImage.php
@@ -18,4 +18,6 @@
* Class BackdropImage
* @package Tmdb\Model\Image
*/
-class BackdropImage extends Image {}
+class BackdropImage extends Image
+{
+}
diff --git a/lib/Tmdb/Model/Image/LogoImage.php b/lib/Tmdb/Model/Image/LogoImage.php
index e2e82035..99a2eace 100644
--- a/lib/Tmdb/Model/Image/LogoImage.php
+++ b/lib/Tmdb/Model/Image/LogoImage.php
@@ -18,4 +18,6 @@
* Class LogoImage
* @package Tmdb\Model\Image
*/
-class LogoImage extends Image {}
+class LogoImage extends Image
+{
+}
diff --git a/lib/Tmdb/Model/Image/PosterImage.php b/lib/Tmdb/Model/Image/PosterImage.php
index e0337de6..63d7e262 100644
--- a/lib/Tmdb/Model/Image/PosterImage.php
+++ b/lib/Tmdb/Model/Image/PosterImage.php
@@ -18,4 +18,6 @@
* Class PosterImage
* @package Tmdb\Model\Image
*/
-class PosterImage extends Image {}
+class PosterImage extends Image
+{
+}
diff --git a/lib/Tmdb/Model/Image/ProfileImage.php b/lib/Tmdb/Model/Image/ProfileImage.php
index a62bbdcc..e2bcd075 100644
--- a/lib/Tmdb/Model/Image/ProfileImage.php
+++ b/lib/Tmdb/Model/Image/ProfileImage.php
@@ -18,4 +18,6 @@
* Class ProfileImage
* @package Tmdb\Model\Image
*/
-class ProfileImage extends Image {}
+class ProfileImage extends Image
+{
+}
diff --git a/lib/Tmdb/Model/Image/StillImage.php b/lib/Tmdb/Model/Image/StillImage.php
index dff71b50..18539dcd 100644
--- a/lib/Tmdb/Model/Image/StillImage.php
+++ b/lib/Tmdb/Model/Image/StillImage.php
@@ -18,4 +18,6 @@
* Class StillImage
* @package Tmdb\Model\Image
*/
-class StillImage extends Image {}
+class StillImage extends Image
+{
+}
diff --git a/lib/Tmdb/Model/Job.php b/lib/Tmdb/Model/Job.php
index c7876538..d5f39b2c 100644
--- a/lib/Tmdb/Model/Job.php
+++ b/lib/Tmdb/Model/Job.php
@@ -16,9 +16,9 @@
* Class Job
* @package Tmdb\Model
*/
-class Job extends AbstractModel {
-
- public static $_properties = array(
+class Job extends AbstractModel
+{
+ public static $properties = array(
'department',
'job_list'
);
@@ -34,7 +34,7 @@ class Job extends AbstractModel {
private $jobList;
/**
- * @param string $department
+ * @param string $department
* @return $this
*/
public function setDepartment($department)
@@ -51,7 +51,7 @@ public function getDepartment()
}
/**
- * @param array $jobList
+ * @param array $jobList
* @return $this
*/
public function setJobList(array $jobList)
diff --git a/lib/Tmdb/Model/Keyword.php b/lib/Tmdb/Model/Keyword.php
index 7c2755f8..91e91b16 100644
--- a/lib/Tmdb/Model/Keyword.php
+++ b/lib/Tmdb/Model/Keyword.php
@@ -16,23 +16,24 @@
* Class Keyword
* @package Tmdb\Model
*/
-class Keyword extends AbstractModel {
-
+class Keyword extends AbstractModel
+{
private $id;
private $name;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
);
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -45,12 +46,13 @@ public function getId()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Lists.php b/lib/Tmdb/Model/Lists.php
index 722c31f3..e1c13419 100644
--- a/lib/Tmdb/Model/Lists.php
+++ b/lib/Tmdb/Model/Lists.php
@@ -19,8 +19,8 @@
* Class Lists
* @package Tmdb\Model
*/
-class Lists extends AbstractModel {
-
+class Lists extends AbstractModel
+{
/**
* @var string
*/
@@ -71,7 +71,7 @@ class Lists extends AbstractModel {
*/
private $posterImage;
- public static $_properties = array(
+ public static $properties = array(
'created_by',
'description',
'favorite_count',
@@ -88,12 +88,13 @@ public function __construct()
}
/**
- * @param string $createdBy
+ * @param string $createdBy
* @return $this
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
+
return $this;
}
@@ -106,12 +107,13 @@ public function getCreatedBy()
}
/**
- * @param string $description
+ * @param string $description
* @return $this
*/
public function setDescription($description)
{
$this->description = $description;
+
return $this;
}
@@ -124,12 +126,13 @@ public function getDescription()
}
/**
- * @param int $favoriteCount
+ * @param int $favoriteCount
* @return $this
*/
public function setFavoriteCount($favoriteCount)
{
$this->favoriteCount = $favoriteCount;
+
return $this;
}
@@ -142,12 +145,13 @@ public function getFavoriteCount()
}
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -160,12 +164,13 @@ public function getId()
}
/**
- * @param string $iso6391
+ * @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -178,12 +183,13 @@ public function getIso6391()
}
/**
- * @param int $itemCount
+ * @param int $itemCount
* @return $this
*/
public function setItemCount($itemCount)
{
$this->itemCount = $itemCount;
+
return $this;
}
@@ -196,12 +202,13 @@ public function getItemCount()
}
/**
- * @param \Tmdb\Model\Common\GenericCollection $items
+ * @param \Tmdb\Model\Common\GenericCollection $items
* @return $this
*/
public function setItems($items)
{
$this->items = $items;
+
return $this;
}
@@ -214,12 +221,13 @@ public function getItems()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -232,12 +240,13 @@ public function getName()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $posterImage
+ * @param \Tmdb\Model\Image\PosterImage $posterImage
* @return $this
*/
public function setPosterImage($posterImage)
{
$this->posterImage = $posterImage;
+
return $this;
}
@@ -250,12 +259,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Lists/ItemStatus.php b/lib/Tmdb/Model/Lists/ItemStatus.php
index 44187e05..8b8f9524 100644
--- a/lib/Tmdb/Model/Lists/ItemStatus.php
+++ b/lib/Tmdb/Model/Lists/ItemStatus.php
@@ -18,7 +18,8 @@
* Class ItemStatus
* @package Tmdb\Model\Lists
*/
-class ItemStatus extends AbstractModel {
+class ItemStatus extends AbstractModel
+{
/**
* @var string
*/
@@ -32,18 +33,19 @@ class ItemStatus extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'id',
'item_present'
);
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -56,12 +58,13 @@ public function getId()
}
/**
- * @param boolean $itemPresent
+ * @param boolean $itemPresent
* @return $this
*/
public function setItemPresent($itemPresent)
{
$this->itemPresent = $itemPresent;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Lists/ListItem.php b/lib/Tmdb/Model/Lists/ListItem.php
index fdc0a142..350c2475 100644
--- a/lib/Tmdb/Model/Lists/ListItem.php
+++ b/lib/Tmdb/Model/Lists/ListItem.php
@@ -20,7 +20,8 @@
* Class ListItem
* @package Tmdb\Model\Lists
*/
-class ListItem extends AbstractModel {
+class ListItem extends AbstractModel
+{
/**
* @var string
*/
@@ -74,7 +75,7 @@ class ListItem extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'backdrop_path',
'id',
'original_title',
@@ -86,12 +87,13 @@ class ListItem extends AbstractModel {
);
/**
- * @param \Tmdb\Model\Image\BackdropImage $backdropImage
+ * @param \Tmdb\Model\Image\BackdropImage $backdropImage
* @return $this
*/
public function setBackdropImage($backdropImage)
{
$this->backdropImage = $backdropImage;
+
return $this;
}
@@ -104,12 +106,13 @@ public function getBackdropImage()
}
/**
- * @param string $backdropPath
+ * @param string $backdropPath
* @return $this
*/
public function setBackdropPath($backdropPath)
{
$this->backdropPath = $backdropPath;
+
return $this;
}
@@ -122,12 +125,13 @@ public function getBackdropPath()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -140,12 +144,13 @@ public function getId()
}
/**
- * @param string $originalTitle
+ * @param string $originalTitle
* @return $this
*/
public function setOriginalTitle($originalTitle)
{
$this->originalTitle = $originalTitle;
+
return $this;
}
@@ -158,12 +163,13 @@ public function getOriginalTitle()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $posterImage
+ * @param \Tmdb\Model\Image\PosterImage $posterImage
* @return $this
*/
public function setPosterImage($posterImage)
{
$this->posterImage = $posterImage;
+
return $this;
}
@@ -176,12 +182,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -194,12 +201,13 @@ public function getPosterPath()
}
/**
- * @param \DateTime $releaseDate
+ * @param \DateTime $releaseDate
* @return $this
*/
public function setReleaseDate($releaseDate)
{
$this->releaseDate = $releaseDate;
+
return $this;
}
@@ -212,12 +220,13 @@ public function getReleaseDate()
}
/**
- * @param string $title
+ * @param string $title
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
+
return $this;
}
@@ -230,12 +239,13 @@ public function getTitle()
}
/**
- * @param float $voteAverage
+ * @param float $voteAverage
* @return $this
*/
public function setVoteAverage($voteAverage)
{
$this->voteAverage = $voteAverage;
+
return $this;
}
@@ -248,12 +258,13 @@ public function getVoteAverage()
}
/**
- * @param int $voteCount
+ * @param int $voteCount
* @return $this
*/
public function setVoteCount($voteCount)
{
$this->voteCount = $voteCount;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Lists/Result.php b/lib/Tmdb/Model/Lists/Result.php
index 814ed7d5..b9413523 100644
--- a/lib/Tmdb/Model/Lists/Result.php
+++ b/lib/Tmdb/Model/Lists/Result.php
@@ -18,7 +18,8 @@
* Class Result
* @package Tmdb\Model\Lists
*/
-class Result extends AbstractModel {
+class Result extends AbstractModel
+{
/**
* @var int
*/
@@ -32,18 +33,19 @@ class Result extends AbstractModel {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'status_code',
'status_message'
);
/**
- * @param int $statusCode
+ * @param int $statusCode
* @return $this
*/
public function setStatusCode($statusCode)
{
$this->statusCode = $statusCode;
+
return $this;
}
@@ -56,12 +58,13 @@ public function getStatusCode()
}
/**
- * @param string $statusMessage
+ * @param string $statusMessage
* @return $this
*/
public function setStatusMessage($statusMessage)
{
$this->statusMessage = $statusMessage;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Lists/ResultWithListId.php b/lib/Tmdb/Model/Lists/ResultWithListId.php
index 8048496c..d28362bc 100644
--- a/lib/Tmdb/Model/Lists/ResultWithListId.php
+++ b/lib/Tmdb/Model/Lists/ResultWithListId.php
@@ -16,7 +16,8 @@
* Class ResultWithListId
* @package Tmdb\Model\Lists
*/
-class ResultWithListId extends Result {
+class ResultWithListId extends Result
+{
/**
* @var string
*/
@@ -25,19 +26,20 @@ class ResultWithListId extends Result {
/**
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'status_code',
'status_message',
'list_id'
);
/**
- * @param string $listId
+ * @param string $listId
* @return $this
*/
public function setListId($listId)
{
$this->listId = $listId;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Movie.php b/lib/Tmdb/Model/Movie.php
index 94622f4c..ea467361 100644
--- a/lib/Tmdb/Model/Movie.php
+++ b/lib/Tmdb/Model/Movie.php
@@ -17,7 +17,6 @@
use Tmdb\Model\Collection\CreditsCollection;
use Tmdb\Model\Collection\Genres;
use Tmdb\Model\Collection\Images;
-use Tmdb\Model\Collection\People;
use Tmdb\Model\Common\Country;
use Tmdb\Model\Common\SpokenLanguage;
use Tmdb\Model\Common\Translation;
@@ -28,7 +27,8 @@
* Class Movie
* @package Tmdb\Model
*/
-class Movie extends AbstractModel {
+class Movie extends AbstractModel
+{
/**
* @var bool
*/
@@ -220,7 +220,7 @@ class Movie extends AbstractModel {
*
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'adult',
'backdrop_path',
'belongs_to_collection',
@@ -266,12 +266,13 @@ public function __construct()
}
/**
- * @param boolean $adult
+ * @param boolean $adult
* @return $this
*/
public function setAdult($adult)
{
$this->adult = (bool) $adult;
+
return $this;
}
@@ -284,12 +285,13 @@ public function getAdult()
}
/**
- * @param mixed $backdropPath
+ * @param mixed $backdropPath
* @return $this
*/
public function setBackdropPath($backdropPath)
{
$this->backdropPath = $backdropPath;
+
return $this;
}
@@ -302,12 +304,13 @@ public function getBackdropPath()
}
/**
- * @param null $belongsToCollection
+ * @param null $belongsToCollection
* @return $this
*/
public function setBelongsToCollection($belongsToCollection)
{
$this->belongsToCollection = $belongsToCollection;
+
return $this;
}
@@ -320,12 +323,13 @@ public function getBelongsToCollection()
}
/**
- * @param GenericCollection $changes
+ * @param GenericCollection $changes
* @return $this
*/
public function setChanges(GenericCollection $changes)
{
$this->changes = $changes;
+
return $this;
}
@@ -338,12 +342,13 @@ public function getChanges()
}
/**
- * @param Genres $genres
+ * @param Genres $genres
* @return $this
*/
public function setGenres(Genres $genres)
{
$this->genres = $genres;
+
return $this;
}
@@ -356,12 +361,13 @@ public function getGenres()
}
/**
- * @param mixed $homepage
+ * @param mixed $homepage
* @return $this
*/
public function setHomepage($homepage)
{
$this->homepage = $homepage;
+
return $this;
}
@@ -374,12 +380,13 @@ public function getHomepage()
}
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -392,12 +399,13 @@ public function getId()
}
/**
- * @param Images $images
+ * @param Images $images
* @return $this
*/
public function setImages(Images $images)
{
$this->images = $images;
+
return $this;
}
@@ -410,12 +418,13 @@ public function getImages()
}
/**
- * @param mixed $imdbId
+ * @param mixed $imdbId
* @return $this
*/
public function setImdbId($imdbId)
{
$this->imdbId = $imdbId;
+
return $this;
}
@@ -428,12 +437,13 @@ public function getImdbId()
}
/**
- * @param mixed $originalTitle
+ * @param mixed $originalTitle
* @return $this
*/
public function setOriginalTitle($originalTitle)
{
$this->originalTitle = $originalTitle;
+
return $this;
}
@@ -446,12 +456,13 @@ public function getOriginalTitle()
}
/**
- * @param mixed $overview
+ * @param mixed $overview
* @return $this
*/
public function setOverview($overview)
{
$this->overview = $overview;
+
return $this;
}
@@ -464,12 +475,13 @@ public function getOverview()
}
/**
- * @param mixed $popularity
+ * @param mixed $popularity
* @return $this
*/
public function setPopularity($popularity)
{
$this->popularity = (float) $popularity;
+
return $this;
}
@@ -482,12 +494,13 @@ public function getPopularity()
}
/**
- * @param mixed $posterPath
+ * @param mixed $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -500,12 +513,13 @@ public function getPosterPath()
}
/**
- * @param GenericCollection $productionCompanies
+ * @param GenericCollection $productionCompanies
* @return $this
*/
public function setProductionCompanies(GenericCollection $productionCompanies)
{
$this->productionCompanies = $productionCompanies;
+
return $this;
}
@@ -518,12 +532,13 @@ public function getProductionCompanies()
}
/**
- * @param GenericCollection $productionCountries
+ * @param GenericCollection $productionCountries
* @return $this
*/
public function setProductionCountries(GenericCollection $productionCountries)
{
$this->productionCountries = $productionCountries;
+
return $this;
}
@@ -536,7 +551,7 @@ public function getProductionCountries()
}
/**
- * @param string $releaseDate
+ * @param string $releaseDate
* @return $this
*/
public function setReleaseDate($releaseDate)
@@ -546,6 +561,7 @@ public function setReleaseDate($releaseDate)
}
$this->releaseDate = $releaseDate;
+
return $this;
}
@@ -558,12 +574,13 @@ public function getReleaseDate()
}
/**
- * @param mixed $revenue
+ * @param mixed $revenue
* @return $this
*/
public function setRevenue($revenue)
{
$this->revenue = (int) $revenue;
+
return $this;
}
@@ -576,12 +593,13 @@ public function getRevenue()
}
/**
- * @param mixed $runtime
+ * @param mixed $runtime
* @return $this
*/
public function setRuntime($runtime)
{
$this->runtime = (int) $runtime;
+
return $this;
}
@@ -594,12 +612,13 @@ public function getRuntime()
}
/**
- * @param GenericCollection $spokenLanguages
+ * @param GenericCollection $spokenLanguages
* @return $this
*/
public function setSpokenLanguages(GenericCollection $spokenLanguages)
{
$this->spokenLanguages = $spokenLanguages;
+
return $this;
}
@@ -612,12 +631,13 @@ public function getSpokenLanguages()
}
/**
- * @param mixed $status
+ * @param mixed $status
* @return $this
*/
public function setStatus($status)
{
$this->status = $status;
+
return $this;
}
@@ -630,12 +650,13 @@ public function getStatus()
}
/**
- * @param mixed $tagline
+ * @param mixed $tagline
* @return $this
*/
public function setTagline($tagline)
{
$this->tagline = $tagline;
+
return $this;
}
@@ -648,12 +669,13 @@ public function getTagline()
}
/**
- * @param mixed $title
+ * @param mixed $title
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
+
return $this;
}
@@ -666,12 +688,13 @@ public function getTitle()
}
/**
- * @param mixed $voteAverage
+ * @param mixed $voteAverage
* @return $this
*/
public function setVoteAverage($voteAverage)
{
$this->voteAverage = (float) $voteAverage;
+
return $this;
}
@@ -684,12 +707,13 @@ public function getVoteAverage()
}
/**
- * @param mixed $voteCount
+ * @param mixed $voteCount
* @return $this
*/
public function setVoteCount($voteCount)
{
$this->voteCount = (int) $voteCount;
+
return $this;
}
@@ -702,12 +726,13 @@ public function getVoteCount()
}
/**
- * @param GenericCollection $alternativeTitles
+ * @param GenericCollection $alternativeTitles
* @return $this
*/
public function setAlternativeTitles($alternativeTitles)
{
$this->alternativeTitles = $alternativeTitles;
+
return $this;
}
@@ -720,12 +745,13 @@ public function getAlternativeTitles()
}
/**
- * @param int $budget
+ * @param int $budget
* @return $this
*/
public function setBudget($budget)
{
$this->budget = $budget;
+
return $this;
}
@@ -738,12 +764,13 @@ public function getBudget()
}
/**
- * @param CreditsCollection $credits
+ * @param CreditsCollection $credits
* @return $this
*/
public function setCredits(CreditsCollection $credits)
{
$this->credits = $credits;
+
return $this;
}
@@ -756,12 +783,13 @@ public function getCredits()
}
/**
- * @param GenericCollection $keywords
+ * @param GenericCollection $keywords
* @return $this
*/
public function setKeywords($keywords)
{
$this->keywords = $keywords;
+
return $this;
}
@@ -774,12 +802,13 @@ public function getKeywords()
}
/**
- * @param GenericCollection $lists
+ * @param GenericCollection $lists
* @return $this
*/
public function setLists($lists)
{
$this->lists = $lists;
+
return $this;
}
@@ -792,12 +821,13 @@ public function getLists()
}
/**
- * @param GenericCollection $releases
+ * @param GenericCollection $releases
* @return $this
*/
public function setReleases(GenericCollection $releases)
{
$this->releases = $releases;
+
return $this;
}
@@ -810,12 +840,13 @@ public function getReleases()
}
/**
- * @param GenericCollection $similarMovies
+ * @param GenericCollection $similarMovies
* @return $this
*/
public function setSimilarMovies($similarMovies)
{
$this->similarMovies = $similarMovies;
+
return $this;
}
@@ -828,12 +859,13 @@ public function getSimilarMovies()
}
/**
- * @param GenericCollection $trailers
+ * @param GenericCollection $trailers
* @return $this
*/
public function setTrailers($trailers)
{
$this->trailers = $trailers;
+
return $this;
}
@@ -846,12 +878,13 @@ public function getTrailers()
}
/**
- * @param GenericCollection $translations
+ * @param GenericCollection $translations
* @return $this
*/
public function setTranslations($translations)
{
$this->translations = $translations;
+
return $this;
}
@@ -864,12 +897,13 @@ public function getTranslations()
}
/**
- * @param \Tmdb\Model\Image $backdrop
+ * @param \Tmdb\Model\Image $backdrop
* @return $this
*/
public function setBackdropImage($backdrop)
{
$this->backdrop = $backdrop;
+
return $this;
}
@@ -882,12 +916,13 @@ public function getBackdropImage()
}
/**
- * @param \Tmdb\Model\Image $poster
+ * @param \Tmdb\Model\Image $poster
* @return $this
*/
public function setPosterImage($poster)
{
$this->poster = $poster;
+
return $this;
}
@@ -900,12 +935,13 @@ public function getPosterImage()
}
/**
- * @param \Tmdb\Model\Collection\ResultCollection $reviews
+ * @param \Tmdb\Model\Collection\ResultCollection $reviews
* @return $this
*/
public function setReviews($reviews)
{
$this->reviews = $reviews;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Movie/AccountStates.php b/lib/Tmdb/Model/Movie/AccountStates.php
index 062011b2..6d64bcc9 100644
--- a/lib/Tmdb/Model/Movie/AccountStates.php
+++ b/lib/Tmdb/Model/Movie/AccountStates.php
@@ -18,8 +18,8 @@
* Class AccountStates
* @package Tmdb\Model\Movie
*/
-class AccountStates extends AbstractModel {
-
+class AccountStates extends AbstractModel
+{
/**
* @var integer
*/
@@ -40,19 +40,20 @@ class AccountStates extends AbstractModel {
*/
private $watchlist;
- public static $_properties = array(
+ public static $properties = array(
'id',
'favorite',
'watchlist',
);
/**
- * @param boolean $favorite
+ * @param boolean $favorite
* @return $this
*/
public function setFavorite($favorite)
{
$this->favorite = $favorite;
+
return $this;
}
@@ -65,12 +66,13 @@ public function getFavorite()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -83,12 +85,13 @@ public function getId()
}
/**
- * @param \Tmdb\Model\Movie\Rating $rated
+ * @param \Tmdb\Model\Movie\Rating $rated
* @return $this
*/
public function setRated($rated)
{
$this->rated = $rated;
+
return $this;
}
@@ -101,12 +104,13 @@ public function getRated()
}
/**
- * @param boolean $watchlist
+ * @param boolean $watchlist
* @return $this
*/
public function setWatchlist($watchlist)
{
$this->watchlist = $watchlist;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Movie/AlternativeTitle.php b/lib/Tmdb/Model/Movie/AlternativeTitle.php
index d8b388df..ae7d8180 100644
--- a/lib/Tmdb/Model/Movie/AlternativeTitle.php
+++ b/lib/Tmdb/Model/Movie/AlternativeTitle.php
@@ -19,23 +19,24 @@
* Class AlternativeTitle
* @package Tmdb\Model\Movie
*/
-class AlternativeTitle extends AbstractModel implements CountryFilter {
-
+class AlternativeTitle extends AbstractModel implements CountryFilter
+{
private $iso31661;
private $title;
- public static $_properties = array(
+ public static $properties = array(
'iso_3166_1',
'title',
);
/**
- * @param string $iso31661
+ * @param string $iso31661
* @return $this
*/
public function setIso31661($iso31661)
{
$this->iso31661 = $iso31661;
+
return $this;
}
@@ -48,12 +49,13 @@ public function getIso31661()
}
/**
- * @param string $title
+ * @param string $title
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Movie/ListItem.php b/lib/Tmdb/Model/Movie/ListItem.php
index 1eda953b..c8188f7c 100644
--- a/lib/Tmdb/Model/Movie/ListItem.php
+++ b/lib/Tmdb/Model/Movie/ListItem.php
@@ -19,8 +19,8 @@
* Class ListItem
* @package Tmdb\Model\Movie
*/
-class ListItem extends AbstractModel {
-
+class ListItem extends AbstractModel
+{
/**
* @var string
*/
@@ -61,7 +61,7 @@ class ListItem extends AbstractModel {
*/
private $posterImage;
- public static $_properties = array(
+ public static $properties = array(
'description',
'favorite_count',
'id',
@@ -72,12 +72,13 @@ class ListItem extends AbstractModel {
);
/**
- * @param string $description
+ * @param string $description
* @return $this
*/
public function setDescription($description)
{
$this->description = $description;
+
return $this;
}
@@ -90,12 +91,13 @@ public function getDescription()
}
/**
- * @param int $favoriteCount
+ * @param int $favoriteCount
* @return $this
*/
public function setFavoriteCount($favoriteCount)
{
$this->favoriteCount = $favoriteCount;
+
return $this;
}
@@ -108,12 +110,13 @@ public function getFavoriteCount()
}
/**
- * @param string $id
+ * @param string $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -126,12 +129,13 @@ public function getId()
}
/**
- * @param string $iso6391
+ * @param string $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -144,12 +148,13 @@ public function getIso6391()
}
/**
- * @param int $itemCount
+ * @param int $itemCount
* @return $this
*/
public function setItemCount($itemCount)
{
$this->itemCount = $itemCount;
+
return $this;
}
@@ -162,12 +167,13 @@ public function getItemCount()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -180,12 +186,13 @@ public function getName()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $posterImage
+ * @param \Tmdb\Model\Image\PosterImage $posterImage
* @return $this
*/
public function setPosterImage($posterImage)
{
$this->posterImage = $posterImage;
+
return $this;
}
@@ -198,12 +205,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -214,6 +222,4 @@ public function getPosterPath()
{
return $this->posterPath;
}
-
-
}
diff --git a/lib/Tmdb/Model/Movie/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Movie/QueryParameter/AppendToResponse.php
index 532af7cc..433c6086 100644
--- a/lib/Tmdb/Model/Movie/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Movie/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Movie\QueryParameter
*/
-final class AppendToResponse extends BaseAppendToResponse {
+final class AppendToResponse extends BaseAppendToResponse
+{
const ALTERNATIVE_TITLES = 'alternative_titles';
const CREDITS = 'credits';
const IMAGES = 'images';
diff --git a/lib/Tmdb/Model/Movie/Rating.php b/lib/Tmdb/Model/Movie/Rating.php
index a9d11b9e..71af8de6 100644
--- a/lib/Tmdb/Model/Movie/Rating.php
+++ b/lib/Tmdb/Model/Movie/Rating.php
@@ -18,24 +18,25 @@
* Class Rating
* @package Tmdb\Model\Movie
*/
-class Rating extends AbstractModel {
-
+class Rating extends AbstractModel
+{
/**
* @var float
*/
private $value;
- public static $_properties = array(
+ public static $properties = array(
'value',
);
/**
- * @param float $value
+ * @param float $value
* @return $this
*/
public function setValue($value)
{
$this->value = $value;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Movie/Release.php b/lib/Tmdb/Model/Movie/Release.php
index 2b739301..16d94c64 100644
--- a/lib/Tmdb/Model/Movie/Release.php
+++ b/lib/Tmdb/Model/Movie/Release.php
@@ -19,25 +19,26 @@
* Class Release
* @package Tmdb\Model\Movie
*/
-class Release extends AbstractModel implements CountryFilter {
-
+class Release extends AbstractModel implements CountryFilter
+{
private $iso31661;
private $certification;
private $releaseDate;
- public static $_properties = array(
+ public static $properties = array(
'iso_3166_1',
'certification',
'release_date'
);
/**
- * @param mixed $certification
+ * @param mixed $certification
* @return $this
*/
public function setCertification($certification)
{
$this->certification = $certification;
+
return $this;
}
@@ -50,12 +51,13 @@ public function getCertification()
}
/**
- * @param string $iso31661
+ * @param string $iso31661
* @return $this
*/
public function setIso31661($iso31661)
{
$this->iso31661 = $iso31661;
+
return $this;
}
@@ -68,7 +70,7 @@ public function getIso31661()
}
/**
- * @param string|\DateTime $releaseDate
+ * @param string|\DateTime $releaseDate
* @return $this
*/
public function setReleaseDate($releaseDate)
@@ -78,6 +80,7 @@ public function setReleaseDate($releaseDate)
}
$this->releaseDate = $releaseDate;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Network.php b/lib/Tmdb/Model/Network.php
index db2f1d1e..f7174d3e 100644
--- a/lib/Tmdb/Model/Network.php
+++ b/lib/Tmdb/Model/Network.php
@@ -16,23 +16,24 @@
* Class Network
* @package Tmdb\Model
*/
-class Network extends AbstractModel {
-
+class Network extends AbstractModel
+{
private $id;
private $name;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
);
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -45,12 +46,13 @@ public function getId()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Person.php b/lib/Tmdb/Model/Person.php
index ced88646..d2a8db30 100644
--- a/lib/Tmdb/Model/Person.php
+++ b/lib/Tmdb/Model/Person.php
@@ -23,8 +23,8 @@
* Class Person
* @package Tmdb\Model
*/
-class Person extends AbstractModel implements PersonInterface {
-
+class Person extends AbstractModel implements PersonInterface
+{
/**
* @var bool
*/
@@ -117,7 +117,7 @@ class Person extends AbstractModel implements PersonInterface {
*/
protected $externalIds;
- public static $_properties = array(
+ public static $properties = array(
'adult',
'also_known_as',
'biography',
@@ -147,12 +147,13 @@ public function __construct()
}
/**
- * @param mixed $adult
+ * @param mixed $adult
* @return $this
*/
public function setAdult($adult)
{
$this->adult = $adult;
+
return $this;
}
@@ -165,12 +166,13 @@ public function getAdult()
}
/**
- * @param mixed $alsoKnownAs
+ * @param mixed $alsoKnownAs
* @return $this
*/
public function setAlsoKnownAs($alsoKnownAs)
{
$this->alsoKnownAs = $alsoKnownAs;
+
return $this;
}
@@ -183,12 +185,13 @@ public function getAlsoKnownAs()
}
/**
- * @param mixed $biography
+ * @param mixed $biography
* @return $this
*/
public function setBiography($biography)
{
$this->biography = $biography;
+
return $this;
}
@@ -201,7 +204,7 @@ public function getBiography()
}
/**
- * @param mixed $birthday
+ * @param mixed $birthday
* @return $this
*/
public function setBirthday($birthday)
@@ -211,6 +214,7 @@ public function setBirthday($birthday)
}
$this->birthday = $birthday;
+
return $this;
}
@@ -223,12 +227,13 @@ public function getBirthday()
}
/**
- * @param mixed $changes
+ * @param mixed $changes
* @return $this
*/
public function setChanges($changes)
{
$this->changes = $changes;
+
return $this;
}
@@ -241,12 +246,13 @@ public function getChanges()
}
/**
- * @param mixed $credits
+ * @param mixed $credits
* @return $this
*/
public function setCredits($credits)
{
$this->credits = $credits;
+
return $this;
}
@@ -259,7 +265,7 @@ public function getCredits()
}
/**
- * @param mixed $deathday
+ * @param mixed $deathday
* @return $this
*/
public function setDeathday($deathday)
@@ -273,6 +279,7 @@ public function setDeathday($deathday)
}
$this->deathday = $deathday;
+
return $this;
}
@@ -285,12 +292,13 @@ public function getDeathday()
}
/**
- * @param mixed $homepage
+ * @param mixed $homepage
* @return $this
*/
public function setHomepage($homepage)
{
$this->homepage = $homepage;
+
return $this;
}
@@ -303,12 +311,13 @@ public function getHomepage()
}
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -321,12 +330,13 @@ public function getId()
}
/**
- * @param Images $images
+ * @param Images $images
* @return $this
*/
public function setImages($images)
{
$this->images = $images;
+
return $this;
}
@@ -339,12 +349,13 @@ public function getImages()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -357,12 +368,13 @@ public function getName()
}
/**
- * @param mixed $placeOfBirth
+ * @param mixed $placeOfBirth
* @return $this
*/
public function setPlaceOfBirth($placeOfBirth)
{
$this->placeOfBirth = $placeOfBirth;
+
return $this;
}
@@ -375,12 +387,13 @@ public function getPlaceOfBirth()
}
/**
- * @param mixed $profilePath
+ * @param mixed $profilePath
* @return $this
*/
public function setProfilePath($profilePath)
{
$this->profilePath = $profilePath;
+
return $this;
}
@@ -393,12 +406,13 @@ public function getProfilePath()
}
/**
- * @param ProfileImage $profileImage
+ * @param ProfileImage $profileImage
* @return $this
*/
public function setProfileImage(ProfileImage $profileImage)
{
$this->profileImage = $profileImage;
+
return $this;
}
@@ -411,12 +425,13 @@ public function getProfileImage()
}
/**
- * @param \Tmdb\Model\Collection\CreditsCollection\CombinedCredits $combinedCredits
+ * @param \Tmdb\Model\Collection\CreditsCollection\CombinedCredits $combinedCredits
* @return $this
*/
public function setCombinedCredits($combinedCredits)
{
$this->combinedCredits = $combinedCredits;
+
return $this;
}
@@ -429,12 +444,13 @@ public function getCombinedCredits()
}
/**
- * @param \Tmdb\Model\Collection\CreditsCollection\MovieCredits $movieCredits
+ * @param \Tmdb\Model\Collection\CreditsCollection\MovieCredits $movieCredits
* @return $this
*/
public function setMovieCredits($movieCredits)
{
$this->movieCredits = $movieCredits;
+
return $this;
}
@@ -447,12 +463,13 @@ public function getMovieCredits()
}
/**
- * @param \Tmdb\Model\Collection\CreditsCollection\TvCredits $tvCredits
+ * @param \Tmdb\Model\Collection\CreditsCollection\TvCredits $tvCredits
* @return $this
*/
public function setTvCredits($tvCredits)
{
$this->tvCredits = $tvCredits;
+
return $this;
}
@@ -465,12 +482,13 @@ public function getTvCredits()
}
/**
- * @param \Tmdb\Model\Common\ExternalIds $externalIds
+ * @param \Tmdb\Model\Common\ExternalIds $externalIds
* @return $this
*/
public function setExternalIds($externalIds)
{
$this->externalIds = $externalIds;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Person/AbstractMember.php b/lib/Tmdb/Model/Person/AbstractMember.php
index 283c2af5..a4c79282 100644
--- a/lib/Tmdb/Model/Person/AbstractMember.php
+++ b/lib/Tmdb/Model/Person/AbstractMember.php
@@ -19,8 +19,8 @@
* Class AbstractMember
* @package Tmdb\Model\Person
*/
-abstract class AbstractMember extends AbstractModel {
-
+abstract class AbstractMember extends AbstractModel
+{
/**
* @var int
*/
@@ -41,19 +41,20 @@ abstract class AbstractMember extends AbstractModel {
*/
private $profile;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
'profile_path'
);
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -66,12 +67,13 @@ public function getId()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -84,12 +86,13 @@ public function getName()
}
/**
- * @param mixed $profilePath
+ * @param mixed $profilePath
* @return $this
*/
public function setProfilePath($profilePath)
{
$this->profilePath = $profilePath;
+
return $this;
}
@@ -102,12 +105,13 @@ public function getProfilePath()
}
/**
- * @param Image\ProfileImage $profile
+ * @param Image\ProfileImage $profile
* @return $this
*/
public function setProfileImage($profile = null)
{
$this->profile = $profile;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Person/CastMember.php b/lib/Tmdb/Model/Person/CastMember.php
index bbf47e10..129bbdd8 100644
--- a/lib/Tmdb/Model/Person/CastMember.php
+++ b/lib/Tmdb/Model/Person/CastMember.php
@@ -18,8 +18,8 @@
* Class CastMember
* @package Tmdb\Model\Person
*/
-class CastMember extends AbstractMember implements PersonInterface {
-
+class CastMember extends AbstractMember implements PersonInterface
+{
/**
* @var string
*/
@@ -35,7 +35,7 @@ class CastMember extends AbstractMember implements PersonInterface {
*/
private $castId;
- public static $_properties = array(
+ public static $properties = array(
'id',
'cast_id',
'name',
@@ -45,12 +45,13 @@ class CastMember extends AbstractMember implements PersonInterface {
);
/**
- * @param mixed $character
+ * @param mixed $character
* @return $this
*/
public function setCharacter($character)
{
$this->character = $character;
+
return $this;
}
@@ -63,12 +64,13 @@ public function getCharacter()
}
/**
- * @param int $order
+ * @param int $order
* @return $this
*/
public function setOrder($order)
{
$this->order = (int) $order;
+
return $this;
}
@@ -81,12 +83,13 @@ public function getOrder()
}
/**
- * @param mixed $castId
+ * @param mixed $castId
* @return $this
*/
public function setCastId($castId)
{
$this->castId = (int) $castId;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Person/CrewMember.php b/lib/Tmdb/Model/Person/CrewMember.php
index 83b395a4..bf53811b 100644
--- a/lib/Tmdb/Model/Person/CrewMember.php
+++ b/lib/Tmdb/Model/Person/CrewMember.php
@@ -18,8 +18,8 @@
* Class CrewMember
* @package Tmdb\Model\Person
*/
-class CrewMember extends AbstractMember implements PersonInterface {
-
+class CrewMember extends AbstractMember implements PersonInterface
+{
/**
* @var string
*/
@@ -30,7 +30,7 @@ class CrewMember extends AbstractMember implements PersonInterface {
*/
private $job;
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
'department',
@@ -39,12 +39,13 @@ class CrewMember extends AbstractMember implements PersonInterface {
);
/**
- * @param mixed $department
+ * @param mixed $department
* @return $this
*/
public function setDepartment($department)
{
$this->department = $department;
+
return $this;
}
@@ -57,12 +58,13 @@ public function getDepartment()
}
/**
- * @param mixed $job
+ * @param mixed $job
* @return $this
*/
public function setJob($job)
{
$this->job = $job;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Person/MovieCredit.php b/lib/Tmdb/Model/Person/MovieCredit.php
index afb232ea..db117427 100644
--- a/lib/Tmdb/Model/Person/MovieCredit.php
+++ b/lib/Tmdb/Model/Person/MovieCredit.php
@@ -19,8 +19,8 @@
* Class MovieCredit
* @package Tmdb\Model\Person
*/
-class MovieCredit extends AbstractModel {
-
+class MovieCredit extends AbstractModel
+{
/**
* @var bool
*/
@@ -66,7 +66,7 @@ class MovieCredit extends AbstractModel {
*/
private $posterImage;
- public static $_properties = array(
+ public static $properties = array(
'adult',
'character',
'credit_id',
@@ -78,12 +78,13 @@ class MovieCredit extends AbstractModel {
);
/**
- * @param boolean $adult
+ * @param boolean $adult
* @return $this
*/
public function setAdult($adult)
{
$this->adult = $adult;
+
return $this;
}
@@ -96,12 +97,13 @@ public function getAdult()
}
/**
- * @param string $character
+ * @param string $character
* @return $this
*/
public function setCharacter($character)
{
$this->character = $character;
+
return $this;
}
@@ -114,12 +116,13 @@ public function getCharacter()
}
/**
- * @param string $creditId
+ * @param string $creditId
* @return $this
*/
public function setCreditId($creditId)
{
$this->creditId = $creditId;
+
return $this;
}
@@ -132,12 +135,13 @@ public function getCreditId()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -150,12 +154,13 @@ public function getId()
}
/**
- * @param string $originalTitle
+ * @param string $originalTitle
* @return $this
*/
public function setOriginalTitle($originalTitle)
{
$this->originalTitle = $originalTitle;
+
return $this;
}
@@ -168,12 +173,13 @@ public function getOriginalTitle()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $posterImage
+ * @param \Tmdb\Model\Image\PosterImage $posterImage
* @return $this
*/
public function setPosterImage($posterImage)
{
$this->posterImage = $posterImage;
+
return $this;
}
@@ -186,12 +192,13 @@ public function getPosterImage()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -204,7 +211,7 @@ public function getPosterPath()
}
/**
- * @param \DateTime $releaseDate
+ * @param \DateTime $releaseDate
* @return $this
*/
public function setReleaseDate($releaseDate)
@@ -214,6 +221,7 @@ public function setReleaseDate($releaseDate)
}
$this->releaseDate = $releaseDate;
+
return $this;
}
@@ -226,12 +234,13 @@ public function getReleaseDate()
}
/**
- * @param string $title
+ * @param string $title
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
+
return $this;
}
@@ -242,6 +251,4 @@ public function getTitle()
{
return $this->title;
}
-
-
}
diff --git a/lib/Tmdb/Model/Person/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Person/QueryParameter/AppendToResponse.php
index 8d851d26..9ecb80c1 100644
--- a/lib/Tmdb/Model/Person/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Person/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Person\QueryParameter
*/
-final class AppendToResponse extends BaseAppendToResponse {
+final class AppendToResponse extends BaseAppendToResponse
+{
const MOVIE_CREDITS = 'movie_credits';
const TV_CREDITS = 'tv_credits';
const COMBINED_CREDITS = 'combined_credits';
diff --git a/lib/Tmdb/Model/Query/ChangesQuery.php b/lib/Tmdb/Model/Query/ChangesQuery.php
index 513593e9..886a047e 100644
--- a/lib/Tmdb/Model/Query/ChangesQuery.php
+++ b/lib/Tmdb/Model/Query/ChangesQuery.php
@@ -18,12 +18,12 @@
* Class ChangesQuery
* @package Tmdb\Model\Query
*/
-class ChangesQuery extends QueryParametersCollection {
-
+class ChangesQuery extends QueryParametersCollection
+{
/**
* Set the from parameter
*
- * @param \DateTime $date
+ * @param \DateTime $date
* @return $this
*/
public function from(\DateTime $date)
@@ -36,7 +36,7 @@ public function from(\DateTime $date)
/**
* Set the to parameter
*
- * @param \DateTime $date
+ * @param \DateTime $date
* @return $this
*/
public function to(\DateTime $date)
@@ -49,10 +49,11 @@ public function to(\DateTime $date)
/**
* Set the page parameter
*
- * @param int $page
+ * @param int $page
* @return $this
*/
- public function page($page = 1) {
+ public function page($page = 1)
+ {
$this->set('page', (int) $page);
return $this;
diff --git a/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php b/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php
index 68b3b6eb..b49c0e58 100644
--- a/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php
+++ b/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php
@@ -18,11 +18,12 @@
* Class DiscoverMoviesQuery
* @package Tmdb\Model\Query\Discover
*/
-class DiscoverMoviesQuery extends QueryParametersCollection {
+class DiscoverMoviesQuery extends QueryParametersCollection
+{
/**
* Minimum value is 1, expected value is an integer.
*
- * @param integer $page
+ * @param integer $page
* @return $this
*/
public function page($page = 1)
@@ -35,7 +36,7 @@ public function page($page = 1)
/**
* ISO 639-1 code.
*
- * @param string $language
+ * @param string $language
* @return $this
*/
public function language($language)
@@ -46,9 +47,10 @@ public function language($language)
}
/**
- * Available options are vote_average.desc, vote_average.asc, release_date.desc, release_date.asc, popularity.desc, popularity.asc
+ * Available options are vote_average.desc, vote_average.asc, release_date.desc,
+ * release_date.asc, popularity.desc, popularity.asc
*
- * @param string $option
+ * @param string $option
* @return $this
*/
public function sortBy($option)
@@ -61,7 +63,7 @@ public function sortBy($option)
/**
* Toggle the inclusion of adult titles. Expected value is a boolean, true or false
*
- * @param boolean $allow
+ * @param boolean $allow
* @return $this
*/
public function includeAdult($allow = true)
@@ -72,9 +74,10 @@ public function includeAdult($allow = true)
}
/**
- * Filter the results release dates to matches that include this value. Expected value is a year.
+ * Filter the results release dates to matches that include this value.
+ * Expected value is a year.
*
- * @param \DateTime|integer $year
+ * @param \DateTime|integer $year
* @return $this
*/
public function year($year)
@@ -89,9 +92,10 @@ public function year($year)
}
/**
- * Filter the results so that only the primary release date year has this value. Expected value is a year.
+ * Filter the results so that only the primary release date year has this value.
+ * Expected value is a year.
*
- * @param \DateTime|integer $year
+ * @param \DateTime|integer $year
* @return $this
*/
public function primaryReleaseYear($year)
@@ -106,9 +110,10 @@ public function primaryReleaseYear($year)
}
/**
- * Only include movies that are equal to, or have a vote count higher than this value. Expected value is an integer.
+ * Only include movies that are equal to, or have a vote count higher than this value.
+ * Expected value is an integer.
*
- * @param integer $count
+ * @param integer $count
* @return $this
*/
public function voteCountGte($count)
@@ -119,9 +124,10 @@ public function voteCountGte($count)
}
/**
- * Only include movies that are equal to, or have a higher average rating than this value. Expected value is a float.
+ * Only include movies that are equal to, or have a higher average rating than this value.
+ * Expected value is a float.
*
- * @param float $average
+ * @param float $average
* @return $this
*/
public function voteAverageGte($average)
@@ -132,14 +138,16 @@ public function voteAverageGte($average)
}
/**
- * Only include movies with the specified genres. Expected value is an integer (the id of a genre).
+ * Only include movies with the specified genres.
+ * Expected value is an integer (the id of a genre).
+ *
* Multiple values can be specified.
*
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'.
*
* If an array is supplied this defaults to an AND query
*
- * @param array|string $genres
+ * @param array|string $genres
* @return $this
*/
public function withGenres($genres)
@@ -156,7 +164,7 @@ public function withGenres($genres)
/**
* Creates an or query for genres
*
- * @param array $genres
+ * @param array $genres
* @return $this
*/
public function withGenresOr(array $genres = array())
@@ -169,7 +177,7 @@ public function withGenresOr(array $genres = array())
/**
* Creates an and query for genres
*
- * @param array $genres
+ * @param array $genres
* @return $this
*/
public function withGenresAnd(array $genres = array())
@@ -182,7 +190,7 @@ public function withGenresAnd(array $genres = array())
/**
* The minimum release to include.
*
- * @param \DateTime|string $date
+ * @param \DateTime|string $date
* @return $this
*/
public function releaseDateGte($date)
@@ -199,7 +207,7 @@ public function releaseDateGte($date)
/**
* The maximum release to include.
*
- * @param \DateTime $date
+ * @param \DateTime $date
* @return $this
*/
public function releaseDateLte(\DateTime $date)
@@ -216,9 +224,10 @@ public function releaseDateLte(\DateTime $date)
/**
* Only include movies with certifications for a specific country.
*
- * When this value is specified, 'certification.lte' is required. A ISO 3166-1 is expected.
+ * When this value is specified, 'certification.lte' is required.
+ * A ISO 3166-1 is expected.
*
- * @param string $country
+ * @param string $country
* @return $this
*/
public function certificationCountry($country)
@@ -233,7 +242,7 @@ public function certificationCountry($country)
*
* Expected value is a valid certification for the specificed 'certification_country'.
*
- * @param mixed $value
+ * @param mixed $value
* @return $this
*/
public function certificationLte($value)
@@ -249,7 +258,7 @@ public function certificationLte($value)
* Expected value is an integer (the id of a company).
* They can be comma separated to indicate an 'AND' query.
*
- * @param array|string $companies
+ * @param array|string $companies
* @return $this
*/
public function withCompanies($companies)
@@ -266,7 +275,7 @@ public function withCompanies($companies)
/**
* Creates an and query for companies
*
- * @param array $companies
+ * @param array $companies
* @return $this
*/
public function withCompaniesAnd(array $companies = array())
diff --git a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php
index 6066e637..5e2f336f 100644
--- a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php
+++ b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php
@@ -18,11 +18,12 @@
* Class DiscoverTvQuery
* @package Tmdb\Model\Query\Discover
*/
-class DiscoverTvQuery extends QueryParametersCollection {
+class DiscoverTvQuery extends QueryParametersCollection
+{
/**
* Minimum value is 1, expected value is an integer.
*
- * @param integer $page
+ * @param integer $page
* @return $this
*/
public function page($page = 1)
@@ -35,7 +36,7 @@ public function page($page = 1)
/**
* ISO 639-1 code.
*
- * @param string $language
+ * @param string $language
* @return $this
*/
public function language($language)
@@ -46,9 +47,10 @@ public function language($language)
}
/**
- * Available options are vote_average.desc, vote_average.asc, first_air_date.desc, first_air_date.asc, popularity.desc, popularity.asc
+ * Available options are vote_average.desc, vote_average.asc, first_air_date.desc,
+ * first_air_date.asc, popularity.desc, popularity.asc
*
- * @param string $option
+ * @param string $option
* @return $this
*/
public function sortBy($option)
@@ -59,9 +61,10 @@ public function sortBy($option)
}
/**
- * Filter the results release dates to matches that include this value. Expected value is a year.
+ * Filter the results release dates to matches that include this value.
+ * Expected value is a year.
*
- * @param \DateTime|integer $year
+ * @param \DateTime|integer $year
* @return $this
*/
public function firstAirDateYear($year)
@@ -76,9 +79,10 @@ public function firstAirDateYear($year)
}
/**
- * Only include TV shows that are equal to, or have a vote count higher than this value. Expected value is an integer.
+ * Only include TV shows that are equal to, or have a vote count higher than this value.
+ * Expected value is an integer.
*
- * @param integer $count
+ * @param integer $count
* @return $this
*/
public function voteCountGte($count)
@@ -89,9 +93,10 @@ public function voteCountGte($count)
}
/**
- * Only include TV shows that are equal to, or have a higher average rating than this value. Expected value is a float.
+ * Only include TV shows that are equal to, or have a higher average rating than this value.
+ * Expected value is a float.
*
- * @param float $average
+ * @param float $average
* @return $this
*/
public function voteAverageGte($average)
@@ -102,12 +107,15 @@ public function voteAverageGte($average)
}
/**
- * Only include TV shows with the specified genres. Expected value is an integer (the id of a genre).
+ * Only include TV shows with the specified genres.
+ * Expected value is an integer (the id of a genre).
*
* Multiple values can be specified.
- * Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'.
*
- * @param array|string $genres
+ * Comma separated indicates an 'AND' query,
+ * while a pipe (|) separated value indicates an 'OR'.
+ *
+ * @param array|string $genres
* @return $this
*/
public function withGenres($genres)
@@ -124,7 +132,7 @@ public function withGenres($genres)
/**
* Creates an OR query for genres
*
- * @param array $genres
+ * @param array $genres
* @return $this
*/
public function withGenresOr(array $genres = array())
@@ -137,7 +145,7 @@ public function withGenresOr(array $genres = array())
/**
* Creates an AND query for genres
*
- * @param array $genres
+ * @param array $genres
* @return $this
*/
public function withGenresAnd(array $genres = array())
@@ -150,7 +158,7 @@ public function withGenresAnd(array $genres = array())
/**
* The minimum release to include. Expected format is YYYY-MM-DD.
*
- * @param \DateTime|string $date
+ * @param \DateTime|string $date
* @return $this
*/
public function firstAirDateGte($date)
@@ -167,7 +175,7 @@ public function firstAirDateGte($date)
/**
* The maximum release to include. Expected format is YYYY-MM-DD.
*
- * @param \DateTime|string $date
+ * @param \DateTime|string $date
* @return $this
*/
public function firstAirDateLte($date)
@@ -181,16 +189,16 @@ public function firstAirDateLte($date)
return $this;
}
-
/**
* Filter TV shows to include a specific network.
*
- * Expected value is an integer (the id of a network). They can be comma separated to indicate an 'AND' query.
+ * Expected value is an integer (the id of a network).
+ * They can be comma separated to indicate an 'AND' query.
*
* Expected value is an integer (the id of a company).
* They can be comma separated to indicate an 'AND' query.
*
- * @param array|string $networks
+ * @param array|string $networks
* @return $this
*/
public function withNetworks($networks)
@@ -207,7 +215,7 @@ public function withNetworks($networks)
/**
* Creates an and query for networks
*
- * @param array $networks
+ * @param array $networks
* @return $this
*/
public function withNetworksAnd(array $networks = array())
diff --git a/lib/Tmdb/Model/Query/FindQuery.php b/lib/Tmdb/Model/Query/FindQuery.php
index eadfdc2b..c48ba393 100644
--- a/lib/Tmdb/Model/Query/FindQuery.php
+++ b/lib/Tmdb/Model/Query/FindQuery.php
@@ -19,6 +19,6 @@
* Class FindQuery
* @package Tmdb\Model\Query
*/
-class FindQuery extends QueryParametersCollection {
-
+class FindQuery extends QueryParametersCollection
+{
}
diff --git a/lib/Tmdb/Model/Review.php b/lib/Tmdb/Model/Review.php
index f56e2f89..c49f659c 100644
--- a/lib/Tmdb/Model/Review.php
+++ b/lib/Tmdb/Model/Review.php
@@ -16,8 +16,8 @@
* Class Review
* @package Tmdb\Model
*/
-class Review extends AbstractModel {
-
+class Review extends AbstractModel
+{
private $id;
private $author;
private $content;
@@ -27,7 +27,7 @@ class Review extends AbstractModel {
private $mediaType;
private $url;
- public static $_properties = array(
+ public static $properties = array(
'id',
'author',
'content',
@@ -39,12 +39,13 @@ class Review extends AbstractModel {
);
/**
- * @param mixed $author
+ * @param mixed $author
* @return $this
*/
public function setAuthor($author)
{
$this->author = $author;
+
return $this;
}
@@ -57,12 +58,13 @@ public function getAuthor()
}
/**
- * @param mixed $content
+ * @param mixed $content
* @return $this
*/
public function setContent($content)
{
$this->content = $content;
+
return $this;
}
@@ -75,12 +77,13 @@ public function getContent()
}
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -93,12 +96,13 @@ public function getId()
}
/**
- * @param mixed $iso6391
+ * @param mixed $iso6391
* @return $this
*/
public function setIso6391($iso6391)
{
$this->iso6391 = $iso6391;
+
return $this;
}
@@ -111,12 +115,13 @@ public function getIso6391()
}
/**
- * @param mixed $mediaId
+ * @param mixed $mediaId
* @return $this
*/
public function setMediaId($mediaId)
{
$this->mediaId = $mediaId;
+
return $this;
}
@@ -129,12 +134,13 @@ public function getMediaId()
}
/**
- * @param mixed $mediaTitle
+ * @param mixed $mediaTitle
* @return $this
*/
public function setMediaTitle($mediaTitle)
{
$this->mediaTitle = $mediaTitle;
+
return $this;
}
@@ -147,12 +153,13 @@ public function getMediaTitle()
}
/**
- * @param mixed $mediaType
+ * @param mixed $mediaType
* @return $this
*/
public function setMediaType($mediaType)
{
$this->mediaType = $mediaType;
+
return $this;
}
@@ -165,12 +172,13 @@ public function getMediaType()
}
/**
- * @param mixed $url
+ * @param mixed $url
* @return $this
*/
public function setUrl($url)
{
$this->url = $url;
+
return $this;
}
@@ -181,6 +189,4 @@ public function getUrl()
{
return $this->url;
}
-
-
}
diff --git a/lib/Tmdb/Model/Search/SearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery.php
index e32b95f8..1dcb94ce 100644
--- a/lib/Tmdb/Model/Search/SearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery.php
@@ -18,7 +18,8 @@
* Class SearchQuery
* @package Tmdb\Model\Search
*/
-class SearchQuery extends QueryParametersCollection {
+class SearchQuery extends QueryParametersCollection
+{
/**
* CGI escaped string
*
diff --git a/lib/Tmdb/Model/Search/SearchQuery/CollectionSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/CollectionSearchQuery.php
index db513d7f..5de738d8 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/CollectionSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/CollectionSearchQuery.php
@@ -18,7 +18,8 @@
* Class CollectionSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class CollectionSearchQuery extends SearchQuery {
+class CollectionSearchQuery extends SearchQuery
+{
/**
* ISO 639-1 code.
*
diff --git a/lib/Tmdb/Model/Search/SearchQuery/CompanySearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/CompanySearchQuery.php
index 03741501..da281a46 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/CompanySearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/CompanySearchQuery.php
@@ -18,4 +18,6 @@
* Class CompanySearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class CompanySearchQuery extends SearchQuery {}
+class CompanySearchQuery extends SearchQuery
+{
+}
diff --git a/lib/Tmdb/Model/Search/SearchQuery/KeywordSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/KeywordSearchQuery.php
index 972287a7..487ce2cc 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/KeywordSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/KeywordSearchQuery.php
@@ -18,4 +18,6 @@
* Class KeywordSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class KeywordSearchQuery extends SearchQuery {}
+class KeywordSearchQuery extends SearchQuery
+{
+}
diff --git a/lib/Tmdb/Model/Search/SearchQuery/ListSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/ListSearchQuery.php
index 05206313..28ddb761 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/ListSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/ListSearchQuery.php
@@ -18,8 +18,8 @@
* Class ListSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class ListSearchQuery extends SearchQuery {
-
+class ListSearchQuery extends SearchQuery
+{
/**
* Toggle the inclusion of adult titles. Expected value is: true or false
*
diff --git a/lib/Tmdb/Model/Search/SearchQuery/MovieSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/MovieSearchQuery.php
index 58fc7e0b..7ebe7f82 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/MovieSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/MovieSearchQuery.php
@@ -18,7 +18,8 @@
* Class MovieSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class MovieSearchQuery extends SearchQuery {
+class MovieSearchQuery extends SearchQuery
+{
/**
* ISO 639-1 code.
*
diff --git a/lib/Tmdb/Model/Search/SearchQuery/PersonSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/PersonSearchQuery.php
index ab86ffa6..4402bce5 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/PersonSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/PersonSearchQuery.php
@@ -18,8 +18,8 @@
* Class PersonSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class PersonSearchQuery extends SearchQuery {
-
+class PersonSearchQuery extends SearchQuery
+{
/**
* Toggle the inclusion of adult titles. Expected value is: true or false
*
diff --git a/lib/Tmdb/Model/Search/SearchQuery/TvSearchQuery.php b/lib/Tmdb/Model/Search/SearchQuery/TvSearchQuery.php
index d8863425..8e2cf30f 100644
--- a/lib/Tmdb/Model/Search/SearchQuery/TvSearchQuery.php
+++ b/lib/Tmdb/Model/Search/SearchQuery/TvSearchQuery.php
@@ -18,7 +18,8 @@
* Class TvSearchQuery
* @package Tmdb\Model\Search\SearchQuery
*/
-class TvSearchQuery extends SearchQuery {
+class TvSearchQuery extends SearchQuery
+{
/**
* ISO 639-1 code.
*
diff --git a/lib/Tmdb/Model/Tv.php b/lib/Tmdb/Model/Tv.php
index ac18ad9f..95ddc93d 100644
--- a/lib/Tmdb/Model/Tv.php
+++ b/lib/Tmdb/Model/Tv.php
@@ -25,8 +25,8 @@
* Class Tv
* @package Tmdb\Model
*/
-class Tv extends AbstractModel {
-
+class Tv extends AbstractModel
+{
/**
* @var Image
*/
@@ -187,7 +187,7 @@ class Tv extends AbstractModel {
*
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'backdrop_path',
'created_by',
'episode_run_time',
@@ -232,12 +232,13 @@ public function __construct()
}
/**
- * @param string $backdropPath
+ * @param string $backdropPath
* @return $this
*/
public function setBackdropPath($backdropPath)
{
$this->backdropPath = $backdropPath;
+
return $this;
}
@@ -250,12 +251,13 @@ public function getBackdropPath()
}
/**
- * @param \Tmdb\Model\Common\Collection $createdBy
+ * @param \Tmdb\Model\Common\Collection $createdBy
* @return $this
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
+
return $this;
}
@@ -268,12 +270,13 @@ public function getCreatedBy()
}
/**
- * @param array $episodeRunTime
+ * @param array $episodeRunTime
* @return $this
*/
public function setEpisodeRunTime($episodeRunTime)
{
$this->episodeRunTime = $episodeRunTime;
+
return $this;
}
@@ -286,7 +289,7 @@ public function getEpisodeRunTime()
}
/**
- * @param \DateTime $firstAirDate
+ * @param \DateTime $firstAirDate
* @return $this
*/
public function setFirstAirDate($firstAirDate)
@@ -296,6 +299,7 @@ public function setFirstAirDate($firstAirDate)
}
$this->firstAirDate = $firstAirDate;
+
return $this;
}
@@ -308,12 +312,13 @@ public function getFirstAirDate()
}
/**
- * @param \Tmdb\Model\Collection\Genres $genres
+ * @param \Tmdb\Model\Collection\Genres $genres
* @return $this
*/
public function setGenres($genres)
{
$this->genres = $genres;
+
return $this;
}
@@ -326,12 +331,13 @@ public function getGenres()
}
/**
- * @param string $homepage
+ * @param string $homepage
* @return $this
*/
public function setHomepage($homepage)
{
$this->homepage = $homepage;
+
return $this;
}
@@ -344,12 +350,13 @@ public function getHomepage()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -362,12 +369,13 @@ public function getId()
}
/**
- * @param boolean $inProduction
+ * @param boolean $inProduction
* @return $this
*/
public function setInProduction($inProduction)
{
$this->inProduction = $inProduction;
+
return $this;
}
@@ -380,12 +388,13 @@ public function getInProduction()
}
/**
- * @param array $languages
+ * @param array $languages
* @return $this
*/
public function setLanguages($languages)
{
$this->languages = $languages;
+
return $this;
}
@@ -398,7 +407,7 @@ public function getLanguages()
}
/**
- * @param string $lastAirDate
+ * @param string $lastAirDate
* @return $this
*/
public function setLastAirDate($lastAirDate)
@@ -408,6 +417,7 @@ public function setLastAirDate($lastAirDate)
}
$this->lastAirDate = $lastAirDate;
+
return $this;
}
@@ -420,12 +430,13 @@ public function getLastAirDate()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -438,12 +449,13 @@ public function getName()
}
/**
- * @param GenericCollection $networks
+ * @param GenericCollection $networks
* @return $this
*/
public function setNetworks($networks)
{
$this->networks = $networks;
+
return $this;
}
@@ -456,12 +468,13 @@ public function getNetworks()
}
/**
- * @param int $numberOfEpisodes
+ * @param int $numberOfEpisodes
* @return $this
*/
public function setNumberOfEpisodes($numberOfEpisodes)
{
$this->numberOfEpisodes = (int) $numberOfEpisodes;
+
return $this;
}
@@ -474,12 +487,13 @@ public function getNumberOfEpisodes()
}
/**
- * @param int $numberOfSeasons
+ * @param int $numberOfSeasons
* @return $this
*/
public function setNumberOfSeasons($numberOfSeasons)
{
$this->numberOfSeasons = (int) $numberOfSeasons;
+
return $this;
}
@@ -492,12 +506,13 @@ public function getNumberOfSeasons()
}
/**
- * @param \Tmdb\Model\Common\Collection $originCountry
+ * @param \Tmdb\Model\Common\Collection $originCountry
* @return $this
*/
public function setOriginCountry($originCountry)
{
$this->originCountry = $originCountry;
+
return $this;
}
@@ -510,12 +525,13 @@ public function getOriginCountry()
}
/**
- * @param string $originalName
+ * @param string $originalName
* @return $this
*/
public function setOriginalName($originalName)
{
$this->originalName = $originalName;
+
return $this;
}
@@ -528,12 +544,13 @@ public function getOriginalName()
}
/**
- * @param string $overview
+ * @param string $overview
* @return $this
*/
public function setOverview($overview)
{
$this->overview = $overview;
+
return $this;
}
@@ -546,12 +563,13 @@ public function getOverview()
}
/**
- * @param float $popularity
+ * @param float $popularity
* @return $this
*/
public function setPopularity($popularity)
{
$this->popularity = (float) $popularity;
+
return $this;
}
@@ -564,12 +582,13 @@ public function getPopularity()
}
/**
- * @param string $posterPath
+ * @param string $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -582,12 +601,13 @@ public function getPosterPath()
}
/**
- * @param GenericCollection $seasons
+ * @param GenericCollection $seasons
* @return $this
*/
public function setSeasons($seasons)
{
$this->seasons = $seasons;
+
return $this;
}
@@ -600,12 +620,13 @@ public function getSeasons()
}
/**
- * @param string $status
+ * @param string $status
* @return $this
*/
public function setStatus($status)
{
$this->status = $status;
+
return $this;
}
@@ -618,12 +639,13 @@ public function getStatus()
}
/**
- * @param float $voteAverage
+ * @param float $voteAverage
* @return $this
*/
public function setVoteAverage($voteAverage)
{
$this->voteAverage = (float) $voteAverage;
+
return $this;
}
@@ -636,12 +658,13 @@ public function getVoteAverage()
}
/**
- * @param int $voteCount
+ * @param int $voteCount
* @return $this
*/
public function setVoteCount($voteCount)
{
$this->voteCount = (int) $voteCount;
+
return $this;
}
@@ -654,12 +677,13 @@ public function getVoteCount()
}
/**
- * @param GenericCollection $translations
+ * @param GenericCollection $translations
* @return $this
*/
public function setTranslations($translations)
{
$this->translations = $translations;
+
return $this;
}
@@ -672,12 +696,13 @@ public function getTranslations()
}
/**
- * @param \Tmdb\Model\Collection\Images $images
+ * @param \Tmdb\Model\Collection\Images $images
* @return $this
*/
public function setImages($images)
{
$this->images = $images;
+
return $this;
}
@@ -690,12 +715,13 @@ public function getImages()
}
/**
- * @param \Tmdb\Model\Common\ExternalIds $externalIds
+ * @param \Tmdb\Model\Common\ExternalIds $externalIds
* @return $this
*/
public function setExternalIds($externalIds)
{
$this->externalIds = $externalIds;
+
return $this;
}
@@ -708,12 +734,13 @@ public function getExternalIds()
}
/**
- * @param \Tmdb\Model\Collection\CreditsCollection $credits
+ * @param \Tmdb\Model\Collection\CreditsCollection $credits
* @return $this
*/
public function setCredits($credits)
{
$this->credits = $credits;
+
return $this;
}
@@ -726,12 +753,13 @@ public function getCredits()
}
/**
- * @param \Tmdb\Model\Image\BackdropImage $backdrop
+ * @param \Tmdb\Model\Image\BackdropImage $backdrop
* @return $this
*/
public function setBackdropImage(BackdropImage $backdrop)
{
$this->backdrop = $backdrop;
+
return $this;
}
@@ -744,12 +772,13 @@ public function getBackdropImage()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $poster
+ * @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPosterImage(PosterImage $poster)
{
$this->poster = $poster;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Tv/Episode.php b/lib/Tmdb/Model/Tv/Episode.php
index 1a4b5e64..c809591e 100644
--- a/lib/Tmdb/Model/Tv/Episode.php
+++ b/lib/Tmdb/Model/Tv/Episode.php
@@ -22,8 +22,8 @@
* Class Episode
* @package Tmdb\Model\Tv
*/
-class Episode extends AbstractModel {
-
+class Episode extends AbstractModel
+{
/**
* @var \DateTime
*/
@@ -100,7 +100,6 @@ class Episode extends AbstractModel {
*/
protected $still;
-
/**
* Properties that are available in the API
*
@@ -108,7 +107,7 @@ class Episode extends AbstractModel {
*
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'air_date',
'episode_number',
'name',
@@ -132,7 +131,7 @@ public function __construct()
}
/**
- * @param \DateTime $airDate
+ * @param \DateTime $airDate
* @return $this
*/
public function setAirDate($airDate)
@@ -142,6 +141,7 @@ public function setAirDate($airDate)
}
$this->airDate = $airDate;
+
return $this;
}
@@ -154,12 +154,13 @@ public function getAirDate()
}
/**
- * @param int $episodeNumber
+ * @param int $episodeNumber
* @return $this
*/
public function setEpisodeNumber($episodeNumber)
{
$this->episodeNumber = (int) $episodeNumber;
+
return $this;
}
@@ -172,12 +173,13 @@ public function getEpisodeNumber()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -190,12 +192,13 @@ public function getId()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -208,12 +211,13 @@ public function getName()
}
/**
- * @param string $overview
+ * @param string $overview
* @return $this
*/
public function setOverview($overview)
{
$this->overview = $overview;
+
return $this;
}
@@ -226,12 +230,13 @@ public function getOverview()
}
/**
- * @param string $productionCode
+ * @param string $productionCode
* @return $this
*/
public function setProductionCode($productionCode)
{
$this->productionCode = $productionCode;
+
return $this;
}
@@ -244,12 +249,13 @@ public function getProductionCode()
}
/**
- * @param int $seasonNumber
+ * @param int $seasonNumber
* @return $this
*/
public function setSeasonNumber($seasonNumber)
{
$this->seasonNumber = (int) $seasonNumber;
+
return $this;
}
@@ -262,12 +268,13 @@ public function getSeasonNumber()
}
/**
- * @param string $stillPath
+ * @param string $stillPath
* @return $this
*/
public function setStillPath($stillPath)
{
$this->stillPath = $stillPath;
+
return $this;
}
@@ -280,12 +287,13 @@ public function getStillPath()
}
/**
- * @param float $voteAverage
+ * @param float $voteAverage
* @return $this
*/
public function setVoteAverage($voteAverage)
{
$this->voteAverage = (float) $voteAverage;
+
return $this;
}
@@ -298,12 +306,13 @@ public function getVoteAverage()
}
/**
- * @param int $voteCount
+ * @param int $voteCount
* @return $this
*/
public function setVoteCount($voteCount)
{
$this->voteCount = (int) $voteCount;
+
return $this;
}
@@ -316,12 +325,13 @@ public function getVoteCount()
}
/**
- * @param Credits $credits
+ * @param Credits $credits
* @return $this
*/
public function setCredits($credits)
{
$this->credits = $credits;
+
return $this;
}
@@ -334,12 +344,13 @@ public function getCredits()
}
/**
- * @param ExternalIds $externalIds
+ * @param ExternalIds $externalIds
* @return $this
*/
public function setExternalIds($externalIds)
{
$this->externalIds = $externalIds;
+
return $this;
}
@@ -352,12 +363,13 @@ public function getExternalIds()
}
/**
- * @param Images $images
+ * @param Images $images
* @return $this
*/
public function setImages($images)
{
$this->images = $images;
+
return $this;
}
@@ -370,12 +382,13 @@ public function getImages()
}
/**
- * @param StillImage $still
+ * @param StillImage $still
* @return $this
*/
public function setStillImage($still)
{
$this->still = $still;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Tv/Episode/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Tv/Episode/QueryParameter/AppendToResponse.php
index 80815631..9db230a3 100644
--- a/lib/Tmdb/Model/Tv/Episode/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Tv/Episode/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Tv\Episode\QueryParameter
*/
-class AppendToResponse extends BaseAppendToResponse {
+class AppendToResponse extends BaseAppendToResponse
+{
const CREDITS = 'credits';
const EXTERNAL_IDS = 'external_ids';
const IMAGES = 'images';
diff --git a/lib/Tmdb/Model/Tv/Network.php b/lib/Tmdb/Model/Tv/Network.php
index c4c4be65..366f9003 100644
--- a/lib/Tmdb/Model/Tv/Network.php
+++ b/lib/Tmdb/Model/Tv/Network.php
@@ -18,8 +18,8 @@
* Class Network
* @package Tmdb\Model\Tv
*/
-class Network extends AbstractModel {
-
+class Network extends AbstractModel
+{
/**
* @var integer
*/
@@ -37,18 +37,19 @@ class Network extends AbstractModel {
*
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'id',
'name',
);
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -61,12 +62,13 @@ public function getId()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Tv/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Tv/QueryParameter/AppendToResponse.php
index f74fd6b5..e191aca9 100644
--- a/lib/Tmdb/Model/Tv/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Tv/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Tv\QueryParameter
*/
-class AppendToResponse extends BaseAppendToResponse {
+class AppendToResponse extends BaseAppendToResponse
+{
const CREDITS = 'credits';
const EXTERNAL_IDS = 'external_ids';
const IMAGES = 'images';
diff --git a/lib/Tmdb/Model/Tv/Season.php b/lib/Tmdb/Model/Tv/Season.php
index 74a60edd..3bb9e9c2 100644
--- a/lib/Tmdb/Model/Tv/Season.php
+++ b/lib/Tmdb/Model/Tv/Season.php
@@ -23,8 +23,8 @@
* Class Season
* @package Tmdb\Model\Tv
*/
-class Season extends AbstractModel {
-
+class Season extends AbstractModel
+{
/**
* @var \DateTime
*/
@@ -93,7 +93,7 @@ class Season extends AbstractModel {
*
* @var array
*/
- public static $_properties = array(
+ public static $properties = array(
'air_date',
'name',
'overview',
@@ -114,12 +114,13 @@ public function __construct()
}
/**
- * @param \DateTime $airDate
+ * @param \DateTime $airDate
* @return $this
*/
public function setAirDate($airDate)
{
$this->airDate = new \DateTime($airDate);
+
return $this;
}
@@ -132,12 +133,13 @@ public function getAirDate()
}
/**
- * @param GenericCollection $episodes
+ * @param GenericCollection $episodes
* @return $this
*/
public function setEpisodes($episodes)
{
$this->episodes = $episodes;
+
return $this;
}
@@ -150,12 +152,13 @@ public function getEpisodes()
}
/**
- * @param int $id
+ * @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = (int) $id;
+
return $this;
}
@@ -168,12 +171,13 @@ public function getId()
}
/**
- * @param string $name
+ * @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -186,12 +190,13 @@ public function getName()
}
/**
- * @param string $overview
+ * @param string $overview
* @return $this
*/
public function setOverview($overview)
{
$this->overview = $overview;
+
return $this;
}
@@ -204,12 +209,13 @@ public function getOverview()
}
/**
- * @param \Tmdb\Model\Tv\Image $posterPath
+ * @param \Tmdb\Model\Tv\Image $posterPath
* @return $this
*/
public function setPosterPath($posterPath)
{
$this->posterPath = $posterPath;
+
return $this;
}
@@ -222,12 +228,13 @@ public function getPosterPath()
}
/**
- * @param int $seasonNumber
+ * @param int $seasonNumber
* @return $this
*/
public function setSeasonNumber($seasonNumber)
{
$this->seasonNumber = $seasonNumber;
+
return $this;
}
@@ -240,12 +247,13 @@ public function getSeasonNumber()
}
/**
- * @param Credits $credits
+ * @param Credits $credits
* @return $this
*/
public function setCredits($credits)
{
$this->credits = $credits;
+
return $this;
}
@@ -258,12 +266,13 @@ public function getCredits()
}
/**
- * @param \Tmdb\Model\Common\ExternalIds $externalIds
+ * @param \Tmdb\Model\Common\ExternalIds $externalIds
* @return $this
*/
public function setExternalIds($externalIds)
{
$this->externalIds = $externalIds;
+
return $this;
}
@@ -276,12 +285,13 @@ public function getExternalIds()
}
/**
- * @param \Tmdb\Model\Collection\Images $images
+ * @param \Tmdb\Model\Collection\Images $images
* @return $this
*/
public function setImages($images)
{
$this->images = $images;
+
return $this;
}
@@ -294,12 +304,13 @@ public function getImages()
}
/**
- * @param \Tmdb\Model\Image\PosterImage $poster
+ * @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPosterImage($poster)
{
$this->poster = $poster;
+
return $this;
}
diff --git a/lib/Tmdb/Model/Tv/Season/QueryParameter/AppendToResponse.php b/lib/Tmdb/Model/Tv/Season/QueryParameter/AppendToResponse.php
index 5a98bb92..2754ab16 100644
--- a/lib/Tmdb/Model/Tv/Season/QueryParameter/AppendToResponse.php
+++ b/lib/Tmdb/Model/Tv/Season/QueryParameter/AppendToResponse.php
@@ -18,7 +18,8 @@
* Class AppendToResponse
* @package Tmdb\Model\Tv\Season\QueryParameter
*/
-class AppendToResponse extends BaseAppendToResponse {
+class AppendToResponse extends BaseAppendToResponse
+{
const CREDITS = 'credits';
const EXTERNAL_IDS = 'external_ids';
const IMAGES = 'images';
diff --git a/lib/Tmdb/Repository/AbstractRepository.php b/lib/Tmdb/Repository/AbstractRepository.php
index 3909cac0..dbe7db1f 100644
--- a/lib/Tmdb/Repository/AbstractRepository.php
+++ b/lib/Tmdb/Repository/AbstractRepository.php
@@ -21,8 +21,8 @@
* Class AbstractRepository
* @package Tmdb\Repository
*/
-abstract class AbstractRepository {
-
+abstract class AbstractRepository
+{
protected $client = null;
protected $api = null;
@@ -52,12 +52,12 @@ public function getClient()
/**
* Process query parameters
*
- * @param array $parameters
+ * @param array $parameters
* @return array
*/
protected function parseQueryParameters(array $parameters = array())
{
- foreach($parameters as $key => $candidate) {
+ foreach ($parameters as $key => $candidate) {
if (is_a($candidate, 'Tmdb\Model\Common\QueryParameter\QueryParameterInterface')) {
$interfaces = class_implements($candidate);
diff --git a/lib/Tmdb/Repository/AccountRepository.php b/lib/Tmdb/Repository/AccountRepository.php
index faa7f077..19e26247 100644
--- a/lib/Tmdb/Repository/AccountRepository.php
+++ b/lib/Tmdb/Repository/AccountRepository.php
@@ -21,54 +21,57 @@
* @package Tmdb\Repository
* http://docs.themoviedb.apiary.io/#account
*/
-class AccountRepository extends AbstractRepository {
-
+class AccountRepository extends AbstractRepository
+{
/**
- * Get the basic information for an account. You will need to have a valid session id.
+ * Get the basic information for an account.
+ * You will need to have a valid session id.
*
* @return null|\Tmdb\Model\AbstractModel
*/
public function getAccount()
{
$data = $this->getApi()->getAccount();
+
return $this->getFactory()->create($data);
}
/**
* Get the lists that you have created and marked as a favorite.
*
- * @param string $accountId
- * @param array $parameters
- * @param array $headers
+ * @param string $accountId
+ * @param array $parameters
+ * @param array $headers
* @return ResultCollection
*/
public function getLists($accountId, array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getLists($accountId, $parameters, $headers);
+
return $this->getFactory()->createResultCollection($data, 'createListItem');
}
/**
* Get the list of favorite movies for an account.
*
- * @param string $accountId
- * @param array $parameters
- * @param array $headers
+ * @param string $accountId
+ * @param array $parameters
+ * @param array $headers
* @return ResultCollection
*/
public function getFavoriteMovies($accountId, array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getFavoriteMovies($accountId, $parameters, $headers);
+
return $this->getFactory()->createResultCollection($data, 'createMovie');
}
-
/**
* Add or remove a movie to an accounts favorite list.
*
- * @param string $accountId
- * @param int|Movie $movie
- * @param boolean $isFavorite
+ * @param string $accountId
+ * @param int|Movie $movie
+ * @param boolean $isFavorite
* @return ResultCollection
*/
public function favorite($accountId, $movie, $isFavorite = true)
@@ -78,43 +81,46 @@ public function favorite($accountId, $movie, $isFavorite = true)
}
$data = $this->getApi()->favorite($accountId, $movie, $isFavorite);
+
return $this->getFactory()->createStatusResult($data);
}
/**
* Get the list of rated movies (and associated rating) for an account.
*
- * @param string $accountId
- * @param array $parameters
- * @param array $headers
+ * @param string $accountId
+ * @param array $parameters
+ * @param array $headers
* @return ResultCollection
*/
public function getRatedMovies($accountId, array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getRatedMovies($accountId, $parameters, $headers);
+
return $this->getFactory()->createResultCollection($data, 'createMovie');
}
/**
* Get the list of movies on an accounts watchlist.
*
- * @param string $accountId
- * @param array $parameters
- * @param array $headers
+ * @param string $accountId
+ * @param array $parameters
+ * @param array $headers
* @return ResultCollection
*/
public function getMovieWatchlist($accountId, array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getMovieWatchlist($accountId, $parameters, $headers);
+
return $this->getFactory()->createResultCollection($data, 'createMovie');
}
/**
* Add or remove a movie to an accounts watch list.
*
- * @param string $accountId
- * @param int|Movie $movie
- * @param boolean $isOnWatchlist
+ * @param string $accountId
+ * @param int|Movie $movie
+ * @param boolean $isOnWatchlist
* @return ResultCollection
*/
public function watchlist($accountId, $movie, $isOnWatchlist = true)
@@ -124,6 +130,7 @@ public function watchlist($accountId, $movie, $isOnWatchlist = true)
}
$data = $this->getApi()->watchlist($accountId, $movie, $isOnWatchlist);
+
return $this->getFactory()->createStatusResult($data);
}
diff --git a/lib/Tmdb/Repository/AuthenticationRepository.php b/lib/Tmdb/Repository/AuthenticationRepository.php
index 141ba954..809a16b9 100644
--- a/lib/Tmdb/Repository/AuthenticationRepository.php
+++ b/lib/Tmdb/Repository/AuthenticationRepository.php
@@ -20,8 +20,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#authentication
*/
-class AuthenticationRepository extends AbstractRepository {
-
+class AuthenticationRepository extends AbstractRepository
+{
/**
* This method is used to generate a valid request token for user based authentication.
* A request token is required in order to request a session id.
@@ -34,6 +34,7 @@ class AuthenticationRepository extends AbstractRepository {
public function getRequestToken()
{
$data = $this->getApi()->getNewToken();
+
return $this->getFactory()->createRequestToken($data);
}
@@ -41,12 +42,13 @@ public function getRequestToken()
* This method is used to generate a session id for user based authentication.
* A session id is required in order to use any of the write methods.
*
- * @param RequestToken $requestToken
+ * @param RequestToken $requestToken
* @return RequestToken
*/
public function getSessionToken(RequestToken $requestToken)
{
$data = $this->getApi()->getNewSession($requestToken->getToken());
+
return $this->getFactory()->createSessionToken($data);
}
@@ -54,24 +56,28 @@ public function getSessionToken(RequestToken $requestToken)
* This method is used to generate a guest session id.
*
* A guest session can be used to rate movies without having a registered TMDb user account.
- * You should only generate a single guest session per user (or device) as you will be able to
- * attach the ratings to a TMDb user account in the future.
+ * You should only generate a single guest session per user (or device)
+ * as you will be able to attach the ratings to a TMDb user account in the future.
*
- * There is also IP limits in place so you should always make sure it's the end user doing the guest session actions.
- * If a guest session is not used for the first time within 24 hours, it will be automatically discarded.
+ * There is also IP limits in place so you should always make sure it's
+ * the end user doing the guest session actions.
+ *
+ * If a guest session is not used for the first time within 24 hours,
+ * it will be automatically discarded.
*
* @return RequestToken
*/
public function getGuestSessionToken()
{
$data = $this->getApi()->getNewGuestSession();
+
return $this->getFactory()->createGuestSessionToken($data);
}
/**
* Authenticate request token, redirects the user
*
- * @param RequestToken $requestToken
+ * @param RequestToken $requestToken
* @return void
*/
public function authenticateRequestToken(RequestToken $requestToken)
diff --git a/lib/Tmdb/Repository/CertificationRepository.php b/lib/Tmdb/Repository/CertificationRepository.php
index b7cdb357..8738535f 100644
--- a/lib/Tmdb/Repository/CertificationRepository.php
+++ b/lib/Tmdb/Repository/CertificationRepository.php
@@ -13,19 +13,19 @@
namespace Tmdb\Repository;
use Tmdb\Factory\CertificationFactory;
-use Tmdb\Model\Collection as ApiCollection;
/**
* Class CertificationRepository
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#certifications
*/
-class CertificationRepository extends AbstractRepository {
-
+class CertificationRepository extends AbstractRepository
+{
/**
* Get the list of supported certifications for movies.
*
- * These can be used in conjunction with the certification_country and certification.lte parameters when using discover.
+ * These can be used in conjunction with the certification_country
+ * and certification.lte parameters when using discover.
*
* @param $parameters
* @param $headers
@@ -34,6 +34,7 @@ class CertificationRepository extends AbstractRepository {
public function getMovieList(array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getMovieList($this->parseQueryParameters($parameters), $headers);
+
return $this->getFactory()->createCollection($data);
}
diff --git a/lib/Tmdb/Repository/ChangesRepository.php b/lib/Tmdb/Repository/ChangesRepository.php
index a2e34f03..d873ff4f 100644
--- a/lib/Tmdb/Repository/ChangesRepository.php
+++ b/lib/Tmdb/Repository/ChangesRepository.php
@@ -21,7 +21,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#changes
*/
-class ChangesRepository extends AbstractRepository {
+class ChangesRepository extends AbstractRepository
+{
/**
* Get a list of movie ids that have been edited.
*
@@ -32,11 +33,12 @@ class ChangesRepository extends AbstractRepository {
* Please note that the change log system to support this was changed on October 5, 2012
* and will only show movies that have been edited since.
*
- * @param ChangesQuery $query
- * @param array $headers
+ * @param ChangesQuery $query
+ * @param array $headers
* @return \Tmdb\Model\Common\GenericCollection
*/
- public function getMovieChanges(ChangesQuery $query, array $headers = array()) {
+ public function getMovieChanges(ChangesQuery $query, array $headers = array())
+ {
$data = $this->getApi()->getMovieChanges($query->toArray(), $headers);
return $this->getFactory()->createResultCollection($data);
@@ -52,11 +54,12 @@ public function getMovieChanges(ChangesQuery $query, array $headers = array()) {
* Please note that the change log system to support this was changed on October 5, 2012
* and will only show people that have been edited since.
*
- * @param ChangesQuery $query
- * @param array $headers
+ * @param ChangesQuery $query
+ * @param array $headers
* @return People
*/
- public function getPeopleChanges(ChangesQuery $query, array $headers = array()) {
+ public function getPeopleChanges(ChangesQuery $query, array $headers = array())
+ {
$data = $this->getApi()->getPersonChanges($query->toArray(), $headers);
return $this->getFactory()->createResultCollection($data);
@@ -77,7 +80,8 @@ public function getApi()
*
* @return ChangesFactory
*/
- public function getFactory(){
+ public function getFactory()
+ {
return new ChangesFactory();
}
}
diff --git a/lib/Tmdb/Repository/CollectionRepository.php b/lib/Tmdb/Repository/CollectionRepository.php
index 68e75cf9..c38df046 100644
--- a/lib/Tmdb/Repository/CollectionRepository.php
+++ b/lib/Tmdb/Repository/CollectionRepository.php
@@ -23,8 +23,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#collections
*/
-class CollectionRepository extends AbstractRepository {
-
+class CollectionRepository extends AbstractRepository
+{
private $imageFactory;
public function __construct(Client $client)
@@ -37,7 +37,8 @@ public function __construct(Client $client)
/**
* Load a collection with the given identifier
*
- * If you want to optimize the result set/bandwidth you should define the AppendToResponse parameter
+ * If you want to optimize the result set/bandwidth you
+ * should define the AppendToResponse parameter
*
* @param $id
* @param $parameters
@@ -55,6 +56,7 @@ public function load($id, array $parameters = array(), array $headers = array())
}
$data = $this->getApi()->getCollection($id, $this->parseQueryParameters($parameters), $headers);
+
return $this->getFactory()->create($data);
}
@@ -93,12 +95,13 @@ public function getFactory()
}
/**
- * @param mixed $imageFactory
+ * @param mixed $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
diff --git a/lib/Tmdb/Repository/CompanyRepository.php b/lib/Tmdb/Repository/CompanyRepository.php
index 76d09e2d..a7538250 100644
--- a/lib/Tmdb/Repository/CompanyRepository.php
+++ b/lib/Tmdb/Repository/CompanyRepository.php
@@ -24,17 +24,18 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#movies
*/
-class CompanyRepository extends AbstractRepository {
-
+class CompanyRepository extends AbstractRepository
+{
/**
* Load a company with the given identifier
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Company
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
$data = $this->getApi()->getCompany($id, $this->parseQueryParameters($parameters), $headers);
return $this->getFactory()->create($data);
@@ -43,9 +44,9 @@ public function load($id, array $parameters = array(), array $headers = array())
/**
* Get the list of movies associated with a particular company.
*
- * @param integer $id
- * @param array $parameters
- * @param array $headers
+ * @param integer $id
+ * @param array $parameters
+ * @param array $headers
* @return GenericCollection|Movie[]
*/
public function getMovies($id, array $parameters = array(), array $headers = array())
@@ -87,14 +88,15 @@ public function getMovieFactory()
* @param $data
* @return Movie[]
*/
- public function createMovieCollection($data){
+ public function createMovieCollection($data)
+ {
$collection = new ResultCollection();
if (array_key_exists('results', $data)) {
$data = $data['results'];
}
- foreach($data as $item) {
+ foreach ($data as $item) {
$collection->add(null, $this->getMovieFactory()->create($item));
}
diff --git a/lib/Tmdb/Repository/ConfigurationRepository.php b/lib/Tmdb/Repository/ConfigurationRepository.php
index dd630e20..fbce8a93 100644
--- a/lib/Tmdb/Repository/ConfigurationRepository.php
+++ b/lib/Tmdb/Repository/ConfigurationRepository.php
@@ -20,15 +20,16 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#configuration
*/
-class ConfigurationRepository extends AbstractRepository {
-
+class ConfigurationRepository extends AbstractRepository
+{
/**
* Load up TMDB Configuration
*
- * @param array $headers
+ * @param array $headers
* @return Configuration
*/
- public function load(array $headers = array()) {
+ public function load(array $headers = array())
+ {
$data = $this->getApi()->getConfiguration($headers);
return $this->getFactory()->create($data);
diff --git a/lib/Tmdb/Repository/CreditsRepository.php b/lib/Tmdb/Repository/CreditsRepository.php
index 40e51385..63c79688 100644
--- a/lib/Tmdb/Repository/CreditsRepository.php
+++ b/lib/Tmdb/Repository/CreditsRepository.php
@@ -15,24 +15,24 @@
use Tmdb\Factory\CompanyFactory;
use Tmdb\Factory\CreditsFactory;
use Tmdb\Model\Company;
-use Tmdb\Model\Movie;
/**
* Class CreditsRepository
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#credits
*/
-class CreditsRepository extends AbstractRepository {
-
+class CreditsRepository extends AbstractRepository
+{
/**
* Load a company with the given identifier
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Company
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
$data = $this->getApi()->getCredit($id, $this->parseQueryParameters($parameters), $headers);
return $this->getFactory()->create($data);
diff --git a/lib/Tmdb/Repository/DiscoverRepository.php b/lib/Tmdb/Repository/DiscoverRepository.php
index 46e468eb..6d7ec6c6 100644
--- a/lib/Tmdb/Repository/DiscoverRepository.php
+++ b/lib/Tmdb/Repository/DiscoverRepository.php
@@ -26,20 +26,25 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#discover
*/
-class DiscoverRepository extends AbstractRepository {
+class DiscoverRepository extends AbstractRepository
+{
/**
- * Discover movies by different types of data like average rating, number of votes, genres and certifications.
+ * Discover movies by different types of data like average rating,
+ * number of votes, genres and certifications.
*
- * @param DiscoverMoviesQuery $query
- * @param array $headers
- * @throws RuntimeException when certification_country is set but certification.lte is not given
+ * @param DiscoverMoviesQuery $query
+ * @param array $headers
+ * @throws RuntimeException when certification_country is set but certification.lte is not given
* @return Movie[]
*/
- public function discoverMovies(DiscoverMoviesQuery $query, array $headers = array()) {
+ public function discoverMovies(DiscoverMoviesQuery $query, array $headers = array())
+ {
$query = $query->toArray();
if (array_key_exists('certification_country', $query) && !array_key_exists('certification.lte', $query)) {
- throw new RuntimeException('When the certification_country option is given the certification.lte option is required.');
+ throw new RuntimeException(
+ 'When the certification_country option is given the certification.lte option is required.'
+ );
}
$data = $this->getApi()->discoverMovies($query, $headers);
@@ -48,14 +53,16 @@ public function discoverMovies(DiscoverMoviesQuery $query, array $headers = arra
}
/**
- * Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.
+ * Discover TV shows by different types of data like average rating,
+ * number of votes, genres, the network they aired on and air dates.
*
- * @param DiscoverTvQuery $query
- * @param array $headers
+ * @param DiscoverTvQuery $query
+ * @param array $headers
* @return Tv[]
* @return \Tmdb\Model\Common\GenericCollection
*/
- public function discoverTv(DiscoverTvQuery $query, array $headers = array()) {
+ public function discoverTv(DiscoverTvQuery $query, array $headers = array())
+ {
$data = $this->getApi()->discoverTv($query->toArray(), $headers);
return $this->getTvFactory()->createResultCollection($data);
@@ -77,7 +84,8 @@ public function getApi()
* @throws NotImplementedException
* @return null|\Tmdb\Factory\FactoryInterface
*/
- public function getFactory(){
+ public function getFactory()
+ {
throw new NotImplementedException('Discover does not support a generic factory.');
}
diff --git a/lib/Tmdb/Repository/FindRepository.php b/lib/Tmdb/Repository/FindRepository.php
index c8282491..e8f538ea 100644
--- a/lib/Tmdb/Repository/FindRepository.php
+++ b/lib/Tmdb/Repository/FindRepository.php
@@ -20,18 +20,20 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#find
*/
-class FindRepository extends AbstractRepository {
+class FindRepository extends AbstractRepository
+{
/**
* Find something
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Find
*/
- public function find($id, array $parameters = array(), array $headers = array()) {
+ public function find($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->create(
- $this->getApi()->find($id,$parameters, $headers)
+ $this->getApi()->find($id, $parameters, $headers)
);
}
@@ -52,4 +54,4 @@ public function getFactory()
{
return new FindFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/GenreRepository.php b/lib/Tmdb/Repository/GenreRepository.php
index b82b1fab..96e171a2 100644
--- a/lib/Tmdb/Repository/GenreRepository.php
+++ b/lib/Tmdb/Repository/GenreRepository.php
@@ -21,24 +21,26 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#genres
*/
-class GenreRepository extends AbstractRepository {
+class GenreRepository extends AbstractRepository
+{
/**
* Load a genre with the given identifier
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Genre
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
return $this->loadCollection($parameters, $headers)->filterId($id);
}
/**
* Get the list of genres.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return GenericCollection
*/
public function loadCollection(array $parameters = array(), array $headers = array())
@@ -49,14 +51,16 @@ public function loadCollection(array $parameters = array(), array $headers = arr
}
/**
- * Get the list of movies for a particular genre by id. By default, only movies with 10 or more votes are included.
+ * Get the list of movies for a particular genre by id.
+ * By default, only movies with 10 or more votes are included.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Genre[]
*/
- public function getMovies($id, array $parameters = array(), array $headers = array()) {
+ public function getMovies($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->createResultCollection(
$this->getApi()->getMovies($id, $parameters, $headers),
'createMovie'
@@ -69,7 +73,8 @@ public function getMovies($id, array $parameters = array(), array $headers = arr
* @param $data
* @return GenericCollection|Genre[]
*/
- private function createCollection($data){
+ private function createCollection($data)
+ {
return $this->getFactory()->createCollection($data);
}
@@ -90,4 +95,4 @@ public function getFactory()
{
return new GenreFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/JobsRepository.php b/lib/Tmdb/Repository/JobsRepository.php
index 5444de90..ec703708 100644
--- a/lib/Tmdb/Repository/JobsRepository.php
+++ b/lib/Tmdb/Repository/JobsRepository.php
@@ -21,21 +21,23 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#jobs
*/
-class JobsRepository extends AbstractRepository {
+class JobsRepository extends AbstractRepository
+{
/**
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Job
*/
- public function load(array $parameters = array(), array $headers = array()) {
+ public function load(array $parameters = array(), array $headers = array())
+ {
return $this->loadCollection($parameters, $headers);
}
/**
* Get the list of jobs.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Jobs|Job[]
*/
public function loadCollection(array $parameters = array(), array $headers = array())
@@ -51,7 +53,8 @@ public function loadCollection(array $parameters = array(), array $headers = arr
* @param $data
* @return Jobs|Job[]
*/
- private function createCollection($data){
+ private function createCollection($data)
+ {
return $this->getFactory()->createCollection($data);
}
@@ -72,4 +75,4 @@ public function getFactory()
{
return new JobsFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/KeywordRepository.php b/lib/Tmdb/Repository/KeywordRepository.php
index b85ba66e..4c854777 100644
--- a/lib/Tmdb/Repository/KeywordRepository.php
+++ b/lib/Tmdb/Repository/KeywordRepository.php
@@ -21,30 +21,34 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#keywords
*/
-class KeywordRepository extends AbstractRepository {
+class KeywordRepository extends AbstractRepository
+{
/**
* Get the basic information for a specific keyword id.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Keyword
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->create(
$this->getApi()->getKeyword($id, $parameters, $headers)
);
}
/**
- * Get the list of movies for a particular keyword by id. By default, only movies with 10 or more votes are included.
+ * Get the list of movies for a particular keyword by id.
+ * By default, only movies with 10 or more votes are included.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return ResultCollection|Keyword[]
*/
- public function getMovies($id, array $parameters = array(), array $headers = array()) {
+ public function getMovies($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->createResultCollection(
$this->getApi()->getMovies($id, $parameters, $headers),
'createMovie'
@@ -68,4 +72,4 @@ public function getFactory()
{
return new KeywordFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/ListRepository.php b/lib/Tmdb/Repository/ListRepository.php
index 92f90954..1342c5cb 100644
--- a/lib/Tmdb/Repository/ListRepository.php
+++ b/lib/Tmdb/Repository/ListRepository.php
@@ -21,16 +21,18 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#lists
*/
-class ListRepository extends AbstractRepository {
+class ListRepository extends AbstractRepository
+{
/**
* Get a list by id.
*
- * @param string $id
- * @param array $parameters
- * @param array $headers
+ * @param string $id
+ * @param array $parameters
+ * @param array $headers
* @return Lists
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->create(
$this->getApi()->getList($id, $parameters, $headers)
);
@@ -39,10 +41,10 @@ public function load($id, array $parameters = array(), array $headers = array())
/**
* Check to see if a movie ID is already added to a list.
*
- * @param string $id
- * @param int $mediaId
- * @param array $parameters
- * @param array $headers
+ * @param string $id
+ * @param int $mediaId
+ * @param array $parameters
+ * @param array $headers
* @return ItemStatus
*/
public function getItemStatus($id, $mediaId, array $parameters = array(), array $headers = array())
@@ -55,10 +57,10 @@ public function getItemStatus($id, $mediaId, array $parameters = array(), array
/**
* This method lets users create a new list. A valid session id is required.
*
- * @param string $name
- * @param string $description
- * @param array $parameters
- * @param array $headers
+ * @param string $name
+ * @param string $description
+ * @param array $parameters
+ * @param array $headers
* @return string The list id
*/
public function createList($name, $description = null, array $parameters = array(), array $headers = array())
@@ -69,10 +71,11 @@ public function createList($name, $description = null, array $parameters = array
}
/**
- * This method lets users add new movies to a list that they created. A valid session id is required.
+ * This method lets users add new movies to a list that they created.
+ * A valid session id is required.
*
- * @param string $id
- * @param int $mediaId
+ * @param string $id
+ * @param int $mediaId
* @return ItemStatus
*/
public function add($id, $mediaId)
@@ -83,10 +86,11 @@ public function add($id, $mediaId)
}
/**
- * This method lets users delete movies from a list that they created. A valid session id is required.
+ * This method lets users delete movies from a list that they created.
+ * A valid session id is required.
*
- * @param string $id
- * @param int $mediaId
+ * @param string $id
+ * @param int $mediaId
* @return ItemStatus
*/
public function remove($id, $mediaId)
@@ -97,9 +101,10 @@ public function remove($id, $mediaId)
}
/**
- * This method lets users delete a list that they created. A valid session id is required.
+ * This method lets users delete a list that they created.
+ * A valid session id is required.
*
- * @param string $id
+ * @param string $id
* @return ItemStatus
*/
public function deleteList($id)
@@ -126,4 +131,4 @@ public function getFactory()
{
return new ListFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/MovieRepository.php b/lib/Tmdb/Repository/MovieRepository.php
index 37288a2c..d56571ce 100644
--- a/lib/Tmdb/Repository/MovieRepository.php
+++ b/lib/Tmdb/Repository/MovieRepository.php
@@ -25,8 +25,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#movies
*/
-class MovieRepository extends AbstractRepository {
-
+class MovieRepository extends AbstractRepository
+{
/**
* @var ImageFactory
*/
@@ -45,7 +45,8 @@ class MovieRepository extends AbstractRepository {
/**
* Load a movie with the given identifier
*
- * If you want to optimize the result set/bandwidth you should define the AppendToResponse parameter
+ * If you want to optimize the result set/bandwidth you
+ * should define the AppendToResponse parameter
*
* @param $id
* @param $parameters
@@ -260,11 +261,10 @@ public function getChanges($id, array $parameters = array(), array $headers = ar
return $movie->getChanges();
}
-
/**
* Get the latest movie.
*
- * @param array $options
+ * @param array $options
* @return null|\Tmdb\Model\AbstractModel
*/
public function getLatest(array $options = array())
@@ -275,9 +275,10 @@ public function getLatest(array $options = array())
}
/**
- * Get the list of upcoming movies. This list refreshes every day. The maximum number of items this list will include is 100.
+ * Get the list of upcoming movies. This list refreshes every day.
+ * The maximum number of items this list will include is 100.
*
- * @param array $options
+ * @param array $options
* @return Movie[]
*/
public function getUpcoming(array $options = array())
@@ -288,9 +289,10 @@ public function getUpcoming(array $options = array())
}
/**
- * Get the list of movies playing in theatres. This list refreshes every day. The maximum number of items this list will include is 100.
+ * Get the list of movies playing in theatres. This list refreshes every day.
+ * The maximum number of items this list will include is 100.
*
- * @param array $options
+ * @param array $options
* @return Movie[]
*/
public function getNowPlaying(array $options = array())
@@ -301,9 +303,10 @@ public function getNowPlaying(array $options = array())
}
/**
- * Get the list of popular movies on The Movie Database. This list refreshes every day.
+ * Get the list of popular movies on The Movie Database.
+ * This list refreshes every day.
*
- * @param array $options
+ * @param array $options
* @return Movie[]
*/
public function getPopular(array $options = array())
@@ -314,9 +317,12 @@ public function getPopular(array $options = array())
}
/**
- * Get the list of top rated movies. By default, this list will only include movies that have 10 or more votes. This list refreshes every day.
+ * Get the list of top rated movies.
+ *
+ * By default, this list will only include movies that have 10 or more votes.
+ * This list refreshes every day.
*
- * @param array $options
+ * @param array $options
* @return Movie[]
*/
public function getTopRated(array $options = array())
@@ -327,9 +333,10 @@ public function getTopRated(array $options = array())
}
/**
- * This method lets users get the status of whether or not the movie has been rated or added to their favourite or watch lists. A valid session id is required.
+ * This method lets users get the status of whether or not the movie has been rated
+ * or added to their favourite or watch lists. A valid session id is required.
*
- * @param integer $id
+ * @param integer $id
* @return Movie[]
*/
public function getAccountStates($id)
@@ -342,8 +349,8 @@ public function getAccountStates($id)
/**
* This method lets users rate a movie. A valid session id or guest session id is required.
*
- * @param integer $id
- * @param float $rating
+ * @param integer $id
+ * @param float $rating
* @return Movie[]
*/
public function rate($id, $rating)
@@ -379,17 +386,19 @@ public function getFactory()
* @param $data
* @return Movie[]
*/
- private function createCollection($data){
+ private function createCollection($data)
+ {
return $this->getFactory()->createCollection($data);
}
/**
- * @param mixed $alternativeTitleFactory
+ * @param mixed $alternativeTitleFactory
* @return $this
*/
public function setAlternativeTitleFactory($alternativeTitleFactory)
{
$this->alternativeTitleFactory = $alternativeTitleFactory;
+
return $this;
}
@@ -402,12 +411,13 @@ public function getAlternativeTitleFactory()
}
/**
- * @param mixed $imageFactory
+ * @param mixed $imageFactory
* @return $this
*/
public function setImageFactory($imageFactory)
{
$this->imageFactory = $imageFactory;
+
return $this;
}
@@ -420,12 +430,13 @@ public function getImageFactory()
}
/**
- * @param mixed $peopleFactory
+ * @param mixed $peopleFactory
* @return $this
*/
public function setPeopleFactory($peopleFactory)
{
$this->peopleFactory = $peopleFactory;
+
return $this;
}
@@ -436,6 +447,4 @@ public function getPeopleFactory()
{
return $this->peopleFactory;
}
-
-
}
diff --git a/lib/Tmdb/Repository/NetworkRepository.php b/lib/Tmdb/Repository/NetworkRepository.php
index eb6407ee..21673778 100644
--- a/lib/Tmdb/Repository/NetworkRepository.php
+++ b/lib/Tmdb/Repository/NetworkRepository.php
@@ -20,7 +20,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#networks
*/
-class NetworkRepository extends AbstractRepository {
+class NetworkRepository extends AbstractRepository
+{
/**
* This method is used to retrieve the basic information about a TV network.
*
@@ -28,11 +29,12 @@ class NetworkRepository extends AbstractRepository {
* At this time we don't have much but this will be fleshed out over time.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Network
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->create(
$this->getApi()->getNetwork($id, $parameters, $headers)
);
@@ -55,4 +57,4 @@ public function getFactory()
{
return new NetworkFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/PeopleRepository.php b/lib/Tmdb/Repository/PeopleRepository.php
index f9fcf4b3..c09c87be 100644
--- a/lib/Tmdb/Repository/PeopleRepository.php
+++ b/lib/Tmdb/Repository/PeopleRepository.php
@@ -23,17 +23,18 @@
*
* @todo implement the new methods
*/
-class PeopleRepository extends AbstractRepository {
+class PeopleRepository extends AbstractRepository
+{
/**
* Load a person with the given identifier
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Person
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
-
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
if (empty($parameters) && $parameters !== false) {
// Load a no-nonsense default set
$parameters = array(
@@ -49,6 +50,7 @@ public function load($id, array $parameters = array(), array $headers = array())
}
$data = $this->getApi()->getPerson($id, $this->parseQueryParameters($parameters), $headers);
+
return $this->getFactory()->create($data);
}
@@ -71,7 +73,9 @@ public function getMovieCredits($id, array $parameters = array(), array $headers
/**
* Get the TV credits for a specific person id.
*
- * To get the expanded details for each record, call the /credit method with the provided credit_id.
+ * To get the expanded details for each record,
+ * call the /credit method with the provided credit_id.
+ *
* This will provide details about which episode and/or season the credit is for.
*
* @param $id
@@ -90,7 +94,9 @@ public function getTvCredits($id, array $parameters = array(), array $headers =
/**
* Get the combined (movie and TV) credits for a specific person id.
*
- * To get the expanded details for each TV record, call the /credit method with the provided credit_id.
+ * To get the expanded details for each TV record,
+ * call the /credit method with the provided credit_id.
+ *
* This will provide details about which episode and/or season the credit is for.
*
* @param $id
@@ -144,8 +150,8 @@ public function getImages($id)
* The language is present on fields that are translatable.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return null|\Tmdb\Model\AbstractModel
*/
public function getChanges($id, array $parameters = array(), array $headers = array())
@@ -161,13 +167,14 @@ public function getChanges($id, array $parameters = array(), array $headers = ar
*
* This list refreshes every day.
*
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return null|\Tmdb\Model\AbstractModel
*/
public function getPopular(array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getPopular($parameters, $headers);
+
return $this->getFactory()->createResultCollection($data);
}
@@ -179,6 +186,7 @@ public function getPopular(array $parameters = array(), array $headers = array()
public function getLatest()
{
$data = $this->getApi()->getLatest();
+
return $this->getFactory()->create($data);
}
diff --git a/lib/Tmdb/Repository/ReviewRepository.php b/lib/Tmdb/Repository/ReviewRepository.php
index 2695d9fb..e493374d 100644
--- a/lib/Tmdb/Repository/ReviewRepository.php
+++ b/lib/Tmdb/Repository/ReviewRepository.php
@@ -20,16 +20,18 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#reviews
*/
-class ReviewRepository extends AbstractRepository {
+class ReviewRepository extends AbstractRepository
+{
/**
* Get the full details of a review by ID.
*
* @param $id
- * @param array $parameters
- * @param array $headers
+ * @param array $parameters
+ * @param array $headers
* @return Review
*/
- public function load($id, array $parameters = array(), array $headers = array()) {
+ public function load($id, array $parameters = array(), array $headers = array())
+ {
return $this->getFactory()->create(
$this->getApi()->getReview($id, $parameters, $headers)
);
@@ -52,4 +54,4 @@ public function getFactory()
{
return new ReviewFactory();
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/SearchRepository.php b/lib/Tmdb/Repository/SearchRepository.php
index f06541c3..3f7d71cd 100644
--- a/lib/Tmdb/Repository/SearchRepository.php
+++ b/lib/Tmdb/Repository/SearchRepository.php
@@ -42,8 +42,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#search
*/
-class SearchRepository extends AbstractRepository {
-
+class SearchRepository extends AbstractRepository
+{
/**
* @var MovieFactory
*/
@@ -93,92 +93,98 @@ public function __construct(Client $client)
}
/**
- * @param string $query
+ * @param string $query
* @param MovieSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Movie[]
*/
- public function searchMovie($query, MovieSearchQuery $parameters, array $headers = array()) {
+ public function searchMovie($query, MovieSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchMovies($query, $this->getParameters($parameters), $headers);
return $this->getMovieFactory()->createResultCollection($data);
}
/**
- * @param string $query
+ * @param string $query
* @param CollectionSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Collection[]
*/
- public function searchCollection($query, CollectionSearchQuery $parameters, array $headers = array()) {
+ public function searchCollection($query, CollectionSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchCollection($query, $this->getParameters($parameters), $headers);
return $this->getCollectionFactory()->createResultCollection($data);
}
/**
- * @param string $query
+ * @param string $query
* @param TvSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Tv[]
*/
- public function searchTv($query, TvSearchQuery $parameters, array $headers = array()) {
+ public function searchTv($query, TvSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchTv($query, $this->getParameters($parameters), $headers);
return $this->getTvFactory()->createResultCollection($data);
}
/**
- * @param string $query
+ * @param string $query
* @param PersonSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Person[]
*/
- public function searchPerson($query, PersonSearchQuery $parameters, array $headers = array()) {
+ public function searchPerson($query, PersonSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchPersons($query, $this->getParameters($parameters), $headers);
return $this->getPeopleFactory()->createResultCollection($data);
}
/**
- * @param string $query
+ * @param string $query
* @param ListSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection
*/
- public function searchList($query, ListSearchQuery $parameters, array $headers = array()) {
+ public function searchList($query, ListSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchList($query, $this->getParameters($parameters), $headers);
return $this->getListitemFactory()->createResultCollection($data);
}
/**
- * @param string $query
+ * @param string $query
* @param CompanySearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Company[]
*/
- public function searchCompany($query, CompanySearchQuery $parameters, array $headers = array()) {
+ public function searchCompany($query, CompanySearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchTv($query, $this->getParameters($parameters), $headers);
return $this->getCompanyFactory()->createResultCollection($data);
}
-
/**
- * @param string $query
+ * @param string $query
* @param KeywordSearchQuery $parameters
- * @param array $headers
+ * @param array $headers
*
* @return ResultCollection|Keyword[]
*/
- public function searchKeyword($query, KeywordSearchQuery $parameters, array $headers = array()) {
+ public function searchKeyword($query, KeywordSearchQuery $parameters, array $headers = array())
+ {
$data = $this->getApi()->searchKeyword($query, $this->getParameters($parameters), $headers);
return $this->getKeywordFactory()->createResultCollection($data);
@@ -187,10 +193,11 @@ public function searchKeyword($query, KeywordSearchQuery $parameters, array $hea
/**
* Convert parameters back to an array
*
- * @param array $parameters
+ * @param array $parameters
* @return array
*/
- private function getParameters($parameters = array()) {
+ private function getParameters($parameters = array())
+ {
if ($parameters instanceof SearchQuery) {
return $parameters->toArray();
}
@@ -213,17 +220,19 @@ public function getApi()
*
* @throws NotImplementedException
*/
- public function getFactory(){
+ public function getFactory()
+ {
throw new NotImplementedException('SearchRepository does not support a generic factory.');
}
/**
- * @param \Tmdb\Factory\MovieFactory $movieFactory
+ * @param \Tmdb\Factory\MovieFactory $movieFactory
* @return $this
*/
public function setMovieFactory($movieFactory)
{
$this->movieFactory = $movieFactory;
+
return $this;
}
@@ -236,12 +245,13 @@ public function getMovieFactory()
}
/**
- * @param \Tmdb\Factory\CollectionFactory $collectionFactory
+ * @param \Tmdb\Factory\CollectionFactory $collectionFactory
* @return $this
*/
public function setCollectionFactory($collectionFactory)
{
$this->collectionFactory = $collectionFactory;
+
return $this;
}
@@ -254,12 +264,13 @@ public function getCollectionFactory()
}
/**
- * @param \Tmdb\Factory\CompanyFactory $companyFactory
+ * @param \Tmdb\Factory\CompanyFactory $companyFactory
* @return $this
*/
public function setCompanyFactory($companyFactory)
{
$this->companyFactory = $companyFactory;
+
return $this;
}
@@ -272,12 +283,13 @@ public function getCompanyFactory()
}
/**
- * @param \Tmdb\Factory\KeywordFactory $keywordFactory
+ * @param \Tmdb\Factory\KeywordFactory $keywordFactory
* @return $this
*/
public function setKeywordFactory($keywordFactory)
{
$this->keywordFactory = $keywordFactory;
+
return $this;
}
@@ -290,12 +302,13 @@ public function getKeywordFactory()
}
/**
- * @param \Tmdb\Factory\Movie\ListItemFactory $listItemFactory
+ * @param \Tmdb\Factory\Movie\ListItemFactory $listItemFactory
* @return $this
*/
public function setListItemFactory($listItemFactory)
{
$this->listItemFactory = $listItemFactory;
+
return $this;
}
@@ -308,12 +321,13 @@ public function getListItemFactory()
}
/**
- * @param \Tmdb\Factory\PeopleFactory $peopleFactory
+ * @param \Tmdb\Factory\PeopleFactory $peopleFactory
* @return $this
*/
public function setPeopleFactory($peopleFactory)
{
$this->peopleFactory = $peopleFactory;
+
return $this;
}
@@ -326,12 +340,13 @@ public function getPeopleFactory()
}
/**
- * @param \Tmdb\Factory\TvFactory $tvFactory
+ * @param \Tmdb\Factory\TvFactory $tvFactory
* @return $this
*/
public function setTvFactory($tvFactory)
{
$this->tvFactory = $tvFactory;
+
return $this;
}
@@ -342,4 +357,4 @@ public function getTvFactory()
{
return $this->tvFactory;
}
-}
\ No newline at end of file
+}
diff --git a/lib/Tmdb/Repository/TvEpisodeRepository.php b/lib/Tmdb/Repository/TvEpisodeRepository.php
index 351c1150..74128c78 100644
--- a/lib/Tmdb/Repository/TvEpisodeRepository.php
+++ b/lib/Tmdb/Repository/TvEpisodeRepository.php
@@ -24,12 +24,13 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#tvepisodes
*/
-class TvEpisodeRepository extends AbstractRepository {
-
+class TvEpisodeRepository extends AbstractRepository
+{
/**
* Load a tv season with the given identifier
*
- * If you want to optimize the result set/bandwidth you should define the AppendToResponse parameter
+ * If you want to optimize the result set/bandwidth you should
+ * define the AppendToResponse parameter
*
* @param $tvShow Tv|integer
* @param $season Season|integer
@@ -67,7 +68,13 @@ public function load($tvShow, $season, $episode, array $parameters = array(), ar
);
}
- $data = $this->getApi()->getEpisode($tvShow, $season, $episode, $this->parseQueryParameters($parameters), $headers);
+ $data = $this->getApi()->getEpisode(
+ $tvShow,
+ $season,
+ $episode,
+ $this->parseQueryParameters($parameters),
+ $headers
+ );
return $this->getFactory()->create($data);
}
@@ -98,7 +105,14 @@ public function getCredits($tvShow, $season, $episode, array $parameters = array
$episode = $episode->getId();
}
- $data = $this->getApi()->getCredits($tvShow, $season, $episode, $this->parseQueryParameters($parameters), $headers);
+ $data = $this->getApi()->getCredits(
+ $tvShow,
+ $season,
+ $episode,
+ $this->parseQueryParameters($parameters),
+ $headers
+ );
+
$episode = $this->getFactory()->create(array('credits' => $data));
return $episode->getCredits();
@@ -128,7 +142,14 @@ public function getExternalIds($tvShow, $season, $episode, array $parameters = a
$episode = $episode->getId();
}
- $data = $this->getApi()->getExternalIds($tvShow, $season, $episode, $this->parseQueryParameters($parameters), $headers);
+ $data = $this->getApi()->getExternalIds(
+ $tvShow,
+ $season,
+ $episode,
+ $this->parseQueryParameters($parameters),
+ $headers
+ );
+
$episode = $this->getFactory()->create(array('external_ids' => $data));
return $episode->getExternalIds();
@@ -157,13 +178,20 @@ public function getImages($tvShow, $season, $episode, array $parameters = array(
if ($episode instanceof Tv\Episode) {
$episode = $episode->getId();
}
-
- $data = $this->getApi()->getImages($tvShow, $season, $episode, $this->parseQueryParameters($parameters), $headers);
+
+ $data = $this->getApi()->getImages(
+ $tvShow,
+ $season,
+ $episode,
+ $this->parseQueryParameters($parameters),
+ $headers
+ );
+
$episode = $this->getFactory()->create(array('images' => $data));
return $episode->getImages();
}
-
+
/**
* Return the Seasons API Class
*
diff --git a/lib/Tmdb/Repository/TvRepository.php b/lib/Tmdb/Repository/TvRepository.php
index d455c801..a3b55e99 100644
--- a/lib/Tmdb/Repository/TvRepository.php
+++ b/lib/Tmdb/Repository/TvRepository.php
@@ -21,14 +21,15 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#tv
*/
-class TvRepository extends AbstractRepository {
-
+class TvRepository extends AbstractRepository
+{
/**
* Load a tv with the given identifier
*
- * If you want to optimize the result set/bandwidth you should define the AppendToResponse parameter
+ * If you want to optimize the result set/bandwidth you should
+ * define the AppendToResponse parameter
*
- * @param integer $id
+ * @param integer $id
* @param $parameters
* @param $headers
* @return null|\Tmdb\Model\AbstractModel
@@ -141,7 +142,7 @@ public function getFactory()
/**
* Get the list of popular tvs on The Tv Database. This list refreshes every day.
*
- * @param array $options
+ * @param array $options
* @return Tv[]
*/
public function getPopular(array $options = array())
@@ -152,9 +153,10 @@ public function getPopular(array $options = array())
}
/**
- * Get the list of top rated tvs. By default, this list will only include tvs that have 10 or more votes. This list refreshes every day.
+ * Get the list of top rated tvs. By default, this list will only include tvs that have 10 or more votes.
+ * This list refreshes every day.
*
- * @param array $options
+ * @param array $options
* @return Tv[]
*/
public function getTopRated(array $options = array())
@@ -165,9 +167,10 @@ public function getTopRated(array $options = array())
}
/**
- * Get the list of top rated tvs. By default, this list will only include tvs that have 10 or more votes. This list refreshes every day.
+ * Get the list of top rated tvs. By default, this list will only include tvs that have 10 or more votes.
+ * This list refreshes every day.
*
- * @param array $options
+ * @param array $options
* @return Tv[]
*/
public function getOnTheAir(array $options = array())
diff --git a/lib/Tmdb/Repository/TvSeasonRepository.php b/lib/Tmdb/Repository/TvSeasonRepository.php
index 85c4044e..df82ffd4 100644
--- a/lib/Tmdb/Repository/TvSeasonRepository.php
+++ b/lib/Tmdb/Repository/TvSeasonRepository.php
@@ -24,8 +24,8 @@
* @package Tmdb\Repository
* @see http://docs.themoviedb.apiary.io/#tvseasons
*/
-class TvSeasonRepository extends AbstractRepository {
-
+class TvSeasonRepository extends AbstractRepository
+{
/**
* Load a tv season with the given identifier
*
@@ -67,7 +67,6 @@ public function load($tvShow, $season, array $parameters = array(), array $heade
return $this->getFactory()->create($data);
}
-
/**
* Get the cast & crew information about a TV series.
*
diff --git a/lib/Tmdb/RequestToken.php b/lib/Tmdb/RequestToken.php
index 2968fca8..f791a8a0 100644
--- a/lib/Tmdb/RequestToken.php
+++ b/lib/Tmdb/RequestToken.php
@@ -16,7 +16,8 @@
* Class RequestToken
* @package Tmdb
*/
-class RequestToken {
+class RequestToken
+{
/**
* The token for obtaining a session
*
@@ -47,12 +48,13 @@ public function __construct($request_token = null)
}
/**
- * @param null $token
+ * @param null $token
* @return $this
*/
public function setToken($token)
{
$this->token = $token;
+
return $this;
}
@@ -65,7 +67,7 @@ public function getToken()
}
/**
- * @param mixed $expiresAt
+ * @param mixed $expiresAt
* @return $this
*/
public function setExpiresAt($expiresAt)
@@ -75,6 +77,7 @@ public function setExpiresAt($expiresAt)
}
$this->expiresAt = $expiresAt;
+
return $this;
}
@@ -87,12 +90,13 @@ public function getExpiresAt()
}
/**
- * @param boolean $success
+ * @param boolean $success
* @return $this
*/
public function setSuccess($success)
{
$this->success = $success;
+
return $this;
}
diff --git a/lib/Tmdb/SessionToken.php b/lib/Tmdb/SessionToken.php
index 8af98252..093e0132 100644
--- a/lib/Tmdb/SessionToken.php
+++ b/lib/Tmdb/SessionToken.php
@@ -16,7 +16,8 @@
* Class SessionToken
* @package Tmdb
*/
-class SessionToken {
+class SessionToken
+{
/**
* @var string
*/
@@ -43,12 +44,13 @@ public function __construct($session_token = null)
}
/**
- * @param null $sessionToken
+ * @param null $sessionToken
* @return $this
*/
public function setToken($sessionToken)
{
$this->sessionToken = $sessionToken;
+
return $this;
}
@@ -61,7 +63,7 @@ public function getToken()
}
/**
- * @param \DateTime $expiresAt
+ * @param \DateTime $expiresAt
* @return $this
*/
public function setExpiresAt($expiresAt)
@@ -71,6 +73,7 @@ public function setExpiresAt($expiresAt)
}
$this->expiresAt = $expiresAt;
+
return $this;
}
@@ -83,12 +86,13 @@ public function getExpiresAt()
}
/**
- * @param mixed $success
+ * @param mixed $success
* @return $this
*/
public function setSuccess($success)
{
$this->success = $success;
+
return $this;
}
diff --git a/phpdox.xml b/phpdox.xml
deleted file mode 100644
index 1ddf5fed..00000000
--- a/phpdox.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 122309f9..819f8286 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -28,10 +28,4 @@
./lib/Tmdb/
-
-
-
-
\ No newline at end of file
diff --git a/test/Tmdb/Tests/Api/AccountTest.php b/test/Tmdb/Tests/Api/AccountTest.php
index 06276ecc..81835140 100644
--- a/test/Tmdb/Tests/Api/AccountTest.php
+++ b/test/Tmdb/Tests/Api/AccountTest.php
@@ -77,7 +77,8 @@ public function shouldWatchlist()
$api->watchlist('account_id', true);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Account';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/AuthenticationTest.php b/test/Tmdb/Tests/Api/AuthenticationTest.php
index 89d0c31b..dd78a12d 100644
--- a/test/Tmdb/Tests/Api/AuthenticationTest.php
+++ b/test/Tmdb/Tests/Api/AuthenticationTest.php
@@ -41,7 +41,8 @@ public function shouldGetNewGuestSession()
$api->getNewGuestSession();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Authentication';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/CertificationsTest.php b/test/Tmdb/Tests/Api/CertificationsTest.php
index 041d06a0..1b96d121 100644
--- a/test/Tmdb/Tests/Api/CertificationsTest.php
+++ b/test/Tmdb/Tests/Api/CertificationsTest.php
@@ -27,7 +27,8 @@ public function shouldGetCertificationsListForMovies()
$api->getMovieList();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Certifications';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/ChangesTest.php b/test/Tmdb/Tests/Api/ChangesTest.php
index af952035..7535bc2b 100644
--- a/test/Tmdb/Tests/Api/ChangesTest.php
+++ b/test/Tmdb/Tests/Api/ChangesTest.php
@@ -40,7 +40,8 @@ public function shouldGetPersonChanges()
$api->getPersonChanges();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Changes';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/CollectionsTest.php b/test/Tmdb/Tests/Api/CollectionsTest.php
index 2b5b6820..295fc240 100644
--- a/test/Tmdb/Tests/Api/CollectionsTest.php
+++ b/test/Tmdb/Tests/Api/CollectionsTest.php
@@ -12,7 +12,7 @@
*/
namespace Tmdb\Tests\Api;
-class ColletionsTest extends TestCase
+class CollectionsTest extends TestCase
{
const COLLECTION_ID = 120;
@@ -42,7 +42,8 @@ public function shouldGetImages()
$api->getImages(self::COLLECTION_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Collections';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/CompaniesTest.php b/test/Tmdb/Tests/Api/CompaniesTest.php
index ce84f71a..25fe7114 100644
--- a/test/Tmdb/Tests/Api/CompaniesTest.php
+++ b/test/Tmdb/Tests/Api/CompaniesTest.php
@@ -42,7 +42,8 @@ public function shouldGetMovies()
$api->getMovies(self::COMPANY_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Companies';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/ConfigurationTest.php b/test/Tmdb/Tests/Api/ConfigurationTest.php
index 139215d9..54a83f66 100644
--- a/test/Tmdb/Tests/Api/ConfigurationTest.php
+++ b/test/Tmdb/Tests/Api/ConfigurationTest.php
@@ -27,7 +27,8 @@ public function shouldGetConfiguration()
$api->getConfiguration();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Configuration';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/CreditsTest.php b/test/Tmdb/Tests/Api/CreditsTest.php
index 49b63aab..24317086 100644
--- a/test/Tmdb/Tests/Api/CreditsTest.php
+++ b/test/Tmdb/Tests/Api/CreditsTest.php
@@ -27,7 +27,8 @@ public function shouldGetCredit()
$api->getCredit('5240760b5dbf5b0c2c0139db');
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Credits';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/DiscoverTest.php b/test/Tmdb/Tests/Api/DiscoverTest.php
index 867e6380..af7d2c87 100644
--- a/test/Tmdb/Tests/Api/DiscoverTest.php
+++ b/test/Tmdb/Tests/Api/DiscoverTest.php
@@ -40,7 +40,8 @@ public function shouldDiscoverTv()
$api->discoverTv();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Discover';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/GenresTest.php b/test/Tmdb/Tests/Api/GenresTest.php
index 4a715b92..a17d77ab 100644
--- a/test/Tmdb/Tests/Api/GenresTest.php
+++ b/test/Tmdb/Tests/Api/GenresTest.php
@@ -66,7 +66,7 @@ public function shouldGetGenreAndReturnOne()
$api->expects($this->once())
->method('getGenres')
- ->will($this->returnCallback(function(){
+ ->will($this->returnCallback(function () {
return array('genres' => array(array('id' => 28, 'name' => 'Action')));
}))
;
@@ -86,7 +86,7 @@ public function shouldReturnNullWithNoData()
$api->expects($this->once())
->method('getGenres')
- ->will($this->returnCallback(function(){
+ ->will($this->returnCallback(function () {
return array('genres' => array());
}))
;
@@ -96,7 +96,8 @@ public function shouldReturnNullWithNoData()
$this->assertEquals(null, $genre);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Genres';
}
}
diff --git a/test/Tmdb/Tests/Api/JobsTest.php b/test/Tmdb/Tests/Api/JobsTest.php
index f7e26f71..d11cf8fd 100644
--- a/test/Tmdb/Tests/Api/JobsTest.php
+++ b/test/Tmdb/Tests/Api/JobsTest.php
@@ -27,7 +27,8 @@ public function shouldGetList()
$api->getJobs();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Jobs';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/KeywordsTest.php b/test/Tmdb/Tests/Api/KeywordsTest.php
index 63859128..e0da163c 100644
--- a/test/Tmdb/Tests/Api/KeywordsTest.php
+++ b/test/Tmdb/Tests/Api/KeywordsTest.php
@@ -42,7 +42,8 @@ public function shouldGetMovies()
$api->getMovies(self::KEYWORD_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Keywords';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/ListsTest.php b/test/Tmdb/Tests/Api/ListsTest.php
index 030b940b..8d869bf2 100644
--- a/test/Tmdb/Tests/Api/ListsTest.php
+++ b/test/Tmdb/Tests/Api/ListsTest.php
@@ -78,7 +78,8 @@ public function shouldDeleteList()
$api->deleteList(self::LIST_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Lists';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/MoviesTest.php b/test/Tmdb/Tests/Api/MoviesTest.php
index d2e674f6..92d0c3f7 100644
--- a/test/Tmdb/Tests/Api/MoviesTest.php
+++ b/test/Tmdb/Tests/Api/MoviesTest.php
@@ -255,7 +255,8 @@ public function shouldRateMovie()
$api->rateMovie(self::MOVIE_ID, 7.5);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Movies';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/NetworksTest.php b/test/Tmdb/Tests/Api/NetworksTest.php
index 14bcbb8b..86234096 100644
--- a/test/Tmdb/Tests/Api/NetworksTest.php
+++ b/test/Tmdb/Tests/Api/NetworksTest.php
@@ -27,7 +27,8 @@ public function shouldGetCredit()
$api->getNetwork(49);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Networks';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/PeopleTest.php b/test/Tmdb/Tests/Api/PeopleTest.php
index 3421f1d9..257c5e9d 100644
--- a/test/Tmdb/Tests/Api/PeopleTest.php
+++ b/test/Tmdb/Tests/Api/PeopleTest.php
@@ -120,7 +120,8 @@ public function shouldGetLatest()
$api->getLatest();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\People';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/ReviewsTest.php b/test/Tmdb/Tests/Api/ReviewsTest.php
index 1a655840..c2fba101 100644
--- a/test/Tmdb/Tests/Api/ReviewsTest.php
+++ b/test/Tmdb/Tests/Api/ReviewsTest.php
@@ -29,7 +29,8 @@ public function shouldGetPerson()
$api->getReview(self::REVIEW_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Reviews';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/SearchTest.php b/test/Tmdb/Tests/Api/SearchTest.php
index ad346057..278a4a3f 100644
--- a/test/Tmdb/Tests/Api/SearchTest.php
+++ b/test/Tmdb/Tests/Api/SearchTest.php
@@ -113,7 +113,8 @@ public function shouldSearchKeyword()
$api->searchKeyword(self::QUERY_KEYWORD);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Search';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/TestCase.php b/test/Tmdb/Tests/Api/TestCase.php
index 57c4403d..dcd6072b 100644
--- a/test/Tmdb/Tests/Api/TestCase.php
+++ b/test/Tmdb/Tests/Api/TestCase.php
@@ -14,8 +14,6 @@
use Tmdb\Tests\TestCase as Base;
-use Tmdb\ApiToken;
-
abstract class TestCase extends Base
{
private $_api = null;
diff --git a/test/Tmdb/Tests/Api/TvEpisodeTest.php b/test/Tmdb/Tests/Api/TvEpisodeTest.php
index 636d8120..c0af9f20 100644
--- a/test/Tmdb/Tests/Api/TvEpisodeTest.php
+++ b/test/Tmdb/Tests/Api/TvEpisodeTest.php
@@ -70,7 +70,8 @@ public function shouldGetEpisodeImages()
$api->getImages(self::TV_ID, self::SEASON_ID, self::EPISODE_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\TvEpisode';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/TvSeasonTest.php b/test/Tmdb/Tests/Api/TvSeasonTest.php
index 727e84c4..a1f20ce7 100644
--- a/test/Tmdb/Tests/Api/TvSeasonTest.php
+++ b/test/Tmdb/Tests/Api/TvSeasonTest.php
@@ -69,7 +69,8 @@ public function shouldGetSeasonImages()
$api->getImages(self::TV_ID, self::SEASON_ID);
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\TvSeason';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Api/TvTest.php b/test/Tmdb/Tests/Api/TvTest.php
index 1d6273d9..821f4e2a 100644
--- a/test/Tmdb/Tests/Api/TvTest.php
+++ b/test/Tmdb/Tests/Api/TvTest.php
@@ -107,7 +107,8 @@ public function shouldGetTopRated()
$api->getTopRated();
}
- protected function getApiClass() {
+ protected function getApiClass()
+ {
return 'Tmdb\Api\Tv';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/ApiTokenTest.php b/test/Tmdb/Tests/ApiTokenTest.php
index f1fc46d6..5949e173 100644
--- a/test/Tmdb/Tests/ApiTokenTest.php
+++ b/test/Tmdb/Tests/ApiTokenTest.php
@@ -10,6 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
+namespace Tmdb\Tests;
+
class ApiTokenTest extends \PHPUnit_Framework_TestCase
{
const API_TOKEN = 'abcdefg';
diff --git a/test/Tmdb/Tests/ClientTest.php b/test/Tmdb/Tests/ClientTest.php
index c81c7a45..24044844 100644
--- a/test/Tmdb/Tests/ClientTest.php
+++ b/test/Tmdb/Tests/ClientTest.php
@@ -10,6 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
+namespace Tmdb\Tests;
+
class ClientTest extends \Tmdb\Tests\TestCase
{
const API_TOKEN = 'abcdef';
@@ -76,4 +78,52 @@ public function assertInstances()
)
);
}
+
+ /**
+ * @test
+ */
+ public function shouldAddCachePluginWhenEnabled()
+ {
+ $token = new \Tmdb\ApiToken(self::API_TOKEN);
+ $client = new \Tmdb\Client($token);
+ $client->setCaching(true, '/tmp/php-tmdb-api');
+
+ $listeners = $client->getHttpClient()
+ ->getClient()
+ ->getEventDispatcher()
+ ->getListeners();
+
+ $this->assertEquals(true, $this->isListenerRegistered(
+ $listeners,
+ 'Guzzle\Plugin\Cache\CachePlugin'
+ ));
+ }
+
+ /**
+ * Find an plugin in an listeners array
+ *
+ * @param $listeners
+ * @param $class
+ * @return bool
+ */
+ private function isListenerRegistered($listeners, $class)
+ {
+ if (is_object($class)) {
+ $class = get_class($class);
+ }
+
+ if (is_array($listeners)) {
+ foreach ($listeners as $subject) {
+ if (is_object($subject) && get_class($subject) === $class) {
+ return true;
+ }
+
+ if (is_array($subject)) {
+ return $this->isListenerRegistered($subject, $class);
+ }
+ }
+ }
+
+ return false;
+ }
}
diff --git a/test/Tmdb/Tests/Common/ObjectHydratorTest.php b/test/Tmdb/Tests/Common/ObjectHydratorTest.php
index e6c84177..a66bc89d 100644
--- a/test/Tmdb/Tests/Common/ObjectHydratorTest.php
+++ b/test/Tmdb/Tests/Common/ObjectHydratorTest.php
@@ -41,19 +41,21 @@ public function callingNonExistingMethodThrowsException()
}
}
-class TestModel extends \Tmdb\Model\AbstractModel {
+class TestModel extends \Tmdb\Model\AbstractModel
+{
private $id;
private $name;
- static $_properties = array('id', 'name');
+ static $properties = array('id', 'name');
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
@@ -66,12 +68,13 @@ public function getId()
}
/**
- * @param mixed $name
+ * @param mixed $name
* @return $this
*/
public function setName($name)
{
$this->name = $name;
+
return $this;
}
@@ -84,6 +87,7 @@ public function getName()
}
}
-class FailingTestModel extends \Tmdb\Model\AbstractModel {
- static $_properties = array('lastname');
-}
\ No newline at end of file
+class FailingTestModel extends \Tmdb\Model\AbstractModel
+{
+ static $properties = array('lastname');
+}
diff --git a/test/Tmdb/Tests/Factory/AccountFactoryTest.php b/test/Tmdb/Tests/Factory/AccountFactoryTest.php
index 09610e23..714faba1 100644
--- a/test/Tmdb/Tests/Factory/AccountFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/AccountFactoryTest.php
@@ -161,4 +161,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\AccountFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php b/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php
index 028dfd58..839775e0 100644
--- a/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/AuthenticationFactoryTest.php
@@ -98,4 +98,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\AuthenticationFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/CertificationFactoryTest.php b/test/Tmdb/Tests/Factory/CertificationFactoryTest.php
index ee4be58b..d9f8774f 100644
--- a/test/Tmdb/Tests/Factory/CertificationFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/CertificationFactoryTest.php
@@ -40,11 +40,11 @@ public function shouldConstructCertification()
/**
* @var Certification $certificationCountry
*/
- foreach($certificationCollection as $certificationCountry) {
+ foreach ($certificationCollection as $certificationCountry) {
$this->assertInstanceOf('Tmdb\Model\Certification', $certificationCountry);
$this->assertNotEmpty($certificationCountry->getCountry());
- foreach($certificationCountry->getCertifications() as $certification) {
+ foreach ($certificationCountry->getCertifications() as $certification) {
$this->assertInstanceOf('Tmdb\Model\Certification\CountryCertification', $certification);
}
}
@@ -54,4 +54,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\CertificationFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/ChangesFactoryTest.php b/test/Tmdb/Tests/Factory/ChangesFactoryTest.php
index 5524238c..174cc6a2 100644
--- a/test/Tmdb/Tests/Factory/ChangesFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/ChangesFactoryTest.php
@@ -57,4 +57,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\ChangesFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/CollectionFactoryTest.php b/test/Tmdb/Tests/Factory/CollectionFactoryTest.php
index 41cac432..e745221c 100644
--- a/test/Tmdb/Tests/Factory/CollectionFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/CollectionFactoryTest.php
@@ -65,7 +65,6 @@ public function shouldBeAbleToSetFactories()
$this->assertInstanceOf('stdClass', $factory->getImageFactory());
}
-
/**
* @test
*/
@@ -103,4 +102,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\CollectionFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/CompanyFactoryTest.php b/test/Tmdb/Tests/Factory/CompanyFactoryTest.php
index dec99ac2..82aca9ce 100644
--- a/test/Tmdb/Tests/Factory/CompanyFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/CompanyFactoryTest.php
@@ -105,4 +105,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\CompanyFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/ConfigurationFactoryTest.php b/test/Tmdb/Tests/Factory/ConfigurationFactoryTest.php
index 47bb4291..c909900b 100644
--- a/test/Tmdb/Tests/Factory/ConfigurationFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/ConfigurationFactoryTest.php
@@ -59,4 +59,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\ConfigurationFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/CreditsFactoryTest.php b/test/Tmdb/Tests/Factory/CreditsFactoryTest.php
index dc0559f9..795c013e 100644
--- a/test/Tmdb/Tests/Factory/CreditsFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/CreditsFactoryTest.php
@@ -113,4 +113,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\CreditsFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/FindFactoryTest.php b/test/Tmdb/Tests/Factory/FindFactoryTest.php
index 78165d3d..b044f799 100644
--- a/test/Tmdb/Tests/Factory/FindFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/FindFactoryTest.php
@@ -34,15 +34,15 @@ public function shouldConstructFind()
$this->assertInstanceOf('Tmdb\Model\Find', $find);
- foreach($find->getMovieResults() as $movie) {
+ foreach ($find->getMovieResults() as $movie) {
$this->assertInstanceOf('Tmdb\Model\Movie', $movie);
}
- foreach($find->getPersonResults() as $person) {
+ foreach ($find->getPersonResults() as $person) {
$this->assertInstanceOf('Tmdb\Model\Person', $person);
}
- foreach($find->getTvResults() as $tv) {
+ foreach ($find->getTvResults() as $tv) {
$this->assertInstanceOf('Tmdb\Model\Tv', $tv);
}
}
@@ -79,4 +79,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\FindFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/GenreFactoryTest.php b/test/Tmdb/Tests/Factory/GenreFactoryTest.php
index c2c66fbe..6d3daa57 100644
--- a/test/Tmdb/Tests/Factory/GenreFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/GenreFactoryTest.php
@@ -33,7 +33,7 @@ public function shouldConstructGenres()
$filteredGenres = $collection->filterId(self::GENRE_ID);
// @todo actually get the first
- foreach($filteredGenres as $filteredGenre) {
+ foreach ($filteredGenres as $filteredGenre) {
$this->assertInstanceOf('Tmdb\Model\Genre', $filteredGenre);
$this->assertEquals('Action', $filteredGenre->getName());
@@ -55,7 +55,7 @@ public function shouldFilter()
$filteredGenres = $genres->filterId(self::GENRE_ID);
- foreach($filteredGenres as $filteredGenre) {
+ foreach ($filteredGenres as $filteredGenre) {
$this->assertEquals('Action', $filteredGenre->getName());
}
}
@@ -73,7 +73,6 @@ public function shouldCollaborateWithCollection()
*/
$genres = $factory->createCollection($data['genres']);
-
$this->assertEquals(count($data['genres']), count($genres->getGenres()));
$genre = $genres->getGenre(28);
@@ -104,4 +103,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\GenreFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/ImageFactoryTest.php b/test/Tmdb/Tests/Factory/ImageFactoryTest.php
index 3cdf3cd6..57b3eea4 100644
--- a/test/Tmdb/Tests/Factory/ImageFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/ImageFactoryTest.php
@@ -63,7 +63,7 @@ public function shouldFilterPosters()
$posters = $this->images->filterPosters();
- foreach($posters as $poster) {
+ foreach ($posters as $poster) {
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $poster);
}
}
@@ -77,7 +77,7 @@ public function shouldFilterBackdrops()
$backdrops = $this->images->filterBackdrops();
- foreach($backdrops as $backdrop) {
+ foreach ($backdrops as $backdrop) {
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $backdrop);
}
}
@@ -91,7 +91,7 @@ public function shouldFilterProfiles()
$profiles = $this->images->filterProfile();
- foreach($profiles as $profile) {
+ foreach ($profiles as $profile) {
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $profile);
}
}
@@ -105,7 +105,7 @@ public function shouldFilterStills()
$stills = $this->images->filterStills();
- foreach($stills as $still) {
+ foreach ($stills as $still) {
$this->assertInstanceOf('Tmdb\Model\Image\StillImage', $still);
}
}
@@ -124,7 +124,7 @@ public function shouldFilterMinHeight()
/**
* @var Image $image
*/
- foreach($images as $image) {
+ foreach ($images as $image) {
$this->assertEquals(true, $image->getHeight() >= 1000);
}
}
@@ -143,7 +143,7 @@ public function shouldFilterMinWidth()
/**
* @var Image $image
*/
- foreach($images as $image) {
+ foreach ($images as $image) {
$this->assertEquals(true, $image->getWidth() >= 1000);
}
}
@@ -162,7 +162,7 @@ public function shouldFilterMaxHeight()
/**
* @var Image $image
*/
- foreach($images as $image) {
+ foreach ($images as $image) {
$this->assertEquals(true, $image->getHeight() <= 1000);
}
}
@@ -181,7 +181,7 @@ public function shouldFilterMaxWidth()
/**
* @var Image $image
*/
- foreach($images as $image) {
+ foreach ($images as $image) {
$this->assertEquals(true, $image->getWidth() <= 1000);
}
}
diff --git a/test/Tmdb/Tests/Factory/JobsFactoryTest.php b/test/Tmdb/Tests/Factory/JobsFactoryTest.php
index 3adccc76..c2e0afa9 100644
--- a/test/Tmdb/Tests/Factory/JobsFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/JobsFactoryTest.php
@@ -14,7 +14,7 @@
use Tmdb\Model\Collection\Jobs;
-class JobFactoryTest extends TestCase
+class JobsFactoryTest extends TestCase
{
private $jobs;
@@ -49,7 +49,7 @@ public function shouldFilterDepartment()
'Special Guest'
);
- foreach($filteredJobs->getJobList() as $filteredJob) {
+ foreach ($filteredJobs->getJobList() as $filteredJob) {
$this->assertEquals(true, in_array($filteredJob, $expectedJobs));
}
}
@@ -79,7 +79,7 @@ public function shouldFilterJobsByDepartment()
'Special Guest'
);
- foreach($filteredJobs as $filteredJob) {
+ foreach ($filteredJobs as $filteredJob) {
$this->assertEquals(true, in_array($filteredJob, $expectedJobs));
}
}
@@ -114,9 +114,8 @@ public function shouldReturnEmptyJobsCollection()
$this->assertEquals(true, empty($filteredJobs));
}
-
protected function getFactoryClass()
{
return 'Tmdb\Factory\JobsFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/KeywordFactoryTest.php b/test/Tmdb/Tests/Factory/KeywordFactoryTest.php
index da20092b..4596b052 100644
--- a/test/Tmdb/Tests/Factory/KeywordFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/KeywordFactoryTest.php
@@ -43,4 +43,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\KeywordFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/ListFactoryTest.php b/test/Tmdb/Tests/Factory/ListFactoryTest.php
index fa0a75d6..5448731a 100644
--- a/test/Tmdb/Tests/Factory/ListFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/ListFactoryTest.php
@@ -160,4 +160,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\ListFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/Movie/AlternativeTitleFactoryTest.php b/test/Tmdb/Tests/Factory/Movie/AlternativeTitleFactoryTest.php
index d238fbd9..791fb90c 100644
--- a/test/Tmdb/Tests/Factory/Movie/AlternativeTitleFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/Movie/AlternativeTitleFactoryTest.php
@@ -43,7 +43,6 @@ public function shouldConstructAlternativeTitle()
$this->assertEquals('Kaas', $title->getTitle());
}
-
/**
* @test
*/
diff --git a/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php b/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php
index a4b6dd13..509cc2a1 100644
--- a/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php
@@ -13,9 +13,7 @@
namespace Tmdb\Tests\Factory\Movie;
use Tmdb\Factory\Common\GenericCollectionFactory;
-use Tmdb\Factory\Movie\AlternativeTitleFactory;
use Tmdb\Model\AbstractModel;
-use Tmdb\Model\Movie\AlternativeTitle;
use Tmdb\Tests\Factory\TestCase;
class GenericCollectionFactoryTest extends TestCase
@@ -37,7 +35,7 @@ public function shouldBeAbleToCreateCollection()
$this->assertEquals(2, count($collection));
- foreach($collection as $item) {
+ foreach ($collection as $item) {
$this->assertEquals(2, $item->getId());
}
}
@@ -48,19 +46,20 @@ protected function getFactoryClass()
}
}
-class FakeClass extends AbstractModel {
-
- public static $_properties = array('id');
+class FakeClass extends AbstractModel
+{
+ public static $properties = array('id');
private $id;
/**
- * @param mixed $id
+ * @param mixed $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
+
return $this;
}
diff --git a/test/Tmdb/Tests/Factory/MovieFactoryTest.php b/test/Tmdb/Tests/Factory/MovieFactoryTest.php
index 0762844b..3cdf07e9 100644
--- a/test/Tmdb/Tests/Factory/MovieFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/MovieFactoryTest.php
@@ -133,11 +133,11 @@ public function shouldGetProfileImages()
/**
* @var CastMember $c
*/
- foreach($cast as $c) {
+ foreach ($cast as $c) {
if ($c->hasProfileImage()) {
$filePath = $c->getProfileImage()->getFilePath();
$this->assertEquals(false, empty($filePath));
- }else{
+ } else {
$this->assertEquals(null, $c->getProfileImage());
}
}
@@ -147,4 +147,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\MovieFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/PeopleFactoryTest.php b/test/Tmdb/Tests/Factory/PeopleFactoryTest.php
index cbfdb333..c6b6e704 100644
--- a/test/Tmdb/Tests/Factory/PeopleFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/PeopleFactoryTest.php
@@ -151,4 +151,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\PeopleFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/ReviewFactoryTest.php b/test/Tmdb/Tests/Factory/ReviewFactoryTest.php
index 7368fb8d..51adf26b 100644
--- a/test/Tmdb/Tests/Factory/ReviewFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/ReviewFactoryTest.php
@@ -56,4 +56,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\ReviewFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/TestCase.php b/test/Tmdb/Tests/Factory/TestCase.php
index aef33e44..24cdb61a 100644
--- a/test/Tmdb/Tests/Factory/TestCase.php
+++ b/test/Tmdb/Tests/Factory/TestCase.php
@@ -21,6 +21,7 @@ abstract class TestCase extends Base
protected function getFactory()
{
$class = $this->getFactoryClass();
+
return new $class();
}
diff --git a/test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php b/test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php
index 36f1e4aa..7f7a61b1 100644
--- a/test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php
@@ -94,4 +94,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\TvEpisodeFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/TvFactoryTest.php b/test/Tmdb/Tests/Factory/TvFactoryTest.php
index 48424bfc..5574b124 100644
--- a/test/Tmdb/Tests/Factory/TvFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/TvFactoryTest.php
@@ -21,7 +21,7 @@ class TvFactoryTest extends TestCase
* @var Tv
*/
private $tv;
-
+
public function setUp()
{
/**
@@ -37,7 +37,7 @@ public function setUp()
*/
$this->tv = $factory->create($data);
}
-
+
/**
* @test
*/
@@ -139,4 +139,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\TvFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php b/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php
index 1ea783ad..f94125fa 100644
--- a/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php
+++ b/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php
@@ -92,4 +92,4 @@ protected function getFactoryClass()
{
return 'Tmdb\Factory\TvSeasonFactory';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Helper/ImageHelperTest.php b/test/Tmdb/Tests/Helper/ImageHelperTest.php
index 69a29b3c..ae3864b8 100644
--- a/test/Tmdb/Tests/Helper/ImageHelperTest.php
+++ b/test/Tmdb/Tests/Helper/ImageHelperTest.php
@@ -10,6 +10,7 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
+namespace Tmdb\Tests\Helper;
use Tmdb\Tests\TestCase as Base;
diff --git a/test/Tmdb/Tests/HttpClient/HttpClientTest.php b/test/Tmdb/Tests/HttpClient/HttpClientTest.php
index afd42a7e..428e06aa 100644
--- a/test/Tmdb/Tests/HttpClient/HttpClientTest.php
+++ b/test/Tmdb/Tests/HttpClient/HttpClientTest.php
@@ -126,7 +126,6 @@ public function shouldCallDelete()
$this->testApi->delete('/');
}
-
/**
* @test
*/
@@ -172,7 +171,8 @@ public function shouldBeAbleToOverrideClient()
}
}
-class TestApi extends AbstractApi {
+class TestApi extends AbstractApi
+{
/**
* @var \Tmdb\HttpClient\HttpClient
*/
@@ -213,7 +213,8 @@ public function put($path, $body = null, array $parameters = array(), $headers =
$this->client->getHttpClient()->put('http://www.google.com/');
}
- public function addSubscriber($event) {
+ public function addSubscriber($event)
+ {
$this->client->getHttpClient()->addSubscriber($event);
}
}
diff --git a/test/Tmdb/Tests/HttpClient/Plugin/AcceptJsonHeaderPluginTest.php b/test/Tmdb/Tests/HttpClient/Plugin/AcceptJsonHeaderPluginTest.php
index 6c55b91f..15c25376 100644
--- a/test/Tmdb/Tests/HttpClient/Plugin/AcceptJsonHeaderPluginTest.php
+++ b/test/Tmdb/Tests/HttpClient/Plugin/AcceptJsonHeaderPluginTest.php
@@ -40,4 +40,4 @@ public function shouldAddToken()
$this->assertEquals('application/json', (string) $header);
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/HttpClient/Plugin/AdultFilterPluginTest.php b/test/Tmdb/Tests/HttpClient/Plugin/AdultFilterPluginTest.php
index ee177bfa..d7728dc4 100644
--- a/test/Tmdb/Tests/HttpClient/Plugin/AdultFilterPluginTest.php
+++ b/test/Tmdb/Tests/HttpClient/Plugin/AdultFilterPluginTest.php
@@ -35,4 +35,4 @@ public function shouldAddToken()
$this->assertEquals('/?include_adult=false', $event['request']->getUrl());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/HttpClient/Plugin/ApiTokenPluginTest.php b/test/Tmdb/Tests/HttpClient/Plugin/ApiTokenPluginTest.php
index ed2583c7..5b146139 100644
--- a/test/Tmdb/Tests/HttpClient/Plugin/ApiTokenPluginTest.php
+++ b/test/Tmdb/Tests/HttpClient/Plugin/ApiTokenPluginTest.php
@@ -37,4 +37,4 @@ public function shouldAddToken()
$this->assertEquals('/?api_key=abcdef', $event['request']->getUrl());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/HttpClient/Plugin/LanguageFilterPluginTest.php b/test/Tmdb/Tests/HttpClient/Plugin/LanguageFilterPluginTest.php
index 0405a544..0c15bc5f 100644
--- a/test/Tmdb/Tests/HttpClient/Plugin/LanguageFilterPluginTest.php
+++ b/test/Tmdb/Tests/HttpClient/Plugin/LanguageFilterPluginTest.php
@@ -35,4 +35,4 @@ public function shouldAddToken()
$this->assertEquals('/?language=en', $event['request']->getUrl());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/HttpClient/Plugin/SessionTokenPluginTest.php b/test/Tmdb/Tests/HttpClient/Plugin/SessionTokenPluginTest.php
index 47175065..12cd70e9 100644
--- a/test/Tmdb/Tests/HttpClient/Plugin/SessionTokenPluginTest.php
+++ b/test/Tmdb/Tests/HttpClient/Plugin/SessionTokenPluginTest.php
@@ -37,4 +37,4 @@ public function shouldAddToken()
$this->assertEquals('/?session_id=abcdef', $event['request']->getUrl());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/ChangeTest.php b/test/Tmdb/Tests/Model/ChangeTest.php
index 642e66ae..1cf697a7 100644
--- a/test/Tmdb/Tests/Model/ChangeTest.php
+++ b/test/Tmdb/Tests/Model/ChangeTest.php
@@ -29,4 +29,4 @@ public function isFunctional()
$this->assertEquals(1, $change->getId());
$this->assertEquals(false, $change->getAdult());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/Collection/KeywordsTest.php b/test/Tmdb/Tests/Model/Collection/KeywordsTest.php
index a39b7be5..a7a23524 100644
--- a/test/Tmdb/Tests/Model/Collection/KeywordsTest.php
+++ b/test/Tmdb/Tests/Model/Collection/KeywordsTest.php
@@ -10,7 +10,7 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-namespace Tmdb\Tests\Model\Common;
+namespace Tmdb\Tests\Model\Collection;
use Tmdb\Model\Collection\Keywords;
use Tmdb\Model\Keyword;
@@ -32,7 +32,7 @@ public function setUp()
{
$this->collection = new Keywords();
- foreach($this->keywords as $keyword) {
+ foreach ($this->keywords as $keyword) {
$object = $this->hydrate(new Keyword(), $keyword);
$this->collection->addKeyword($object);
diff --git a/test/Tmdb/Tests/Model/Collection/PeopleTest.php b/test/Tmdb/Tests/Model/Collection/PeopleTest.php
index 3aa17116..2c11166c 100644
--- a/test/Tmdb/Tests/Model/Collection/PeopleTest.php
+++ b/test/Tmdb/Tests/Model/Collection/PeopleTest.php
@@ -10,7 +10,7 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-namespace Tmdb\Tests\Model\Common;
+namespace Tmdb\Tests\Model\Collection;
use Tmdb\Model\Collection\People;
use Tmdb\Model\Person;
@@ -32,7 +32,7 @@ public function setUp()
{
$this->collection = new People();
- foreach($this->people as $person) {
+ foreach ($this->people as $person) {
$object = $this->hydrate(new Person(), $person);
$this->collection->addPerson($object);
diff --git a/test/Tmdb/Tests/Model/ImageTest.php b/test/Tmdb/Tests/Model/ImageTest.php
index 778eafcd..f2f0bf06 100644
--- a/test/Tmdb/Tests/Model/ImageTest.php
+++ b/test/Tmdb/Tests/Model/ImageTest.php
@@ -39,7 +39,7 @@ public function setUp()
{
$this->collection = new Images();
- foreach($this->images as $image) {
+ foreach ($this->images as $image) {
$factory = new ImageFactory();
$object = $factory->create($image);
diff --git a/test/Tmdb/Tests/Model/MovieTest.php b/test/Tmdb/Tests/Model/MovieTest.php
index 0c51b6a1..95a0fdc8 100644
--- a/test/Tmdb/Tests/Model/MovieTest.php
+++ b/test/Tmdb/Tests/Model/MovieTest.php
@@ -77,4 +77,4 @@ public function shouldAllowOverridingDefaultCollectionObjects()
)
);
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/PersonTest.php b/test/Tmdb/Tests/Model/PersonTest.php
index 26dc0961..0032f117 100644
--- a/test/Tmdb/Tests/Model/PersonTest.php
+++ b/test/Tmdb/Tests/Model/PersonTest.php
@@ -76,4 +76,4 @@ public function shouldAllowOverridingDefaultCollectionObjects()
)
);
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/Query/ChangesQueryTest.php b/test/Tmdb/Tests/Model/Query/ChangesQueryTest.php
index 751951ee..e0eebcd8 100644
--- a/test/Tmdb/Tests/Model/Query/ChangesQueryTest.php
+++ b/test/Tmdb/Tests/Model/Query/ChangesQueryTest.php
@@ -37,4 +37,4 @@ public function shouldCreateValidQuery()
$this->assertEquals($tomorrow->format('Y-m-d'), $query->get('to'));
$this->assertEquals(1, $query->get('page'));
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php b/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php
index 4ee93427..937b008c 100644
--- a/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php
+++ b/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php
@@ -10,7 +10,7 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-namespace Tmdb\Tests\Model\Query;
+namespace Tmdb\Tests\Model\Query\Discover;
use Tmdb\Model\Query\Discover\DiscoverMoviesQuery;
use Tmdb\Tests\TestCase;
@@ -48,4 +48,4 @@ public function shouldCreateValidQuery()
$this->assertEquals(13, count($query));
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php b/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php
index 98bf767e..e17d1443 100644
--- a/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php
+++ b/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php
@@ -10,7 +10,7 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-namespace Tmdb\Tests\Model\Query;
+namespace Tmdb\Tests\Model\Query\Discover;
use Tmdb\Model\Query\Discover\DiscoverTvQuery;
use Tmdb\Tests\TestCase;
@@ -43,4 +43,4 @@ public function shouldCreateValidQuery()
$this->assertEquals(10, count($query));
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/Tv/EpisodeTest.php b/test/Tmdb/Tests/Model/Tv/EpisodeTest.php
index e64a9b3f..b2060caa 100644
--- a/test/Tmdb/Tests/Model/Tv/EpisodeTest.php
+++ b/test/Tmdb/Tests/Model/Tv/EpisodeTest.php
@@ -47,4 +47,4 @@ public function shouldBeAbleToOverrideDefaultCollections()
$this->assertInstanceOf('stdClass', $episode->getCredits());
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Model/TvTest.php b/test/Tmdb/Tests/Model/TvTest.php
index e2cbaec8..03de6d43 100644
--- a/test/Tmdb/Tests/Model/TvTest.php
+++ b/test/Tmdb/Tests/Model/TvTest.php
@@ -40,4 +40,4 @@ public function shouldConstructMovie()
)
);
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/AccountRepositoryTest.php b/test/Tmdb/Tests/Repository/AccountRepositoryTest.php
index 33571324..2dca8ef1 100644
--- a/test/Tmdb/Tests/Repository/AccountRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/AccountRepositoryTest.php
@@ -123,4 +123,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\AccountRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php b/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php
index 085f26f1..e74546c9 100644
--- a/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/AuthenticationRepositoryTest.php
@@ -13,7 +13,6 @@
namespace Tmdb\Tests\Repository;
use Tmdb\Api\Authentication;
-use Tmdb\Model\Movie;
use Tmdb\Repository\AuthenticationRepository;
use Tmdb\RequestToken;
@@ -78,4 +77,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\AuthenticationRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/CertificationRepositoryTest.php b/test/Tmdb/Tests/Repository/CertificationRepositoryTest.php
index d0f766cc..c6d2f5ba 100644
--- a/test/Tmdb/Tests/Repository/CertificationRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/CertificationRepositoryTest.php
@@ -33,4 +33,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\CertificationRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/ChangesRepositoryTest.php b/test/Tmdb/Tests/Repository/ChangesRepositoryTest.php
index 0dc0499d..9dce2e27 100644
--- a/test/Tmdb/Tests/Repository/ChangesRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/ChangesRepositoryTest.php
@@ -49,4 +49,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\ChangesRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/CollectionRepositoryTest.php b/test/Tmdb/Tests/Repository/CollectionRepositoryTest.php
index adfe7cfe..12520536 100644
--- a/test/Tmdb/Tests/Repository/CollectionRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/CollectionRepositoryTest.php
@@ -63,4 +63,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\CollectionRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/CompanyRepositoryTest.php b/test/Tmdb/Tests/Repository/CompanyRepositoryTest.php
index a29b2063..b2712ce0 100644
--- a/test/Tmdb/Tests/Repository/CompanyRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/CompanyRepositoryTest.php
@@ -36,7 +36,6 @@ public function shouldGetMovies()
$repository->getMovies(self::COMPANY_ID);
}
-
/**
* @test
*/
@@ -51,7 +50,7 @@ public function callingGetMoviesWithFakeRequestWillReturnMovieCollection()
))
);
- foreach($collection as $movie) {
+ foreach ($collection as $movie) {
$this->assertInstanceOf('Tmdb\Model\Movie', $movie);
}
}
@@ -65,4 +64,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\CompanyRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/ConfigurationRepositoryTest.php b/test/Tmdb/Tests/Repository/ConfigurationRepositoryTest.php
index 9382e2ca..53cf5e91 100644
--- a/test/Tmdb/Tests/Repository/ConfigurationRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/ConfigurationRepositoryTest.php
@@ -33,4 +33,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\ConfigurationRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/CreditsRepositoryTest.php b/test/Tmdb/Tests/Repository/CreditsRepositoryTest.php
index 17047c4a..96737986 100644
--- a/test/Tmdb/Tests/Repository/CreditsRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/CreditsRepositoryTest.php
@@ -37,4 +37,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\CreditsRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/DiscoverRepositoryTest.php b/test/Tmdb/Tests/Repository/DiscoverRepositoryTest.php
index 30912606..b28dfa70 100644
--- a/test/Tmdb/Tests/Repository/DiscoverRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/DiscoverRepositoryTest.php
@@ -76,4 +76,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\DiscoverRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/FindRepositoryTest.php b/test/Tmdb/Tests/Repository/FindRepositoryTest.php
index cc71a8f9..a2cdb4df 100644
--- a/test/Tmdb/Tests/Repository/FindRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/FindRepositoryTest.php
@@ -33,4 +33,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\FindRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/GenreRepositoryTest.php b/test/Tmdb/Tests/Repository/GenreRepositoryTest.php
index a2b2e00f..7690851f 100644
--- a/test/Tmdb/Tests/Repository/GenreRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/GenreRepositoryTest.php
@@ -65,4 +65,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\GenreRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/JobsRepositoryTest.php b/test/Tmdb/Tests/Repository/JobsRepositoryTest.php
index db0177ff..e5d0c17b 100644
--- a/test/Tmdb/Tests/Repository/JobsRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/JobsRepositoryTest.php
@@ -53,4 +53,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\JobsRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/KeywordRepositoryTest.php b/test/Tmdb/Tests/Repository/KeywordRepositoryTest.php
index df55ae31..00c3577f 100644
--- a/test/Tmdb/Tests/Repository/KeywordRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/KeywordRepositoryTest.php
@@ -60,4 +60,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\KeywordRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/ListRepositoryTest.php b/test/Tmdb/Tests/Repository/ListRepositoryTest.php
index 3c6a045d..e1dde4e6 100644
--- a/test/Tmdb/Tests/Repository/ListRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/ListRepositoryTest.php
@@ -86,4 +86,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\ListRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/MovieRepositoryTest.php b/test/Tmdb/Tests/Repository/MovieRepositoryTest.php
index a904427c..fa035cfc 100644
--- a/test/Tmdb/Tests/Repository/MovieRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/MovieRepositoryTest.php
@@ -237,4 +237,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\MovieRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/NetworkRepositoryTest.php b/test/Tmdb/Tests/Repository/NetworkRepositoryTest.php
index 7e8779a7..c85575e9 100644
--- a/test/Tmdb/Tests/Repository/NetworkRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/NetworkRepositoryTest.php
@@ -45,4 +45,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\NetworkRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/PeopleRepositoryTest.php b/test/Tmdb/Tests/Repository/PeopleRepositoryTest.php
index 437d5a2c..bee8aca5 100644
--- a/test/Tmdb/Tests/Repository/PeopleRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/PeopleRepositoryTest.php
@@ -65,4 +65,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\PeopleRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/ReviewRepositoryTest.php b/test/Tmdb/Tests/Repository/ReviewRepositoryTest.php
index 72f20e09..16634890 100644
--- a/test/Tmdb/Tests/Repository/ReviewRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/ReviewRepositoryTest.php
@@ -45,4 +45,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\ReviewRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/SearchRepositoryTest.php b/test/Tmdb/Tests/Repository/SearchRepositoryTest.php
index 7aca396f..4bf137f3 100644
--- a/test/Tmdb/Tests/Repository/SearchRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/SearchRepositoryTest.php
@@ -165,4 +165,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\SearchRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/TestCase.php b/test/Tmdb/Tests/Repository/TestCase.php
index aa1e0ebf..c0071804 100644
--- a/test/Tmdb/Tests/Repository/TestCase.php
+++ b/test/Tmdb/Tests/Repository/TestCase.php
@@ -14,8 +14,6 @@
use Tmdb\Tests\TestCase as Base;
-use Guzzle\Http\Message\Response;
-use Tmdb\ApiToken;
use Tmdb\Client;
abstract class TestCase extends Base
@@ -39,4 +37,4 @@ protected function getRepositoryMock($client = null, array $methods = array())
return $this->getMock($this->getRepositoryClass(), array_merge(array('getApi'), $methods), array($client));
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/TvEpisodeRepositoryTest.php b/test/Tmdb/Tests/Repository/TvEpisodeRepositoryTest.php
index 5221e7f2..638f5034 100644
--- a/test/Tmdb/Tests/Repository/TvEpisodeRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/TvEpisodeRepositoryTest.php
@@ -125,7 +125,6 @@ public function shouldThrowExceptionWhenConditionsNotMet()
$repository->load($tv, $season, null);
}
-
/**
* @expectedException Tmdb\Exception\RuntimeException
* @test
@@ -137,7 +136,6 @@ public function shouldThrowExceptionWhenConditionsNotMetAll()
$repository->load(null, null, null);
}
-
protected function getApiClass()
{
return 'Tmdb\Api\TvEpisode';
@@ -147,4 +145,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\TvEpisodeRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/TvRepositoryTest.php b/test/Tmdb/Tests/Repository/TvRepositoryTest.php
index ec992b05..e814e42e 100644
--- a/test/Tmdb/Tests/Repository/TvRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/TvRepositoryTest.php
@@ -105,4 +105,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\TvRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/Repository/TvSeasonRepositoryTest.php b/test/Tmdb/Tests/Repository/TvSeasonRepositoryTest.php
index aa33f4e4..ea22b6c8 100644
--- a/test/Tmdb/Tests/Repository/TvSeasonRepositoryTest.php
+++ b/test/Tmdb/Tests/Repository/TvSeasonRepositoryTest.php
@@ -117,7 +117,6 @@ public function shouldThrowExceptionWhenConditionsNotMetAll()
$repository->load(null, null);
}
-
protected function getApiClass()
{
return 'Tmdb\Api\TvSeason';
@@ -127,4 +126,4 @@ protected function getRepositoryClass()
{
return 'Tmdb\Repository\TvSeasonRepository';
}
-}
\ No newline at end of file
+}
diff --git a/test/Tmdb/Tests/RequestTokenTest.php b/test/Tmdb/Tests/RequestTokenTest.php
index 90608004..d5df52bf 100644
--- a/test/Tmdb/Tests/RequestTokenTest.php
+++ b/test/Tmdb/Tests/RequestTokenTest.php
@@ -10,6 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
+namespace Tmdb\Tests;
+
class RequestTokenTest extends \PHPUnit_Framework_TestCase
{
const REQUEST_TOKEN = '641bf16c663db167c6cffcdff41126039d4445bf';
diff --git a/test/Tmdb/Tests/SessionTokenTest.php b/test/Tmdb/Tests/SessionTokenTest.php
index 2a9d0836..e13164bf 100644
--- a/test/Tmdb/Tests/SessionTokenTest.php
+++ b/test/Tmdb/Tests/SessionTokenTest.php
@@ -10,6 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
+namespace Tmdb\Tests;
+
class SessionTokenTest extends \PHPUnit_Framework_TestCase
{
const SESSION_TOKEN = '80b2bf99520cd795ff54e31af97917bc9e3a7c8c';
diff --git a/test/Tmdb/Tests/TestCase.php b/test/Tmdb/Tests/TestCase.php
index e4f3ad08..3bdec4b6 100644
--- a/test/Tmdb/Tests/TestCase.php
+++ b/test/Tmdb/Tests/TestCase.php
@@ -23,16 +23,15 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
* Assert that an array of methods and corresponding classes match
*
* @param $subject
- * @param array $instances
+ * @param array $instances
* @throws \Exception
*/
protected function assertInstancesOf($subject, array $instances = array())
{
- foreach($instances as $method => $instance) {
+ foreach ($instances as $method => $instance) {
try {
$this->assertInstanceOf($instance, $subject->$method());
- }
- catch(\Exception $e){
+ } catch (\Exception $e) {
throw new \Exception(sprintf(
'Failed asserting that calling "%s" returns an instance of expected "%s".',
sprintf('%s::%s', get_class($subject), $method),
@@ -111,7 +110,7 @@ protected function getMockedTmdbClient()
/**
* Get mocked http client
*
- * @param array $methods
+ * @param array $methods
* @return \PHPUnit_Framework_MockObject_MockObject
*/
protected function getMockedHttpClient(array $methods = array())
@@ -129,7 +128,8 @@ protected function getMockedHttpClient(array $methods = array())
* @param $data
* @return \Tmdb\Model\AbstractModel
*/
- protected function hydrate($object, $data) {
+ protected function hydrate($object, $data)
+ {
$objectHydrator = new ObjectHydrator();
return $objectHydrator->hydrate($object, $data);
diff --git a/test/bootstrap.php b/test/bootstrap.php
index ab46da51..f071995e 100644
--- a/test/bootstrap.php
+++ b/test/bootstrap.php
@@ -10,7 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
-function includeIfExists($file) {
+function includeIfExists($file)
+{
if (file_exists($file)) {
return include $file;
}
@@ -24,4 +25,4 @@ function includeIfExists($file) {
$loader->add('Tmdb\Tests', __DIR__);
-return $loader;
\ No newline at end of file
+return $loader;