From 2b3a6db87ab8e17fbbe648ee0cb16185c83b749c Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Thu, 27 Feb 2014 14:36:12 +0100 Subject: [PATCH 01/12] Fixing composer.json --- composer.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c966f987..91c276e2 100644 --- a/composer.json +++ b/composer.json @@ -22,10 +22,5 @@ }, "autoload": { "psr-0": { "Tmdb\\": "lib/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.0-ALPHA1" - } } -} \ No newline at end of file +} From 4be539c5420c43974030f6c0fa805ef527e43233 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Fri, 28 Feb 2014 13:49:56 +0100 Subject: [PATCH 02/12] Updating gitignore --- .gitignore | 3 +++ build/phpdox.xml | 32 ++++++++++++++++++++++++++++++++ build/phpmd.xml | 0 phpdox.xml | 9 --------- 4 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 build/phpdox.xml create mode 100644 build/phpmd.xml delete mode 100644 phpdox.xml diff --git a/.gitignore b/.gitignore index b0e719e9..e154788b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ /bin /docs +/build/* +!/build/phpmd.xml +!/build/phpdox.xml /vendor/ /composer.lock /*.php diff --git a/build/phpdox.xml b/build/phpdox.xml new file mode 100644 index 00000000..eaa24143 --- /dev/null +++ b/build/phpdox.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/phpmd.xml b/build/phpmd.xml new file mode 100644 index 00000000..e69de29b diff --git a/phpdox.xml b/phpdox.xml deleted file mode 100644 index 1ddf5fed..00000000 --- a/phpdox.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - From 8c3ae4ae494f2fe8216e2a69292829984b6da1a3 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Fri, 28 Feb 2014 13:50:03 +0100 Subject: [PATCH 03/12] Adding build related files and modified phpunit coverage --- build.xml | 127 +++++++++++++++++++++++++++++++++++++++++++++++ build/phpdox.xml | 10 ++-- build/phpmd.xml | 13 +++++ phpunit.xml.dist | 5 +- 4 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 build.xml diff --git a/build.xml b/build.xml new file mode 100644 index 00000000..b85793a3 --- /dev/null +++ b/build.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/phpdox.xml b/build/phpdox.xml index eaa24143..a86602dc 100644 --- a/build/phpdox.xml +++ b/build/phpdox.xml @@ -1,14 +1,13 @@ - + - - + + - @@ -24,6 +23,9 @@ + + + diff --git a/build/phpmd.xml b/build/phpmd.xml index e69de29b..6921081f 100644 --- a/build/phpmd.xml +++ b/build/phpmd.xml @@ -0,0 +1,13 @@ + + + + Custom ruleset. + + + + + + + + \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 122309f9..19f79649 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -30,7 +30,10 @@ - + From 2c2a12e4e6345ba3c1e607629f754b5179bbf414 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Fri, 28 Feb 2014 22:44:56 +0100 Subject: [PATCH 04/12] Adding a seperate build script to compile api docs and run coverage and other metrics. --- .gitignore | 2 ++ build.xml | 14 +++++++------- build/phpunit.xml | 40 ++++++++++++++++++++++++++++++++++++++++ phpunit.xml.dist | 9 --------- 4 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 build/phpunit.xml diff --git a/.gitignore b/.gitignore index e154788b..1a5e850a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /bin /docs /build/* +!/build/phpunit.xml !/build/phpmd.xml !/build/phpdox.xml /vendor/ @@ -10,3 +11,4 @@ /apikey.php /phpunit /public_html +/cache.properties diff --git a/build.xml b/build.xml index b85793a3..3942b6ff 100644 --- a/build.xml +++ b/build.xml @@ -1,11 +1,11 @@ - + + depends="prepare,lint,tools-parallel,phpunit,phpdox"/> @@ -13,12 +13,9 @@ + - - @@ -122,6 +119,9 @@ - + + + + diff --git a/build/phpunit.xml b/build/phpunit.xml new file mode 100644 index 00000000..60217598 --- /dev/null +++ b/build/phpunit.xml @@ -0,0 +1,40 @@ + + + + + + ../test/Tmdb/ + + + + + + functional + + + + + + ../lib/Tmdb/ + + + + + + + + \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 19f79649..819f8286 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -28,13 +28,4 @@ ./lib/Tmdb/ - - - - - \ No newline at end of file From c2bef1d53a4d48a5ea4c80ac266ca56ca3df023c Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Fri, 28 Feb 2014 23:13:54 +0100 Subject: [PATCH 05/12] Running php-cs-fixer --- build/phpmd.xml | 2 +- build/phpunit.xml | 2 +- examples/account/api/account.php | 6 +- examples/account/api/favorite.php | 6 +- examples/account/api/favorite_movies.php | 6 +- examples/account/api/lists.php | 6 +- examples/account/api/rated_movies.php | 6 +- examples/account/api/watchlist.php | 6 +- examples/account/api/watchlist_movies.php | 6 +- examples/account/model/account.php | 5 +- examples/account/model/favorite.php | 5 +- examples/account/model/favorite_movies.php | 5 +- examples/account/model/lists.php | 5 +- examples/account/model/movie_watchlist.php | 5 +- examples/account/model/rated_movies.php | 5 +- examples/account/model/watchlist.php | 5 +- .../authentication/api/authenticate-token.php | 6 +- .../authentication/api/get-guest-session.php | 6 +- examples/authentication/api/get-session.php | 6 +- examples/authentication/api/get-token.php | 6 +- .../model/authenticate_request_token.php | 4 +- .../model/guest_session_token.php | 4 +- .../authentication/model/request_token.php | 5 +- .../authentication/model/session_token.php | 5 +- examples/certifications/api/get.php | 6 +- examples/certifications/model/get.php | 5 +- examples/changes/model/movies.php | 5 +- examples/changes/model/people.php | 5 +- examples/collection/model/all.php | 6 +- examples/collection/model/images.php | 6 +- examples/companies/model/get.php | 6 +- examples/configuration/model/get.php | 6 +- examples/credits/api/get.php | 6 +- examples/credits/model/get.php | 6 +- examples/discover/model/movies.php | 5 +- examples/discover/model/tv.php | 5 +- examples/find/model/get.php | 6 +- examples/genres/model/all.php | 8 +- examples/genres/model/get.php | 6 +- examples/genres/model/movies.php | 6 +- examples/jobs/model/all.php | 8 +- examples/keywords/model/get.php | 7 +- examples/keywords/model/movies.php | 6 +- examples/lists/api/add.php | 6 +- examples/lists/api/item_status.php | 6 +- examples/lists/api/list_create.php | 6 +- examples/lists/api/list_delete.php | 6 +- examples/lists/api/remove.php | 6 +- examples/lists/model/add.php | 6 +- examples/lists/model/create_list.php | 6 +- examples/lists/model/get.php | 6 +- examples/lists/model/item_status.php | 6 +- examples/lists/model/remove.php | 6 +- examples/movies/api/account_states.php | 6 +- examples/movies/api/images.php | 6 +- examples/movies/api/movie_rating.php | 6 +- examples/movies/model/account_states.php | 6 +- examples/movies/model/all.php | 28 ++--- examples/movies/model/alternative_titles.php | 6 +- examples/movies/model/changes.php | 6 +- examples/movies/model/credits.php | 6 +- examples/movies/model/get.php | 6 +- examples/movies/model/images.php | 6 +- examples/movies/model/keywords.php | 6 +- examples/movies/model/lists.php | 6 +- examples/movies/model/rate.php | 6 +- examples/movies/model/releases.php | 6 +- examples/movies/model/reviews.php | 6 +- examples/movies/model/similar_movies.php | 6 +- examples/movies/model/trailers.php | 6 +- examples/networks/model/get.php | 7 +- examples/people/model/all.php | 6 +- examples/people/model/combined_credits.php | 6 +- examples/people/model/external_ids.php | 6 +- examples/people/model/latest.php | 6 +- examples/people/model/movie_credits.php | 6 +- examples/people/model/popular.php | 6 +- examples/people/model/tv_credits.php | 6 +- examples/reviews/model/get.php | 7 +- examples/search/model/collection.php | 6 +- examples/search/model/company.php | 6 +- examples/search/model/keyword.php | 6 +- examples/search/model/list.php | 6 +- examples/search/model/movie.php | 6 +- examples/search/model/person.php | 6 +- examples/search/model/tv.php | 6 +- examples/tv/model/episode.php | 6 +- examples/tv/model/episode/credits.php | 6 +- examples/tv/model/episode/external_ids.php | 6 +- examples/tv/model/episode/images.php | 6 +- examples/tv/model/season.php | 6 +- examples/tv/model/season/credits.php | 6 +- examples/tv/model/season/external_ids.php | 6 +- examples/tv/model/season/images.php | 6 +- examples/tv/model/show.php | 6 +- examples/tv/model/tv/credits.php | 6 +- examples/tv/model/tv/external_ids.php | 6 +- examples/tv/model/tv/images.php | 6 +- examples/tv/model/tv/on_the_air.php | 6 +- examples/tv/model/tv/translations.php | 6 +- lib/Tmdb/Api/AbstractApi.php | 47 ++++---- lib/Tmdb/Api/Account.php | 40 +++---- lib/Tmdb/Api/ApiInterface.php | 5 +- lib/Tmdb/Api/Authentication.php | 6 +- lib/Tmdb/Api/Certifications.php | 4 +- lib/Tmdb/Api/Changes.php | 8 +- lib/Tmdb/Api/Collections.php | 8 +- lib/Tmdb/Api/Companies.php | 10 +- lib/Tmdb/Api/Configuration.php | 2 +- lib/Tmdb/Api/Credits.php | 4 +- lib/Tmdb/Api/Discover.php | 8 +- lib/Tmdb/Api/Find.php | 6 +- lib/Tmdb/Api/Genres.php | 20 ++-- lib/Tmdb/Api/Jobs.php | 4 +- lib/Tmdb/Api/Keywords.php | 12 +- lib/Tmdb/Api/Lists.php | 30 ++--- lib/Tmdb/Api/Movies.php | 68 +++++------ lib/Tmdb/Api/Networks.php | 6 +- lib/Tmdb/Api/People.php | 36 +++--- lib/Tmdb/Api/Reviews.php | 4 +- lib/Tmdb/Api/Search.php | 28 ++--- lib/Tmdb/Api/Tv.php | 32 ++--- lib/Tmdb/Api/TvEpisode.php | 16 +-- lib/Tmdb/Api/TvSeason.php | 16 +-- lib/Tmdb/ApiToken.php | 6 +- lib/Tmdb/Client.php | 16 ++- lib/Tmdb/Common/ObjectHydrator.php | 13 +- .../Exception/InvalidArgumentException.php | 4 +- .../Exception/MissingArgumentException.php | 4 +- .../Exception/NotImplementedException.php | 4 +- lib/Tmdb/Exception/RuntimeException.php | 4 +- .../UnauthorizedRequestTokenException.php | 4 +- lib/Tmdb/Factory/AbstractFactory.php | 21 ++-- lib/Tmdb/Factory/AccountFactory.php | 13 +- lib/Tmdb/Factory/AuthenticationFactory.php | 6 +- lib/Tmdb/Factory/CertificationFactory.php | 4 +- lib/Tmdb/Factory/ChangesFactory.php | 2 +- lib/Tmdb/Factory/CollectionFactory.php | 8 +- lib/Tmdb/Factory/Common/ChangeFactory.php | 6 +- .../Common/GenericCollectionFactory.php | 9 +- lib/Tmdb/Factory/CompanyFactory.php | 3 +- lib/Tmdb/Factory/CreditsFactory.php | 10 +- lib/Tmdb/Factory/FindFactory.php | 10 +- lib/Tmdb/Factory/GenreFactory.php | 3 +- lib/Tmdb/Factory/ImageFactory.php | 30 ++--- lib/Tmdb/Factory/JobsFactory.php | 2 +- lib/Tmdb/Factory/KeywordFactory.php | 3 +- lib/Tmdb/Factory/ListFactory.php | 9 +- lib/Tmdb/Factory/Lists/ListItemFactory.php | 5 +- .../Factory/Movie/AlternativeTitleFactory.php | 2 +- lib/Tmdb/Factory/Movie/ListItemFactory.php | 3 +- lib/Tmdb/Factory/MovieFactory.php | 45 ++++--- lib/Tmdb/Factory/NetworkFactory.php | 3 +- lib/Tmdb/Factory/People/CastFactory.php | 5 +- lib/Tmdb/Factory/People/CrewFactory.php | 5 +- lib/Tmdb/Factory/PeopleFactory.php | 28 +++-- lib/Tmdb/Factory/TvEpisodeFactory.php | 14 ++- lib/Tmdb/Factory/TvFactory.php | 23 ++-- lib/Tmdb/Factory/TvSeasonFactory.php | 17 ++- lib/Tmdb/Helper/ImageHelper.php | 22 ++-- lib/Tmdb/HttpClient/HttpClient.php | 11 +- lib/Tmdb/HttpClient/HttpClientInterface.php | 59 +++++---- lib/Tmdb/Model/AbstractModel.php | 3 +- lib/Tmdb/Model/Account.php | 22 ++-- lib/Tmdb/Model/Account/ListItem.php | 30 +++-- lib/Tmdb/Model/Certification.php | 10 +- .../Certification/CountryCertification.php | 14 ++- lib/Tmdb/Model/Change.php | 9 +- lib/Tmdb/Model/Collection.php | 31 +++-- .../Model/Collection/CreditsCollection.php | 9 +- lib/Tmdb/Model/Collection/Genres.php | 9 +- lib/Tmdb/Model/Collection/Images.php | 25 ++-- lib/Tmdb/Model/Collection/Jobs.php | 20 ++-- lib/Tmdb/Model/Collection/Keywords.php | 7 +- lib/Tmdb/Model/Collection/People.php | 7 +- lib/Tmdb/Model/Collection/People/Cast.php | 6 +- lib/Tmdb/Model/Collection/People/Crew.php | 6 +- .../Collection/People/PersonInterface.php | 7 +- .../QueryParameter/AppendToResponse.php | 3 +- .../Model/Collection/ResultCollection.php | 12 +- lib/Tmdb/Model/Common/AbstractTrailer.php | 3 +- lib/Tmdb/Model/Common/Change.php | 11 +- lib/Tmdb/Model/Common/Change/Item.php | 18 +-- lib/Tmdb/Model/Common/Country.php | 10 +- lib/Tmdb/Model/Common/ExternalIds.php | 22 ++-- lib/Tmdb/Model/Common/GenericCollection.php | 19 +-- .../Model/Common/QueryParameter/Adult.php | 4 +- .../QueryParameter/AppendToResponse.php | 3 +- .../Model/Common/QueryParameter/Language.php | 4 +- .../QueryParameterInterface.php | 7 +- .../Type/CollectionToCommaSeperatedString.php | 5 +- lib/Tmdb/Model/Common/SpokenLanguage.php | 10 +- lib/Tmdb/Model/Common/Trailer/Youtube.php | 16 ++- lib/Tmdb/Model/Common/Translation.php | 7 +- lib/Tmdb/Model/Company.php | 28 +++-- lib/Tmdb/Model/Configuration.php | 10 +- lib/Tmdb/Model/Credits.php | 24 ++-- lib/Tmdb/Model/Credits/Media.php | 21 ++-- lib/Tmdb/Model/Filter/AdultFilter.php | 3 +- lib/Tmdb/Model/Filter/CountryFilter.php | 4 +- lib/Tmdb/Model/Filter/ImageFilter.php | 3 +- lib/Tmdb/Model/Filter/LanguageFilter.php | 3 +- lib/Tmdb/Model/Find.php | 14 ++- lib/Tmdb/Model/Genre.php | 10 +- lib/Tmdb/Model/Image.php | 25 ++-- lib/Tmdb/Model/Job.php | 8 +- lib/Tmdb/Model/Keyword.php | 10 +- lib/Tmdb/Model/Lists.php | 34 ++++-- lib/Tmdb/Model/Lists/ItemStatus.php | 9 +- lib/Tmdb/Model/Lists/ListItem.php | 33 ++++-- lib/Tmdb/Model/Lists/Result.php | 9 +- lib/Tmdb/Model/Lists/ResultWithListId.php | 6 +- lib/Tmdb/Model/Movie.php | 112 ++++++++++++------ lib/Tmdb/Model/Movie/AccountStates.php | 16 ++- lib/Tmdb/Model/Movie/AlternativeTitle.php | 10 +- lib/Tmdb/Model/Movie/ListItem.php | 29 +++-- .../Movie/QueryParameter/AppendToResponse.php | 3 +- lib/Tmdb/Model/Movie/Rating.php | 7 +- lib/Tmdb/Model/Movie/Release.php | 13 +- lib/Tmdb/Model/Network.php | 10 +- lib/Tmdb/Model/Person.php | 58 +++++---- lib/Tmdb/Model/Person/AbstractMember.php | 16 ++- lib/Tmdb/Model/Person/CastMember.php | 13 +- lib/Tmdb/Model/Person/CrewMember.php | 10 +- lib/Tmdb/Model/Person/MovieCredit.php | 32 +++-- .../QueryParameter/AppendToResponse.php | 3 +- lib/Tmdb/Model/Query/ChangesQuery.php | 13 +- .../Query/Discover/DiscoverMoviesQuery.php | 37 +++--- .../Model/Query/Discover/DiscoverTvQuery.php | 30 ++--- lib/Tmdb/Model/Query/FindQuery.php | 4 +- lib/Tmdb/Model/Review.php | 29 +++-- lib/Tmdb/Model/Search/SearchQuery.php | 3 +- .../SearchQuery/CollectionSearchQuery.php | 3 +- .../Search/SearchQuery/ListSearchQuery.php | 4 +- .../Search/SearchQuery/MovieSearchQuery.php | 3 +- .../Search/SearchQuery/PersonSearchQuery.php | 4 +- .../Search/SearchQuery/TvSearchQuery.php | 3 +- lib/Tmdb/Model/Tv.php | 91 +++++++++----- lib/Tmdb/Model/Tv/Episode.php | 47 +++++--- .../QueryParameter/AppendToResponse.php | 3 +- lib/Tmdb/Model/Tv/Network.php | 10 +- .../Tv/QueryParameter/AppendToResponse.php | 3 +- lib/Tmdb/Model/Tv/Season.php | 37 ++++-- .../QueryParameter/AppendToResponse.php | 3 +- lib/Tmdb/Repository/AbstractRepository.php | 8 +- lib/Tmdb/Repository/AccountRepository.php | 48 ++++---- .../Repository/AuthenticationRepository.php | 11 +- .../Repository/CertificationRepository.php | 6 +- lib/Tmdb/Repository/ChangesRepository.php | 20 ++-- lib/Tmdb/Repository/CollectionRepository.php | 8 +- lib/Tmdb/Repository/CompanyRepository.php | 22 ++-- .../Repository/ConfigurationRepository.php | 9 +- lib/Tmdb/Repository/CreditsRepository.php | 12 +- lib/Tmdb/Repository/DiscoverRepository.php | 22 ++-- lib/Tmdb/Repository/FindRepository.php | 12 +- lib/Tmdb/Repository/GenreRepository.php | 26 ++-- lib/Tmdb/Repository/JobsRepository.php | 19 +-- lib/Tmdb/Repository/KeywordRepository.php | 19 +-- lib/Tmdb/Repository/ListRepository.php | 40 ++++--- lib/Tmdb/Repository/MovieRepository.php | 34 +++--- lib/Tmdb/Repository/NetworkRepository.php | 12 +- lib/Tmdb/Repository/PeopleRepository.php | 22 ++-- lib/Tmdb/Repository/ReviewRepository.php | 12 +- lib/Tmdb/Repository/SearchRepository.php | 85 +++++++------ lib/Tmdb/Repository/TvEpisodeRepository.php | 8 +- lib/Tmdb/Repository/TvRepository.php | 12 +- lib/Tmdb/Repository/TvSeasonRepository.php | 5 +- lib/Tmdb/RequestToken.php | 12 +- lib/Tmdb/SessionToken.php | 12 +- test/Tmdb/Tests/Api/AccountTest.php | 5 +- test/Tmdb/Tests/Api/AuthenticationTest.php | 5 +- test/Tmdb/Tests/Api/CertificationsTest.php | 5 +- test/Tmdb/Tests/Api/ChangesTest.php | 5 +- test/Tmdb/Tests/Api/CollectionsTest.php | 7 +- test/Tmdb/Tests/Api/CompaniesTest.php | 5 +- test/Tmdb/Tests/Api/ConfigurationTest.php | 5 +- test/Tmdb/Tests/Api/CreditsTest.php | 5 +- test/Tmdb/Tests/Api/DiscoverTest.php | 5 +- test/Tmdb/Tests/Api/GenresTest.php | 7 +- test/Tmdb/Tests/Api/JobsTest.php | 5 +- test/Tmdb/Tests/Api/KeywordsTest.php | 5 +- test/Tmdb/Tests/Api/ListsTest.php | 5 +- test/Tmdb/Tests/Api/MoviesTest.php | 5 +- test/Tmdb/Tests/Api/NetworksTest.php | 5 +- test/Tmdb/Tests/Api/PeopleTest.php | 5 +- test/Tmdb/Tests/Api/ReviewsTest.php | 5 +- test/Tmdb/Tests/Api/SearchTest.php | 5 +- test/Tmdb/Tests/Api/TestCase.php | 2 - test/Tmdb/Tests/Api/TvEpisodeTest.php | 5 +- test/Tmdb/Tests/Api/TvSeasonTest.php | 5 +- test/Tmdb/Tests/Api/TvTest.php | 5 +- test/Tmdb/Tests/Common/ObjectHydratorTest.php | 14 ++- .../Tmdb/Tests/Factory/AccountFactoryTest.php | 2 +- .../Factory/AuthenticationFactoryTest.php | 2 +- .../Factory/CertificationFactoryTest.php | 6 +- .../Tmdb/Tests/Factory/ChangesFactoryTest.php | 2 +- .../Tests/Factory/CollectionFactoryTest.php | 3 +- .../Tmdb/Tests/Factory/CompanyFactoryTest.php | 2 +- .../Factory/ConfigurationFactoryTest.php | 2 +- .../Tmdb/Tests/Factory/CreditsFactoryTest.php | 2 +- test/Tmdb/Tests/Factory/FindFactoryTest.php | 8 +- test/Tmdb/Tests/Factory/GenreFactoryTest.php | 7 +- test/Tmdb/Tests/Factory/ImageFactoryTest.php | 16 +-- test/Tmdb/Tests/Factory/JobsFactoryTest.php | 9 +- .../Tmdb/Tests/Factory/KeywordFactoryTest.php | 2 +- test/Tmdb/Tests/Factory/ListFactoryTest.php | 2 +- .../Movie/AlternativeTitleFactoryTest.php | 1 - .../Movie/GenericCollectionFactoryTest.php | 11 +- test/Tmdb/Tests/Factory/MovieFactoryTest.php | 6 +- test/Tmdb/Tests/Factory/PeopleFactoryTest.php | 2 +- test/Tmdb/Tests/Factory/ReviewFactoryTest.php | 2 +- test/Tmdb/Tests/Factory/TestCase.php | 1 + .../Tests/Factory/TvEpisodeFactoryTest.php | 2 +- test/Tmdb/Tests/Factory/TvFactoryTest.php | 6 +- .../Tests/Factory/TvSeasonFactoryTest.php | 2 +- test/Tmdb/Tests/HttpClient/HttpClientTest.php | 7 +- .../Plugin/AcceptJsonHeaderPluginTest.php | 2 +- .../Plugin/AdultFilterPluginTest.php | 2 +- .../HttpClient/Plugin/ApiTokenPluginTest.php | 2 +- .../Plugin/LanguageFilterPluginTest.php | 2 +- .../Plugin/SessionTokenPluginTest.php | 2 +- test/Tmdb/Tests/Model/ChangeTest.php | 2 +- .../Tests/Model/Collection/KeywordsTest.php | 2 +- .../Tests/Model/Collection/PeopleTest.php | 2 +- test/Tmdb/Tests/Model/ImageTest.php | 2 +- test/Tmdb/Tests/Model/MovieTest.php | 2 +- test/Tmdb/Tests/Model/PersonTest.php | 2 +- .../Tests/Model/Query/ChangesQueryTest.php | 2 +- .../Discover/DiscoverMoviesQueryTest.php | 2 +- .../Query/Discover/DiscoverTvQueryTest.php | 2 +- test/Tmdb/Tests/Model/Tv/EpisodeTest.php | 2 +- test/Tmdb/Tests/Model/TvTest.php | 2 +- .../Repository/AccountRepositoryTest.php | 2 +- .../AuthenticationRepositoryTest.php | 3 +- .../CertificationRepositoryTest.php | 2 +- .../Repository/ChangesRepositoryTest.php | 2 +- .../Repository/CollectionRepositoryTest.php | 2 +- .../Repository/CompanyRepositoryTest.php | 5 +- .../ConfigurationRepositoryTest.php | 2 +- .../Repository/CreditsRepositoryTest.php | 2 +- .../Repository/DiscoverRepositoryTest.php | 2 +- .../Tests/Repository/FindRepositoryTest.php | 2 +- .../Tests/Repository/GenreRepositoryTest.php | 2 +- .../Tests/Repository/JobsRepositoryTest.php | 2 +- .../Repository/KeywordRepositoryTest.php | 2 +- .../Tests/Repository/ListRepositoryTest.php | 2 +- .../Tests/Repository/MovieRepositoryTest.php | 2 +- .../Repository/NetworkRepositoryTest.php | 2 +- .../Tests/Repository/PeopleRepositoryTest.php | 2 +- .../Tests/Repository/ReviewRepositoryTest.php | 2 +- .../Tests/Repository/SearchRepositoryTest.php | 2 +- test/Tmdb/Tests/Repository/TestCase.php | 4 +- .../Repository/TvEpisodeRepositoryTest.php | 4 +- .../Tests/Repository/TvRepositoryTest.php | 2 +- .../Repository/TvSeasonRepositoryTest.php | 3 +- test/Tmdb/Tests/TestCase.php | 12 +- test/bootstrap.php | 5 +- 357 files changed, 1999 insertions(+), 1572 deletions(-) diff --git a/build/phpmd.xml b/build/phpmd.xml index 6921081f..865291ae 100644 --- a/build/phpmd.xml +++ b/build/phpmd.xml @@ -10,4 +10,4 @@ - \ No newline at end of file + diff --git a/build/phpunit.xml b/build/phpunit.xml index 60217598..a33344bf 100644 --- a/build/phpunit.xml +++ b/build/phpunit.xml @@ -37,4 +37,4 @@ yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/> - \ No newline at end of file + 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/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..ff608e92 100644 --- a/lib/Tmdb/Api/AbstractApi.php +++ b/lib/Tmdb/Api/AbstractApi.php @@ -42,9 +42,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 +53,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 +61,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 +71,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 +79,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 +90,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 +98,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 +113,7 @@ public function postJson($path, $postBody = null, array $parameters = array(), $ } $response = $this->client->getHttpClient()->postJson($path, $postBody, $parameters, $headers); + return $response->json(); } @@ -117,9 +121,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 +132,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 +140,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 +151,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 +159,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 +170,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..674dbff2 100644 --- a/lib/Tmdb/Api/Account.php +++ b/lib/Tmdb/Api/Account.php @@ -23,8 +23,8 @@ class Account /** * 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 +35,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 +48,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 +61,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 +77,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 +90,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 +103,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..aeeeffdb 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; /** @@ -57,7 +56,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 +64,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."); } diff --git a/lib/Tmdb/Api/Certifications.php b/lib/Tmdb/Api/Certifications.php index 30bff9be..08785722 100644 --- a/lib/Tmdb/Api/Certifications.php +++ b/lib/Tmdb/Api/Certifications.php @@ -25,8 +25,8 @@ class Certifications * * 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..1f356023 100644 --- a/lib/Tmdb/Api/Changes.php +++ b/lib/Tmdb/Api/Changes.php @@ -31,8 +31,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 +51,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..d8b64a52 100644 --- a/lib/Tmdb/Api/Collections.php +++ b/lib/Tmdb/Api/Collections.php @@ -30,8 +30,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 +43,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..5671dc35 100644 --- a/lib/Tmdb/Api/Companies.php +++ b/lib/Tmdb/Api/Companies.php @@ -24,8 +24,8 @@ class Companies * 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 +36,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..7de82e56 100644 --- a/lib/Tmdb/Api/Configuration.php +++ b/lib/Tmdb/Api/Configuration.php @@ -38,7 +38,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..e7e5d547 100644 --- a/lib/Tmdb/Api/Credits.php +++ b/lib/Tmdb/Api/Credits.php @@ -31,8 +31,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..2a437629 100644 --- a/lib/Tmdb/Api/Discover.php +++ b/lib/Tmdb/Api/Discover.php @@ -23,8 +23,8 @@ class Discover /** * 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()) @@ -35,8 +35,8 @@ 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. * - * @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..a3e468aa 100644 --- a/lib/Tmdb/Api/Find.php +++ b/lib/Tmdb/Api/Find.php @@ -29,9 +29,9 @@ class Find * 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..2bf93c38 100644 --- a/lib/Tmdb/Api/Genres.php +++ b/lib/Tmdb/Api/Genres.php @@ -23,9 +23,9 @@ class Genres /** * 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 +42,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 +55,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,13 +65,13 @@ 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) { + foreach ($data as $genre) { if ($id == $genre['id']) return $genre; } diff --git a/lib/Tmdb/Api/Jobs.php b/lib/Tmdb/Api/Jobs.php index 5afed498..242df650 100644 --- a/lib/Tmdb/Api/Jobs.php +++ b/lib/Tmdb/Api/Jobs.php @@ -23,8 +23,8 @@ class Jobs /** * 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..6c2be730 100644 --- a/lib/Tmdb/Api/Keywords.php +++ b/lib/Tmdb/Api/Keywords.php @@ -23,9 +23,9 @@ class Keywords /** * 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 +36,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..7c79b682 100644 --- a/lib/Tmdb/Api/Lists.php +++ b/lib/Tmdb/Api/Lists.php @@ -24,8 +24,8 @@ class Lists * 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 +36,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 +50,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 +68,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 +80,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 +92,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..cdb8aede 100644 --- a/lib/Tmdb/Api/Movies.php +++ b/lib/Tmdb/Api/Movies.php @@ -24,8 +24,8 @@ class Movies * 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 +37,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 +50,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 +63,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 +76,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 +89,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 +102,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 +115,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 +128,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 +141,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 +154,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 +167,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 +179,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()) @@ -191,8 +191,8 @@ 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. * - * @param array $parameters - * @param array $headers + * @param array $parameters + * @param array $headers * @return mixed */ public function getUpcoming(array $parameters = array(), array $headers = array()) @@ -203,8 +203,8 @@ 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. * - * @param array $parameters - * @param array $headers + * @param array $parameters + * @param array $headers * @return mixed */ public function getNowPlaying(array $parameters = array(), array $headers = array()) @@ -215,8 +215,8 @@ public function getNowPlaying(array $parameters = array(), array $headers = arra /** * 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()) @@ -227,8 +227,8 @@ 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. * - * @param array $parameters - * @param array $headers + * @param array $parameters + * @param array $headers * @return mixed */ public function getTopRated(array $parameters = array(), array $headers = array()) diff --git a/lib/Tmdb/Api/Networks.php b/lib/Tmdb/Api/Networks.php index 347aade3..3bb6b981 100644 --- a/lib/Tmdb/Api/Networks.php +++ b/lib/Tmdb/Api/Networks.php @@ -26,9 +26,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..1be1e463 100644 --- a/lib/Tmdb/Api/People.php +++ b/lib/Tmdb/Api/People.php @@ -24,8 +24,8 @@ class People * 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 +37,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 +50,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 +66,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 +82,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 +95,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 +114,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 +127,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 +139,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..e14a9df9 100644 --- a/lib/Tmdb/Api/Reviews.php +++ b/lib/Tmdb/Api/Reviews.php @@ -24,8 +24,8 @@ class Reviews * 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..4e988127 100644 --- a/lib/Tmdb/Api/Search.php +++ b/lib/Tmdb/Api/Search.php @@ -24,8 +24,8 @@ class Search * 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 +39,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 +54,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 +69,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 +84,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 +99,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 +114,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..c8fcf9cc 100644 --- a/lib/Tmdb/Api/Tv.php +++ b/lib/Tmdb/Api/Tv.php @@ -23,9 +23,9 @@ class Tv /** * 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 +38,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 +51,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 +64,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 +76,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 +91,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,9 +105,9 @@ 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()) diff --git a/lib/Tmdb/Api/TvEpisode.php b/lib/Tmdb/Api/TvEpisode.php index 3c09594d..811fc13b 100644 --- a/lib/Tmdb/Api/TvEpisode.php +++ b/lib/Tmdb/Api/TvEpisode.php @@ -26,8 +26,8 @@ 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()) @@ -41,8 +41,8 @@ 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()) @@ -56,8 +56,8 @@ 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()) @@ -71,8 +71,8 @@ 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()) diff --git a/lib/Tmdb/Api/TvSeason.php b/lib/Tmdb/Api/TvSeason.php index cc0e8544..8d6201d3 100644 --- a/lib/Tmdb/Api/TvSeason.php +++ b/lib/Tmdb/Api/TvSeason.php @@ -25,8 +25,8 @@ class TvSeason * * @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 +39,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 +53,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 +67,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..0fa73452 100644 --- a/lib/Tmdb/Client.php +++ b/lib/Tmdb/Client.php @@ -25,7 +25,8 @@ * Client wrapper for TMDB * @package Tmdb */ -class Client { +class Client +{ /** * Base API URI */ @@ -73,8 +74,8 @@ class Client { * 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) { @@ -97,12 +98,13 @@ public function __construct(Token $token, ClientInterface $httpClient = null, $s /** * Add the token subscriber * - * @param Token $token + * @param Token $token * @return $this */ public function setToken(Token $token) { $this->token = $token; + return $this; } @@ -313,12 +315,13 @@ public function getBaseUrl() } /** - * @param boolean $secure + * @param boolean $secure * @return $this */ public function setSecure($secure) { $this->secure = $secure; + return $this; } @@ -331,7 +334,7 @@ public function getSecure() } /** - * @param SessionToken $sessionToken + * @param SessionToken $sessionToken * @return $this */ public function setSessionToken($sessionToken) @@ -342,6 +345,7 @@ public function setSessionToken($sessionToken) } $this->sessionToken = $sessionToken; + return $this; } diff --git a/lib/Tmdb/Common/ObjectHydrator.php b/lib/Tmdb/Common/ObjectHydrator.php index be4c66c6..b462970b 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 */ @@ -47,7 +48,7 @@ public function hydrate(AbstractModel $object, $data = array()) $method, get_class($object) )); - }else{ + } else { $object->$method($v); } } @@ -62,7 +63,7 @@ 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) @@ -78,4 +79,4 @@ public function camelize($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..19bd253a 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,7 +34,7 @@ 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()); @@ -41,7 +42,7 @@ 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 * - * @param array $data + * @param array $data * @param $class * @return GenericCollection */ @@ -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..7184796b 100644 --- a/lib/Tmdb/Factory/CollectionFactory.php +++ b/lib/Tmdb/Factory/CollectionFactory.php @@ -76,7 +76,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 +84,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 +103,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..722af78b 100644 --- a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php +++ b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php @@ -21,9 +21,10 @@ * Class GenericCollectionFactory * @package Tmdb\Factory\Common */ -class GenericCollectionFactory { +class GenericCollectionFactory +{ /** - * @param array $data + * @param array $data * @param $class * @return GenericCollection */ @@ -33,7 +34,7 @@ public function create(array $data = array(), $class) } /** - * @param array $data + * @param array $data * @param $class * @return GenericCollection */ @@ -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..4e4dbfe6 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; /** @@ -89,12 +88,13 @@ public function createCollection(array $data = array()) } /** - * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory + * @param \Tmdb\Factory\TvEpisodeFactory $tvEpisodeFactory * @return $this */ public function setTvEpisodeFactory($tvEpisodeFactory) { $this->tvEpisodeFactory = $tvEpisodeFactory; + return $this; } @@ -107,12 +107,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 +126,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..67fe9ee6 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; } @@ -130,5 +133,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..cb0d3867 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,20 +120,20 @@ 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) { + foreach ($formatCollection as $item) { if (array_key_exists($format, Image::$_formats)) { $item = $this->create($item, $format); @@ -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..52c9980f 100644 --- a/lib/Tmdb/Factory/Lists/ListItemFactory.php +++ b/lib/Tmdb/Factory/Lists/ListItemFactory.php @@ -65,7 +65,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 +73,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..64e677d2 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()) @@ -178,7 +179,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 +189,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 +228,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 +247,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 +266,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 +285,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 +304,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 +323,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 +342,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 +361,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 +378,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..354cb677 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 = array(), 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..8b840b2f 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 */ @@ -103,7 +104,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 +112,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 +131,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 +150,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..8017be63 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 */ @@ -146,7 +147,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 +155,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 +174,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 +193,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 +212,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 +231,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 +250,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..14189045 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 */ @@ -108,7 +109,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 +117,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 +136,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 +155,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 +174,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..25b6bb2f 100644 --- a/lib/Tmdb/HttpClient/HttpClient.php +++ b/lib/Tmdb/HttpClient/HttpClient.php @@ -46,8 +46,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 +171,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 +183,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; } 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..6274036a 100644 --- a/lib/Tmdb/Model/AbstractModel.php +++ b/lib/Tmdb/Model/AbstractModel.php @@ -16,7 +16,8 @@ * Class AbstractModel * @package Tmdb\Model */ -class AbstractModel { +class AbstractModel +{ /** * List of properties to populate by the ObjectHydrator * diff --git a/lib/Tmdb/Model/Account.php b/lib/Tmdb/Model/Account.php index a9334b51..a70fd52a 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 */ @@ -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; } @@ -167,5 +174,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..95bf40b4 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 */ @@ -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..c4d38594 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 */ @@ -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..a0d62c88 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 */ @@ -42,12 +42,13 @@ class CountryCertification extends AbstractModel { ); /** - * @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; } @@ -95,5 +98,4 @@ public function getOrder() return $this->order; } - } diff --git a/lib/Tmdb/Model/Change.php b/lib/Tmdb/Model/Change.php index c3186cce..c161ed66 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 */ @@ -36,12 +37,13 @@ class Change extends AbstractModel { ); /** - * @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..e78ac50c 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 */ @@ -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/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/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..40cfcaec 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,7 +61,7 @@ public function addImage(Image $image) public function filterPosters() { return $this->filter( - function($key, $value) { + function ($key, $value) { if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) { return true; } } ); @@ -74,7 +75,7 @@ function($key, $value) { public function filterBackdrops() { return $this->filter( - function($key, $value) { + function ($key, $value) { if ($value instanceof ImageFilter && $value instanceof Image\BackdropImage) { return true; } } ); @@ -88,7 +89,7 @@ function($key, $value) { public function filterProfile() { return $this->filter( - function($key, $value) { + function ($key, $value) { if ($value instanceof ImageFilter && $value instanceof Image\ProfileImage) { return true; } } ); @@ -102,7 +103,7 @@ function($key, $value) { public function filterStills() { return $this->filter( - function($key, $value) { + function ($key, $value) { if ($value instanceof ImageFilter && $value instanceof Image\StillImage) { return true; } } ); @@ -117,7 +118,7 @@ function($key, $value) { public function filterMaxWidth($width) { return $this->filter( - function($key, $value) use ($width) { + function ($key, $value) use ($width) { if ($value instanceof ImageFilter && $value->getWidth() <= $width && $value->getWidth() !== null) { return true; } } ); @@ -132,7 +133,7 @@ function($key, $value) use ($width) { public function filterMinWidth($width) { return $this->filter( - function($key, $value) use ($width) { + function ($key, $value) use ($width) { if ($value instanceof ImageFilter && $value->getWidth() >= $width && $value->getWidth() !== null) { return true; } } ); @@ -147,7 +148,7 @@ function($key, $value) use ($width) { public function filterMaxHeight($height) { return $this->filter( - function($key, $value) use ($height) { + function ($key, $value) use ($height) { if ($value instanceof ImageFilter && $value->getHeight() <= $height && $value->getHeight() !== null) { return true; } } ); @@ -162,7 +163,7 @@ function($key, $value) use ($height) { public function filterMinHeight($height) { return $this->filter( - function($key, $value) use ($height) { + function ($key, $value) use ($height) { if ($value instanceof ImageFilter && $value->getHeight() >= $height && $value->getHeight() !== null) { return true; } } ); @@ -181,7 +182,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..ee9f3def 100644 --- a/lib/Tmdb/Model/Collection/Jobs.php +++ b/lib/Tmdb/Model/Collection/Jobs.php @@ -18,24 +18,25 @@ * 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) { + function ($key, $value) use ($department) { if ($value->getDepartment() == $department) { return true; } } ); if ($result && 1 === count($result)) { $results = $result->toArray(); + return array_shift($results); } @@ -45,13 +46,13 @@ 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) { + function ($key, $value) use ($department) { if ($value->getDepartment() == $department) { return true; } } ); @@ -69,16 +70,16 @@ 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) { + foreach ($jobList as $job) { if ($filterByJob == $job) { return true; } } } @@ -86,6 +87,7 @@ function($key, $value) use ($filterByJob) { 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/ResultCollection.php b/lib/Tmdb/Model/Collection/ResultCollection.php index aa0acbcc..22e09c0d 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 */ @@ -44,12 +45,13 @@ class ResultCollection extends GenericCollection { ); /** - * @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..069f5408 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 */ @@ -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; } @@ -75,5 +77,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..2a7ab014 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 */ @@ -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; } @@ -123,6 +127,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..353adbd6 100644 --- a/lib/Tmdb/Model/Common/Country.php +++ b/lib/Tmdb/Model/Common/Country.php @@ -19,8 +19,8 @@ * Class Country * @package Tmdb\Model\Common */ -class Country extends AbstractModel implements CountryFilter { - +class Country extends AbstractModel implements CountryFilter +{ private $iso31661; private $name; @@ -30,12 +30,13 @@ class Country extends AbstractModel implements CountryFilter { ); /** - * @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..61d57838 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; @@ -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..16df46be 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,13 +310,13 @@ 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) { + function ($key, $value) use ($id) { if ($value->getId() == $id) { return true; } } ); @@ -330,13 +331,13 @@ 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) { + function ($key, $value) use ($language) { if ($value instanceof LanguageFilter && $value->getIso6391() == $language) { return true; } } ); @@ -345,13 +346,13 @@ 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) { + function ($key, $value) use ($country) { if ($value instanceof CountryFilter && $value->getIso31661() == $country) { return true; } } ); @@ -360,13 +361,13 @@ 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) { + 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..ddb2d3f8 100644 --- a/lib/Tmdb/Model/Common/SpokenLanguage.php +++ b/lib/Tmdb/Model/Common/SpokenLanguage.php @@ -19,8 +19,8 @@ * Class SpokenLanguage * @package Tmdb\Model\Common */ -class SpokenLanguage extends AbstractModel implements LanguageFilter { - +class SpokenLanguage extends AbstractModel implements LanguageFilter +{ private $iso6391; private $name; @@ -30,12 +30,13 @@ class SpokenLanguage extends AbstractModel implements LanguageFilter { ); /** - * @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..ef4faf76 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; @@ -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..c75e52c7 100644 --- a/lib/Tmdb/Model/Common/Translation.php +++ b/lib/Tmdb/Model/Common/Translation.php @@ -18,8 +18,8 @@ * Class Translation * @package Tmdb\Model\Common */ -class Translation extends SpokenLanguage implements LanguageFilter { - +class Translation extends SpokenLanguage implements LanguageFilter +{ private $englishName; public static $_properties = array( @@ -29,12 +29,13 @@ class Translation extends SpokenLanguage implements LanguageFilter { ); /** - * @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..41c26b9c 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; @@ -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..8badb84b 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 */ @@ -34,12 +34,13 @@ class Configuration extends AbstractModel { ); /** - * @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..3b6a6cf4 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 */ @@ -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..c19d0281 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 */ @@ -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..7512f34f 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; } @@ -90,5 +93,4 @@ public function getTvResults() return $this->tvResults; } - } diff --git a/lib/Tmdb/Model/Genre.php b/lib/Tmdb/Model/Genre.php index 44569c02..484ad4fc 100644 --- a/lib/Tmdb/Model/Genre.php +++ b/lib/Tmdb/Model/Genre.php @@ -16,8 +16,8 @@ * Class Genre * @package Tmdb\Model */ -class Genre extends AbstractModel { - +class Genre extends AbstractModel +{ private $id; private $name; @@ -27,12 +27,13 @@ class Genre extends AbstractModel { ); /** - * @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..b1237257 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'; @@ -70,12 +70,13 @@ public static function getTypeFromCollectionName($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/Job.php b/lib/Tmdb/Model/Job.php index c7876538..310e37fb 100644 --- a/lib/Tmdb/Model/Job.php +++ b/lib/Tmdb/Model/Job.php @@ -16,8 +16,8 @@ * Class Job * @package Tmdb\Model */ -class Job extends AbstractModel { - +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..f6fb0323 100644 --- a/lib/Tmdb/Model/Keyword.php +++ b/lib/Tmdb/Model/Keyword.php @@ -16,8 +16,8 @@ * Class Keyword * @package Tmdb\Model */ -class Keyword extends AbstractModel { - +class Keyword extends AbstractModel +{ private $id; private $name; @@ -27,12 +27,13 @@ class Keyword extends AbstractModel { ); /** - * @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..8047e44a 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 */ @@ -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..79f5a614 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 */ @@ -38,12 +39,13 @@ class ItemStatus extends AbstractModel { ); /** - * @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..8591a93e 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 */ @@ -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..35a7ee71 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 */ @@ -38,12 +39,13 @@ class Result extends AbstractModel { ); /** - * @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..113f6dd5 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 */ @@ -32,12 +33,13 @@ class ResultWithListId extends Result { ); /** - * @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..73151b03 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 */ @@ -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..d48b4e1b 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 */ @@ -47,12 +47,13 @@ class AccountStates extends AbstractModel { ); /** - * @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..4dbb0acf 100644 --- a/lib/Tmdb/Model/Movie/AlternativeTitle.php +++ b/lib/Tmdb/Model/Movie/AlternativeTitle.php @@ -19,8 +19,8 @@ * Class AlternativeTitle * @package Tmdb\Model\Movie */ -class AlternativeTitle extends AbstractModel implements CountryFilter { - +class AlternativeTitle extends AbstractModel implements CountryFilter +{ private $iso31661; private $title; @@ -30,12 +30,13 @@ class AlternativeTitle extends AbstractModel implements CountryFilter { ); /** - * @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..79e09680 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 */ @@ -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; } @@ -215,5 +223,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..75e60e9b 100644 --- a/lib/Tmdb/Model/Movie/Rating.php +++ b/lib/Tmdb/Model/Movie/Rating.php @@ -18,8 +18,8 @@ * Class Rating * @package Tmdb\Model\Movie */ -class Rating extends AbstractModel { - +class Rating extends AbstractModel +{ /** * @var float */ @@ -30,12 +30,13 @@ class Rating extends AbstractModel { ); /** - * @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..28bbd902 100644 --- a/lib/Tmdb/Model/Movie/Release.php +++ b/lib/Tmdb/Model/Movie/Release.php @@ -19,8 +19,8 @@ * Class Release * @package Tmdb\Model\Movie */ -class Release extends AbstractModel implements CountryFilter { - +class Release extends AbstractModel implements CountryFilter +{ private $iso31661; private $certification; private $releaseDate; @@ -32,12 +32,13 @@ class Release extends AbstractModel implements CountryFilter { ); /** - * @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..cae40ecf 100644 --- a/lib/Tmdb/Model/Network.php +++ b/lib/Tmdb/Model/Network.php @@ -16,8 +16,8 @@ * Class Network * @package Tmdb\Model */ -class Network extends AbstractModel { - +class Network extends AbstractModel +{ private $id; private $name; @@ -27,12 +27,13 @@ class Network extends AbstractModel { ); /** - * @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..9aee9981 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 */ @@ -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..f6726820 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 */ @@ -48,12 +48,13 @@ abstract class AbstractMember extends AbstractModel { ); /** - * @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..78d41d13 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 */ @@ -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..fc0bf915 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 */ @@ -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..8c97815d 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 */ @@ -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; } @@ -243,5 +252,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..0ab1369b 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) @@ -48,7 +49,7 @@ public function language($language) /** * 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 +62,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) @@ -74,7 +75,7 @@ public function includeAdult($allow = true) /** * 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) @@ -91,7 +92,7 @@ public function year($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) @@ -108,7 +109,7 @@ 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. * - * @param integer $count + * @param integer $count * @return $this */ public function voteCountGte($count) @@ -121,7 +122,7 @@ 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. * - * @param float $average + * @param float $average * @return $this */ public function voteAverageGte($average) @@ -139,7 +140,7 @@ public function voteAverageGte($average) * * 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 +157,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 +170,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 +183,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 +200,7 @@ public function releaseDateGte($date) /** * The maximum release to include. * - * @param \DateTime $date + * @param \DateTime $date * @return $this */ public function releaseDateLte(\DateTime $date) @@ -218,7 +219,7 @@ public function releaseDateLte(\DateTime $date) * * 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 +234,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 +250,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 +267,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..46660b35 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) @@ -48,7 +49,7 @@ 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 * - * @param string $option + * @param string $option * @return $this */ public function sortBy($option) @@ -61,7 +62,7 @@ public function sortBy($option) /** * 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) @@ -78,7 +79,7 @@ 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. * - * @param integer $count + * @param integer $count * @return $this */ public function voteCountGte($count) @@ -91,7 +92,7 @@ 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. * - * @param float $average + * @param float $average * @return $this */ public function voteAverageGte($average) @@ -107,7 +108,7 @@ public function voteAverageGte($average) * Multiple values can be specified. * Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'. * - * @param array|string $genres + * @param array|string $genres * @return $this */ public function withGenres($genres) @@ -124,7 +125,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 +138,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 +151,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 +168,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,7 +182,6 @@ public function firstAirDateLte($date) return $this; } - /** * Filter TV shows to include a specific network. * @@ -190,7 +190,7 @@ public function firstAirDateLte($date) * 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 +207,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..44371245 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; @@ -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; } @@ -182,5 +190,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/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..1bec3145 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 */ @@ -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..4815ca1d 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 * @@ -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..0bbe1180 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 */ @@ -43,12 +43,13 @@ class Network extends AbstractModel { ); /** - * @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..166ac925 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 */ @@ -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..8085d79a 100644 --- a/lib/Tmdb/Repository/AccountRepository.php +++ b/lib/Tmdb/Repository/AccountRepository.php @@ -21,8 +21,8 @@ * @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. * @@ -31,44 +31,46 @@ class AccountRepository extends AbstractRepository { 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 +80,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 +129,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..ed075b0b 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); } @@ -65,13 +67,14 @@ public function getSessionToken(RequestToken $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..31d979af 100644 --- a/lib/Tmdb/Repository/CertificationRepository.php +++ b/lib/Tmdb/Repository/CertificationRepository.php @@ -13,15 +13,14 @@ 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. * @@ -34,6 +33,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..4079f5ad 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) @@ -55,6 +55,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 +94,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..3d20825f 100644 --- a/lib/Tmdb/Repository/DiscoverRepository.php +++ b/lib/Tmdb/Repository/DiscoverRepository.php @@ -26,16 +26,18 @@ * @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. * - * @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)) { @@ -50,12 +52,13 @@ 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. * - * @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 +80,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..9cf26910 100644 --- a/lib/Tmdb/Repository/FindRepository.php +++ b/lib/Tmdb/Repository/FindRepository.php @@ -20,16 +20,18 @@ * @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) ); @@ -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..3a8bdff2 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()) @@ -52,11 +54,12 @@ 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. * * @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 +72,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 +94,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..b3a6784b 100644 --- a/lib/Tmdb/Repository/KeywordRepository.php +++ b/lib/Tmdb/Repository/KeywordRepository.php @@ -21,16 +21,18 @@ * @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) ); @@ -40,11 +42,12 @@ public function load($id, array $parameters = array(), array $headers = array()) * 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 +71,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..04abcc40 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()) @@ -71,8 +73,8 @@ 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. * - * @param string $id - * @param int $mediaId + * @param string $id + * @param int $mediaId * @return ItemStatus */ public function add($id, $mediaId) @@ -85,8 +87,8 @@ public function add($id, $mediaId) /** * 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) @@ -99,7 +101,7 @@ public function remove($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 ItemStatus */ public function deleteList($id) @@ -126,4 +128,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..e733490e 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 */ @@ -260,11 +260,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()) @@ -277,7 +276,7 @@ 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. * - * @param array $options + * @param array $options * @return Movie[] */ public function getUpcoming(array $options = array()) @@ -290,7 +289,7 @@ 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. * - * @param array $options + * @param array $options * @return Movie[] */ public function getNowPlaying(array $options = array()) @@ -303,7 +302,7 @@ public function getNowPlaying(array $options = array()) /** * 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()) @@ -316,7 +315,7 @@ 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. * - * @param array $options + * @param array $options * @return Movie[] */ public function getTopRated(array $options = array()) @@ -329,7 +328,7 @@ 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. * - * @param integer $id + * @param integer $id * @return Movie[] */ public function getAccountStates($id) @@ -342,8 +341,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 +378,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 +403,13 @@ public function getAlternativeTitleFactory() } /** - * @param mixed $imageFactory + * @param mixed $imageFactory * @return $this */ public function setImageFactory($imageFactory) { $this->imageFactory = $imageFactory; + return $this; } @@ -420,12 +422,13 @@ public function getImageFactory() } /** - * @param mixed $peopleFactory + * @param mixed $peopleFactory * @return $this */ public function setPeopleFactory($peopleFactory) { $this->peopleFactory = $peopleFactory; + return $this; } @@ -437,5 +440,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..648bb716 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); } @@ -144,8 +146,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 +163,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 +182,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..d573a7b0 100644 --- a/lib/Tmdb/Repository/TvEpisodeRepository.php +++ b/lib/Tmdb/Repository/TvEpisodeRepository.php @@ -24,8 +24,8 @@ * @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 * @@ -157,13 +157,13 @@ 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); $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..8277fea7 100644 --- a/lib/Tmdb/Repository/TvRepository.php +++ b/lib/Tmdb/Repository/TvRepository.php @@ -21,14 +21,14 @@ * @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 * - * @param integer $id + * @param integer $id * @param $parameters * @param $headers * @return null|\Tmdb\Model\AbstractModel @@ -141,7 +141,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()) @@ -154,7 +154,7 @@ 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. * - * @param array $options + * @param array $options * @return Tv[] */ public function getTopRated(array $options = array()) @@ -167,7 +167,7 @@ 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. * - * @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/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/Common/ObjectHydratorTest.php b/test/Tmdb/Tests/Common/ObjectHydratorTest.php index e6c84177..2de27930 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'); /** - * @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 { +class FailingTestModel extends \Tmdb\Model\AbstractModel +{ static $_properties = array('lastname'); -} \ No newline at end of file +} 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..b19296f0 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 { - +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/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..c7ddef32 100644 --- a/test/Tmdb/Tests/Model/Collection/KeywordsTest.php +++ b/test/Tmdb/Tests/Model/Collection/KeywordsTest.php @@ -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..e0637429 100644 --- a/test/Tmdb/Tests/Model/Collection/PeopleTest.php +++ b/test/Tmdb/Tests/Model/Collection/PeopleTest.php @@ -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..41446cae 100644 --- a/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php +++ b/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php @@ -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..297e1d42 100644 --- a/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php +++ b/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php @@ -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/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; From 1e5a7b7e29d30d01abd25e8b8f4ba864b929f6bf Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Fri, 28 Feb 2014 23:24:25 +0100 Subject: [PATCH 06/12] PSR-0 compatibility --- test/Tmdb/Tests/ApiTokenTest.php | 2 ++ test/Tmdb/Tests/ClientTest.php | 2 ++ test/Tmdb/Tests/Helper/ImageHelperTest.php | 1 + test/Tmdb/Tests/Model/Collection/KeywordsTest.php | 2 +- test/Tmdb/Tests/Model/Collection/PeopleTest.php | 2 +- .../Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php | 2 +- test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php | 2 +- test/Tmdb/Tests/RequestTokenTest.php | 2 ++ test/Tmdb/Tests/SessionTokenTest.php | 2 ++ 9 files changed, 13 insertions(+), 4 deletions(-) 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..e9b877d3 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'; 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/Model/Collection/KeywordsTest.php b/test/Tmdb/Tests/Model/Collection/KeywordsTest.php index c7ddef32..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; diff --git a/test/Tmdb/Tests/Model/Collection/PeopleTest.php b/test/Tmdb/Tests/Model/Collection/PeopleTest.php index e0637429..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; diff --git a/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php b/test/Tmdb/Tests/Model/Query/Discover/DiscoverMoviesQueryTest.php index 41446cae..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; diff --git a/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php b/test/Tmdb/Tests/Model/Query/Discover/DiscoverTvQueryTest.php index 297e1d42..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; 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'; From 2c19c97c707d96fae9e8102c4b10bbb712a48b62 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 01:00:43 +0100 Subject: [PATCH 07/12] PSR compliance. --- lib/Tmdb/Api/AbstractApi.php | 3 +- lib/Tmdb/Api/Account.php | 3 +- lib/Tmdb/Api/Authentication.php | 6 +- lib/Tmdb/Api/Certifications.php | 6 +- lib/Tmdb/Api/Changes.php | 3 +- lib/Tmdb/Api/Collections.php | 3 +- lib/Tmdb/Api/Companies.php | 3 +- lib/Tmdb/Api/Configuration.php | 3 +- lib/Tmdb/Api/Credits.php | 10 ++- lib/Tmdb/Api/Discover.php | 6 +- lib/Tmdb/Api/Find.php | 9 +- lib/Tmdb/Api/Genres.php | 6 +- lib/Tmdb/Api/Jobs.php | 3 +- lib/Tmdb/Api/Keywords.php | 3 +- lib/Tmdb/Api/Lists.php | 3 +- lib/Tmdb/Api/Movies.php | 18 ++-- lib/Tmdb/Api/Networks.php | 3 +- lib/Tmdb/Api/People.php | 3 +- lib/Tmdb/Api/Reviews.php | 3 +- lib/Tmdb/Api/Search.php | 3 +- lib/Tmdb/Api/Tv.php | 4 +- lib/Tmdb/Api/TvEpisode.php | 83 +++++++++++++++---- lib/Tmdb/Api/TvSeason.php | 3 +- lib/Tmdb/Common/ObjectHydrator.php | 15 ++-- lib/Tmdb/Factory/AbstractFactory.php | 4 +- lib/Tmdb/Factory/CollectionFactory.php | 12 ++- .../Common/GenericCollectionFactory.php | 4 +- lib/Tmdb/Factory/CreditsFactory.php | 5 +- lib/Tmdb/Factory/FindFactory.php | 1 - lib/Tmdb/Factory/ImageFactory.php | 2 +- lib/Tmdb/Factory/Lists/ListItemFactory.php | 8 +- lib/Tmdb/Factory/MovieFactory.php | 10 ++- lib/Tmdb/Factory/PeopleFactory.php | 2 +- lib/Tmdb/Factory/TvEpisodeFactory.php | 19 +++-- lib/Tmdb/Factory/TvFactory.php | 30 +++++-- lib/Tmdb/Factory/TvSeasonFactory.php | 14 +++- lib/Tmdb/HttpClient/HttpClient.php | 3 +- lib/Tmdb/Model/AbstractModel.php | 3 +- lib/Tmdb/Model/Account.php | 3 +- lib/Tmdb/Model/Account/ListItem.php | 2 +- lib/Tmdb/Model/Certification.php | 2 +- .../Certification/CountryCertification.php | 3 +- lib/Tmdb/Model/Change.php | 2 +- lib/Tmdb/Model/Collection.php | 2 +- lib/Tmdb/Model/Collection/Changes.php | 4 +- .../CreditsCollection/CombinedCredits.php | 4 +- .../CreditsCollection/MovieCredits.php | 4 +- .../CreditsCollection/TvCredits.php | 4 +- lib/Tmdb/Model/Collection/Images.php | 36 ++++++-- lib/Tmdb/Model/Collection/Jobs.php | 12 ++- .../Collection/QueryParametersCollection.php | 4 +- .../Model/Collection/ResultCollection.php | 2 +- lib/Tmdb/Model/Common/Change.php | 3 +- lib/Tmdb/Model/Common/Change/Item.php | 3 +- lib/Tmdb/Model/Common/Country.php | 2 +- lib/Tmdb/Model/Common/ExternalIds.php | 2 +- lib/Tmdb/Model/Common/GenericCollection.php | 16 +++- lib/Tmdb/Model/Common/SpokenLanguage.php | 2 +- lib/Tmdb/Model/Common/Trailer/Youtube.php | 2 +- lib/Tmdb/Model/Common/Translation.php | 2 +- lib/Tmdb/Model/Company.php | 2 +- lib/Tmdb/Model/Configuration.php | 2 +- lib/Tmdb/Model/Credits.php | 2 +- lib/Tmdb/Model/Credits/Media.php | 2 +- lib/Tmdb/Model/Find.php | 1 - lib/Tmdb/Model/Genre.php | 2 +- lib/Tmdb/Model/Image.php | 8 +- lib/Tmdb/Model/Image/BackdropImage.php | 4 +- lib/Tmdb/Model/Image/LogoImage.php | 4 +- lib/Tmdb/Model/Image/PosterImage.php | 4 +- lib/Tmdb/Model/Image/ProfileImage.php | 4 +- lib/Tmdb/Model/Image/StillImage.php | 4 +- lib/Tmdb/Model/Job.php | 2 +- lib/Tmdb/Model/Keyword.php | 2 +- lib/Tmdb/Model/Lists.php | 2 +- lib/Tmdb/Model/Lists/ItemStatus.php | 2 +- lib/Tmdb/Model/Lists/ListItem.php | 2 +- lib/Tmdb/Model/Lists/Result.php | 2 +- lib/Tmdb/Model/Lists/ResultWithListId.php | 2 +- lib/Tmdb/Model/Movie.php | 2 +- lib/Tmdb/Model/Movie/AccountStates.php | 2 +- lib/Tmdb/Model/Movie/AlternativeTitle.php | 2 +- lib/Tmdb/Model/Movie/ListItem.php | 3 +- lib/Tmdb/Model/Movie/Rating.php | 2 +- lib/Tmdb/Model/Movie/Release.php | 2 +- lib/Tmdb/Model/Network.php | 2 +- lib/Tmdb/Model/Person.php | 2 +- lib/Tmdb/Model/Person/AbstractMember.php | 2 +- lib/Tmdb/Model/Person/CastMember.php | 2 +- lib/Tmdb/Model/Person/CrewMember.php | 2 +- lib/Tmdb/Model/Person/MovieCredit.php | 3 +- .../Query/Discover/DiscoverMoviesQuery.php | 22 +++-- .../Model/Query/Discover/DiscoverTvQuery.php | 22 +++-- lib/Tmdb/Model/Review.php | 3 +- .../Search/SearchQuery/CompanySearchQuery.php | 4 +- .../Search/SearchQuery/KeywordSearchQuery.php | 4 +- lib/Tmdb/Model/Tv.php | 2 +- lib/Tmdb/Model/Tv/Episode.php | 2 +- lib/Tmdb/Model/Tv/Network.php | 2 +- lib/Tmdb/Model/Tv/Season.php | 2 +- lib/Tmdb/Repository/AccountRepository.php | 3 +- .../Repository/AuthenticationRepository.php | 11 ++- .../Repository/CertificationRepository.php | 3 +- lib/Tmdb/Repository/CollectionRepository.php | 3 +- lib/Tmdb/Repository/DiscoverRepository.php | 10 ++- lib/Tmdb/Repository/FindRepository.php | 2 +- lib/Tmdb/Repository/GenreRepository.php | 3 +- lib/Tmdb/Repository/KeywordRepository.php | 3 +- lib/Tmdb/Repository/ListRepository.php | 9 +- lib/Tmdb/Repository/MovieRepository.php | 21 +++-- lib/Tmdb/Repository/PeopleRepository.php | 8 +- lib/Tmdb/Repository/TvEpisodeRepository.php | 38 +++++++-- lib/Tmdb/Repository/TvRepository.php | 9 +- test/Tmdb/Tests/Common/ObjectHydratorTest.php | 4 +- .../Movie/GenericCollectionFactoryTest.php | 2 +- 115 files changed, 468 insertions(+), 241 deletions(-) diff --git a/lib/Tmdb/Api/AbstractApi.php b/lib/Tmdb/Api/AbstractApi.php index ff608e92..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 diff --git a/lib/Tmdb/Api/Account.php b/lib/Tmdb/Api/Account.php index 674dbff2..80282464 100644 --- a/lib/Tmdb/Api/Account.php +++ b/lib/Tmdb/Api/Account.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Api/Authentication.php b/lib/Tmdb/Api/Authentication.php index aeeeffdb..a28862c9 100644 --- a/lib/Tmdb/Api/Authentication.php +++ b/lib/Tmdb/Api/Authentication.php @@ -19,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'; @@ -78,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 08785722..6c676ed6 100644 --- a/lib/Tmdb/Api/Certifications.php +++ b/lib/Tmdb/Api/Certifications.php @@ -17,13 +17,13 @@ * @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 diff --git a/lib/Tmdb/Api/Changes.php b/lib/Tmdb/Api/Changes.php index 1f356023..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. diff --git a/lib/Tmdb/Api/Collections.php b/lib/Tmdb/Api/Collections.php index d8b64a52..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. diff --git a/lib/Tmdb/Api/Companies.php b/lib/Tmdb/Api/Companies.php index 5671dc35..738ebcc1 100644 --- a/lib/Tmdb/Api/Companies.php +++ b/lib/Tmdb/Api/Companies.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Api/Configuration.php b/lib/Tmdb/Api/Configuration.php index 7de82e56..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. diff --git a/lib/Tmdb/Api/Credits.php b/lib/Tmdb/Api/Credits.php index e7e5d547..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. diff --git a/lib/Tmdb/Api/Discover.php b/lib/Tmdb/Api/Discover.php index 2a437629..f822e794 100644 --- a/lib/Tmdb/Api/Discover.php +++ b/lib/Tmdb/Api/Discover.php @@ -17,8 +17,7 @@ * @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. @@ -33,7 +32,8 @@ 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 diff --git a/lib/Tmdb/Api/Find.php b/lib/Tmdb/Api/Find.php index a3e468aa..74913c5f 100644 --- a/lib/Tmdb/Api/Find.php +++ b/lib/Tmdb/Api/Find.php @@ -17,12 +17,15 @@ * @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 diff --git a/lib/Tmdb/Api/Genres.php b/lib/Tmdb/Api/Genres.php index 2bf93c38..00d88d5a 100644 --- a/lib/Tmdb/Api/Genres.php +++ b/lib/Tmdb/Api/Genres.php @@ -17,8 +17,7 @@ * @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 @@ -72,8 +71,9 @@ public function getMovies($genre_id, array $parameters = array(), array $headers private function extractGenreByIdFromResponse($id, array $data = array()) { foreach ($data as $genre) { - if ($id == $genre['id']) + if ($id == $genre['id']) { return $genre; + } } return null; diff --git a/lib/Tmdb/Api/Jobs.php b/lib/Tmdb/Api/Jobs.php index 242df650..7341b1ee 100644 --- a/lib/Tmdb/Api/Jobs.php +++ b/lib/Tmdb/Api/Jobs.php @@ -17,8 +17,7 @@ * @package Tmdb\Api * @see http://docs.themoviedb.apiary.io/#jobs */ -class Jobs - extends AbstractApi +class Jobs extends AbstractApi { /** * Get a list of valid jobs. diff --git a/lib/Tmdb/Api/Keywords.php b/lib/Tmdb/Api/Keywords.php index 6c2be730..e47a41b0 100644 --- a/lib/Tmdb/Api/Keywords.php +++ b/lib/Tmdb/Api/Keywords.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Api/Lists.php b/lib/Tmdb/Api/Lists.php index 7c79b682..c4838f7e 100644 --- a/lib/Tmdb/Api/Lists.php +++ b/lib/Tmdb/Api/Lists.php @@ -17,8 +17,7 @@ * @package Tmdb\Api * @see http://docs.themoviedb.apiary.io/#lists */ -class Lists - extends AbstractApi +class Lists extends AbstractApi { /** * Get a list by id. diff --git a/lib/Tmdb/Api/Movies.php b/lib/Tmdb/Api/Movies.php index cdb8aede..38390d94 100644 --- a/lib/Tmdb/Api/Movies.php +++ b/lib/Tmdb/Api/Movies.php @@ -17,8 +17,7 @@ * @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. @@ -189,7 +188,8 @@ 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 @@ -201,7 +201,8 @@ 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 @@ -213,7 +214,8 @@ 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 @@ -225,7 +227,8 @@ 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 @@ -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 3bb6b981..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. diff --git a/lib/Tmdb/Api/People.php b/lib/Tmdb/Api/People.php index 1be1e463..cd379813 100644 --- a/lib/Tmdb/Api/People.php +++ b/lib/Tmdb/Api/People.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Api/Reviews.php b/lib/Tmdb/Api/Reviews.php index e14a9df9..2d630b16 100644 --- a/lib/Tmdb/Api/Reviews.php +++ b/lib/Tmdb/Api/Reviews.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Api/Search.php b/lib/Tmdb/Api/Search.php index 4e988127..8e5f1f1b 100644 --- a/lib/Tmdb/Api/Search.php +++ b/lib/Tmdb/Api/Search.php @@ -17,8 +17,7 @@ * @package Tmdb\Api * @see http://docs.themoviedb.apiary.io/#search */ -class Search - extends AbstractApi +class Search extends AbstractApi { /** * Search for movies by title. diff --git a/lib/Tmdb/Api/Tv.php b/lib/Tmdb/Api/Tv.php index c8fcf9cc..c0a91214 100644 --- a/lib/Tmdb/Api/Tv.php +++ b/lib/Tmdb/Api/Tv.php @@ -17,8 +17,7 @@ * @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. @@ -114,5 +113,4 @@ public function getTranslations($tvshow_id, array $parameters = array(), array $ { $this->get('tv/' . $tvshow_id . '/translations', $parameters, $headers); } - } diff --git a/lib/Tmdb/Api/TvEpisode.php b/lib/Tmdb/Api/TvEpisode.php index 811fc13b..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. @@ -30,9 +29,23 @@ class TvEpisode * @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 + ); } /** @@ -45,9 +58,23 @@ public function getEpisode($tvshow_id, $season_number, $episode_number, array $p * @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 + ); } /** @@ -60,9 +87,23 @@ public function getCredits($tvshow_id, $season_number, $episode_number, array $p * @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 + ); } /** @@ -75,8 +116,22 @@ public function getExternalIds($tvshow_id, $season_number, $episode_number, arra * @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 8d6201d3..b4785359 100644 --- a/lib/Tmdb/Api/TvSeason.php +++ b/lib/Tmdb/Api/TvSeason.php @@ -17,8 +17,7 @@ * @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. diff --git a/lib/Tmdb/Common/ObjectHydrator.php b/lib/Tmdb/Common/ObjectHydrator.php index b462970b..979437ae 100644 --- a/lib/Tmdb/Common/ObjectHydrator.php +++ b/lib/Tmdb/Common/ObjectHydrator.php @@ -36,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) @@ -69,10 +69,15 @@ public function hydrate(AbstractModel $object, $data = array()) public function camelize($candidate) { return lcfirst( - implode('', - array_map('ucfirst', - array_map('strtolower', - explode('_', $candidate + implode( + '', + array_map( + 'ucfirst', + array_map( + 'strtolower', + explode( + '_', + $candidate ) ) ) diff --git a/lib/Tmdb/Factory/AbstractFactory.php b/lib/Tmdb/Factory/AbstractFactory.php index 19bd253a..d6a8623e 100644 --- a/lib/Tmdb/Factory/AbstractFactory.php +++ b/lib/Tmdb/Factory/AbstractFactory.php @@ -40,13 +40,13 @@ abstract public function create(array $data = array()); 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 $class * @return GenericCollection */ - protected function createGenericCollection(array $data = array(), $class) + protected function createGenericCollection(array $data, $class) { if (is_object($class)) { $class = get_class($class); diff --git a/lib/Tmdb/Factory/CollectionFactory.php b/lib/Tmdb/Factory/CollectionFactory.php index 7184796b..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); diff --git a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php index 722af78b..38fe2d67 100644 --- a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php +++ b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php @@ -28,7 +28,7 @@ class GenericCollectionFactory * @param $class * @return GenericCollection */ - public function create(array $data = array(), $class) + public function create(array $data, $class) { return $this->createCollection($data, $class); } @@ -38,7 +38,7 @@ public function create(array $data = array(), $class) * @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); diff --git a/lib/Tmdb/Factory/CreditsFactory.php b/lib/Tmdb/Factory/CreditsFactory.php index 4e4dbfe6..ac6c129d 100644 --- a/lib/Tmdb/Factory/CreditsFactory.php +++ b/lib/Tmdb/Factory/CreditsFactory.php @@ -84,7 +84,10 @@ 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.' + ); } /** diff --git a/lib/Tmdb/Factory/FindFactory.php b/lib/Tmdb/Factory/FindFactory.php index 67fe9ee6..dd6fb3d9 100644 --- a/lib/Tmdb/Factory/FindFactory.php +++ b/lib/Tmdb/Factory/FindFactory.php @@ -132,5 +132,4 @@ public function getTvFactory() { return $this->tvFactory; } - } diff --git a/lib/Tmdb/Factory/ImageFactory.php b/lib/Tmdb/Factory/ImageFactory.php index cb0d3867..3d38d7fc 100644 --- a/lib/Tmdb/Factory/ImageFactory.php +++ b/lib/Tmdb/Factory/ImageFactory.php @@ -134,7 +134,7 @@ public function createImageCollection(array $data = array()) } foreach ($formatCollection as $item) { - if (array_key_exists($format, Image::$_formats)) { + if (array_key_exists($format, Image::$formats)) { $item = $this->create($item, $format); $collection->addImage($item); diff --git a/lib/Tmdb/Factory/Lists/ListItemFactory.php b/lib/Tmdb/Factory/Lists/ListItemFactory.php index 52c9980f..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); diff --git a/lib/Tmdb/Factory/MovieFactory.php b/lib/Tmdb/Factory/MovieFactory.php index 64e677d2..8e4429d1 100644 --- a/lib/Tmdb/Factory/MovieFactory.php +++ b/lib/Tmdb/Factory/MovieFactory.php @@ -139,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)) { diff --git a/lib/Tmdb/Factory/PeopleFactory.php b/lib/Tmdb/Factory/PeopleFactory.php index 354cb677..91a04f44 100644 --- a/lib/Tmdb/Factory/PeopleFactory.php +++ b/lib/Tmdb/Factory/PeopleFactory.php @@ -101,7 +101,7 @@ public function create(array $data = array(), $person = null) * @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'); diff --git a/lib/Tmdb/Factory/TvEpisodeFactory.php b/lib/Tmdb/Factory/TvEpisodeFactory.php index 8b840b2f..e8ce8481 100644 --- a/lib/Tmdb/Factory/TvEpisodeFactory.php +++ b/lib/Tmdb/Factory/TvEpisodeFactory.php @@ -64,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() + ) ); } } diff --git a/lib/Tmdb/Factory/TvFactory.php b/lib/Tmdb/Factory/TvFactory.php index 8017be63..1ad6c7e0 100644 --- a/lib/Tmdb/Factory/TvFactory.php +++ b/lib/Tmdb/Factory/TvFactory.php @@ -85,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() + ) + ); } } @@ -107,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 */ diff --git a/lib/Tmdb/Factory/TvSeasonFactory.php b/lib/Tmdb/Factory/TvSeasonFactory.php index 14189045..f3598a03 100644 --- a/lib/Tmdb/Factory/TvSeasonFactory.php +++ b/lib/Tmdb/Factory/TvSeasonFactory.php @@ -70,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() + ) + ); } } diff --git a/lib/Tmdb/HttpClient/HttpClient.php b/lib/Tmdb/HttpClient/HttpClient.php index 25b6bb2f..5792ab36 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 diff --git a/lib/Tmdb/Model/AbstractModel.php b/lib/Tmdb/Model/AbstractModel.php index 6274036a..6e561600 100644 --- a/lib/Tmdb/Model/AbstractModel.php +++ b/lib/Tmdb/Model/AbstractModel.php @@ -23,6 +23,5 @@ class AbstractModel * * @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 a70fd52a..feef5e10 100644 --- a/lib/Tmdb/Model/Account.php +++ b/lib/Tmdb/Model/Account.php @@ -51,7 +51,7 @@ class Account extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'id', 'include_adult', 'iso_3166_1', @@ -173,5 +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 95bf40b4..e9b1c989 100644 --- a/lib/Tmdb/Model/Account/ListItem.php +++ b/lib/Tmdb/Model/Account/ListItem.php @@ -69,7 +69,7 @@ class ListItem extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'description', 'favorite_count', 'id', diff --git a/lib/Tmdb/Model/Certification.php b/lib/Tmdb/Model/Certification.php index c4d38594..36e2e429 100644 --- a/lib/Tmdb/Model/Certification.php +++ b/lib/Tmdb/Model/Certification.php @@ -30,7 +30,7 @@ class Certification extends AbstractModel */ private $certifications; - public static $_properties = array( + public static $properties = array( 'country', ); diff --git a/lib/Tmdb/Model/Certification/CountryCertification.php b/lib/Tmdb/Model/Certification/CountryCertification.php index a0d62c88..24e73655 100644 --- a/lib/Tmdb/Model/Certification/CountryCertification.php +++ b/lib/Tmdb/Model/Certification/CountryCertification.php @@ -35,7 +35,7 @@ class CountryCertification extends AbstractModel */ private $order; - public static $_properties = array( + public static $properties = array( 'certification', 'meaning', 'order', @@ -97,5 +97,4 @@ public function getOrder() { return $this->order; } - } diff --git a/lib/Tmdb/Model/Change.php b/lib/Tmdb/Model/Change.php index c161ed66..8e670b37 100644 --- a/lib/Tmdb/Model/Change.php +++ b/lib/Tmdb/Model/Change.php @@ -31,7 +31,7 @@ class Change extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'id', 'adult' ); diff --git a/lib/Tmdb/Model/Collection.php b/lib/Tmdb/Model/Collection.php index e78ac50c..bece1f07 100644 --- a/lib/Tmdb/Model/Collection.php +++ b/lib/Tmdb/Model/Collection.php @@ -68,7 +68,7 @@ class Collection extends AbstractModel */ private $poster; - public static $_properties = array( + public static $properties = array( 'backdrop_path', 'id', 'name', 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/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/Images.php b/lib/Tmdb/Model/Collection/Images.php index 40cfcaec..7163afde 100644 --- a/lib/Tmdb/Model/Collection/Images.php +++ b/lib/Tmdb/Model/Collection/Images.php @@ -62,7 +62,9 @@ public function filterPosters() { return $this->filter( function ($key, $value) { - if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) { return true; } + if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) { + return true; + } } ); } @@ -76,7 +78,9 @@ public function filterBackdrops() { return $this->filter( function ($key, $value) { - if ($value instanceof ImageFilter && $value instanceof Image\BackdropImage) { return true; } + if ($value instanceof ImageFilter && $value instanceof Image\BackdropImage) { + return true; + } } ); } @@ -90,7 +94,9 @@ public function filterProfile() { return $this->filter( function ($key, $value) { - if ($value instanceof ImageFilter && $value instanceof Image\ProfileImage) { return true; } + if ($value instanceof ImageFilter && $value instanceof Image\ProfileImage) { + return true; + } } ); } @@ -104,7 +110,9 @@ public function filterStills() { return $this->filter( function ($key, $value) { - if ($value instanceof ImageFilter && $value instanceof Image\StillImage) { return true; } + if ($value instanceof ImageFilter && $value instanceof Image\StillImage) { + return true; + } } ); } @@ -119,7 +127,9 @@ public function filterMaxWidth($width) { return $this->filter( function ($key, $value) use ($width) { - if ($value instanceof ImageFilter && $value->getWidth() <= $width && $value->getWidth() !== null) { return true; } + if ($value instanceof ImageFilter && $value->getWidth() <= $width && $value->getWidth() !== null) { + return true; + } } ); } @@ -134,7 +144,9 @@ public function filterMinWidth($width) { return $this->filter( function ($key, $value) use ($width) { - if ($value instanceof ImageFilter && $value->getWidth() >= $width && $value->getWidth() !== null) { return true; } + if ($value instanceof ImageFilter && $value->getWidth() >= $width && $value->getWidth() !== null) { + return true; + } } ); } @@ -149,7 +161,11 @@ public function filterMaxHeight($height) { return $this->filter( function ($key, $value) use ($height) { - if ($value instanceof ImageFilter && $value->getHeight() <= $height && $value->getHeight() !== null) { return true; } + if ($value instanceof ImageFilter && + $value->getHeight() <= $height && $value->getHeight() !== null + ) { + return true; + } } ); } @@ -164,7 +180,11 @@ public function filterMinHeight($height) { return $this->filter( function ($key, $value) use ($height) { - if ($value instanceof ImageFilter && $value->getHeight() >= $height && $value->getHeight() !== null) { return true; } + if ($value instanceof ImageFilter && + $value->getHeight() >= $height && + $value->getHeight() !== null) { + return true; + } } ); } diff --git a/lib/Tmdb/Model/Collection/Jobs.php b/lib/Tmdb/Model/Collection/Jobs.php index ee9f3def..0495749b 100644 --- a/lib/Tmdb/Model/Collection/Jobs.php +++ b/lib/Tmdb/Model/Collection/Jobs.php @@ -30,7 +30,9 @@ public function filterByDepartment($department) { $result = $this->filter( function ($key, $value) use ($department) { - if ($value->getDepartment() == $department) { return true; } + if ($value->getDepartment() == $department) { + return true; + } } ); @@ -53,7 +55,9 @@ public function filterByDepartmentAndReturnJobsList($department) { $result = $this->filter( function ($key, $value) use ($department) { - if ($value->getDepartment() == $department) { return true; } + if ($value->getDepartment() == $department) { + return true; + } } ); @@ -80,7 +84,9 @@ function ($key, $value) use ($filterByJob) { $jobList = $value->getJobList(); foreach ($jobList as $job) { - if ($filterByJob == $job) { return true; } + if ($filterByJob == $job) { + return true; + } } } ); 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 22e09c0d..bdf6a9d3 100644 --- a/lib/Tmdb/Model/Collection/ResultCollection.php +++ b/lib/Tmdb/Model/Collection/ResultCollection.php @@ -38,7 +38,7 @@ class ResultCollection extends GenericCollection /** * @var array */ - public static $_properties = array( + public static $properties = array( 'page', 'total_pages', 'total_results' diff --git a/lib/Tmdb/Model/Common/Change.php b/lib/Tmdb/Model/Common/Change.php index 069f5408..6aa86cce 100644 --- a/lib/Tmdb/Model/Common/Change.php +++ b/lib/Tmdb/Model/Common/Change.php @@ -30,7 +30,7 @@ class Change extends AbstractModel */ private $items; - public static $_properties = array( + public static $properties = array( 'key', ); @@ -76,5 +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 2a7ab014..c4267456 100644 --- a/lib/Tmdb/Model/Common/Change/Item.php +++ b/lib/Tmdb/Model/Common/Change/Item.php @@ -40,7 +40,7 @@ class Item extends AbstractModel */ private $value; - public static $_properties = array( + public static $properties = array( 'id', 'action', 'time', @@ -126,5 +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 353adbd6..70b662a3 100644 --- a/lib/Tmdb/Model/Common/Country.php +++ b/lib/Tmdb/Model/Common/Country.php @@ -24,7 +24,7 @@ class Country extends AbstractModel implements CountryFilter private $iso31661; private $name; - public static $_properties = array( + public static $properties = array( 'iso_3166_1', 'name', ); diff --git a/lib/Tmdb/Model/Common/ExternalIds.php b/lib/Tmdb/Model/Common/ExternalIds.php index 61d57838..e064623c 100644 --- a/lib/Tmdb/Model/Common/ExternalIds.php +++ b/lib/Tmdb/Model/Common/ExternalIds.php @@ -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', diff --git a/lib/Tmdb/Model/Common/GenericCollection.php b/lib/Tmdb/Model/Common/GenericCollection.php index 16df46be..8029c4f8 100644 --- a/lib/Tmdb/Model/Common/GenericCollection.php +++ b/lib/Tmdb/Model/Common/GenericCollection.php @@ -317,7 +317,9 @@ public function filterId($id) { $result = $this->filter( function ($key, $value) use ($id) { - if ($value->getId() == $id) { return true; } + if ($value->getId() == $id) { + return true; + } } ); @@ -338,7 +340,9 @@ public function filterLanguage($language = 'en') { return $this->filter( function ($key, $value) use ($language) { - if ($value instanceof LanguageFilter && $value->getIso6391() == $language) { return true; } + if ($value instanceof LanguageFilter && $value->getIso6391() == $language) { + return true; + } } ); } @@ -353,7 +357,9 @@ public function filterCountry($country = 'US') { return $this->filter( function ($key, $value) use ($country) { - if ($value instanceof CountryFilter && $value->getIso31661() == $country) { return true; } + if ($value instanceof CountryFilter && $value->getIso31661() == $country) { + return true; + } } ); } @@ -368,7 +374,9 @@ public function filterAdult($adult = false) { return $this->filter( function ($key, $value) use ($adult) { - if ($value instanceof AdultFilter && $value->getAdult() == $adult) { return true; } + if ($value instanceof AdultFilter && $value->getAdult() == $adult) { + return true; + } } ); } diff --git a/lib/Tmdb/Model/Common/SpokenLanguage.php b/lib/Tmdb/Model/Common/SpokenLanguage.php index ddb2d3f8..47a87865 100644 --- a/lib/Tmdb/Model/Common/SpokenLanguage.php +++ b/lib/Tmdb/Model/Common/SpokenLanguage.php @@ -24,7 +24,7 @@ class SpokenLanguage extends AbstractModel implements LanguageFilter private $iso6391; private $name; - public static $_properties = array( + public static $properties = array( 'iso_369_1', 'name', ); diff --git a/lib/Tmdb/Model/Common/Trailer/Youtube.php b/lib/Tmdb/Model/Common/Trailer/Youtube.php index ef4faf76..3d78aeaf 100644 --- a/lib/Tmdb/Model/Common/Trailer/Youtube.php +++ b/lib/Tmdb/Model/Common/Trailer/Youtube.php @@ -27,7 +27,7 @@ class Youtube extends AbstractTrailer private $source; private $type; - public static $_properties = array( + public static $properties = array( 'name', 'size', 'source', diff --git a/lib/Tmdb/Model/Common/Translation.php b/lib/Tmdb/Model/Common/Translation.php index c75e52c7..bcc513b0 100644 --- a/lib/Tmdb/Model/Common/Translation.php +++ b/lib/Tmdb/Model/Common/Translation.php @@ -22,7 +22,7 @@ class Translation extends SpokenLanguage implements LanguageFilter { private $englishName; - public static $_properties = array( + public static $properties = array( 'iso_639_1', 'name', 'english_name' diff --git a/lib/Tmdb/Model/Company.php b/lib/Tmdb/Model/Company.php index 41c26b9c..8bb70e0f 100644 --- a/lib/Tmdb/Model/Company.php +++ b/lib/Tmdb/Model/Company.php @@ -29,7 +29,7 @@ class Company extends AbstractModel private $name; private $parentCompany; - public static $_properties = array( + public static $properties = array( 'description', 'headquarters', 'homepage', diff --git a/lib/Tmdb/Model/Configuration.php b/lib/Tmdb/Model/Configuration.php index 8badb84b..8b71c5d4 100644 --- a/lib/Tmdb/Model/Configuration.php +++ b/lib/Tmdb/Model/Configuration.php @@ -28,7 +28,7 @@ class Configuration extends AbstractModel */ private $change_keys; - public static $_properties = array( + public static $properties = array( 'images', 'change_keys', ); diff --git a/lib/Tmdb/Model/Credits.php b/lib/Tmdb/Model/Credits.php index 3b6a6cf4..24c0e88c 100644 --- a/lib/Tmdb/Model/Credits.php +++ b/lib/Tmdb/Model/Credits.php @@ -58,7 +58,7 @@ class Credits extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'credit_type', 'department', 'job', diff --git a/lib/Tmdb/Model/Credits/Media.php b/lib/Tmdb/Model/Credits/Media.php index c19d0281..622b72fe 100644 --- a/lib/Tmdb/Model/Credits/Media.php +++ b/lib/Tmdb/Model/Credits/Media.php @@ -51,7 +51,7 @@ class Media extends AbstractModel */ private $seasons; - public static $_properties = array( + public static $properties = array( 'id', 'name', 'original_name', diff --git a/lib/Tmdb/Model/Find.php b/lib/Tmdb/Model/Find.php index 7512f34f..7b50fbab 100644 --- a/lib/Tmdb/Model/Find.php +++ b/lib/Tmdb/Model/Find.php @@ -92,5 +92,4 @@ public function getTvResults() { return $this->tvResults; } - } diff --git a/lib/Tmdb/Model/Genre.php b/lib/Tmdb/Model/Genre.php index 484ad4fc..d28876f7 100644 --- a/lib/Tmdb/Model/Genre.php +++ b/lib/Tmdb/Model/Genre.php @@ -21,7 +21,7 @@ class Genre extends AbstractModel private $id; private $name; - public static $_properties = array( + public static $properties = array( 'id', 'name', ); diff --git a/lib/Tmdb/Model/Image.php b/lib/Tmdb/Model/Image.php index b1237257..53020318 100644 --- a/lib/Tmdb/Model/Image.php +++ b/lib/Tmdb/Model/Image.php @@ -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,8 +64,8 @@ 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]; } } 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 310e37fb..d5f39b2c 100644 --- a/lib/Tmdb/Model/Job.php +++ b/lib/Tmdb/Model/Job.php @@ -18,7 +18,7 @@ */ class Job extends AbstractModel { - public static $_properties = array( + public static $properties = array( 'department', 'job_list' ); diff --git a/lib/Tmdb/Model/Keyword.php b/lib/Tmdb/Model/Keyword.php index f6fb0323..91e91b16 100644 --- a/lib/Tmdb/Model/Keyword.php +++ b/lib/Tmdb/Model/Keyword.php @@ -21,7 +21,7 @@ class Keyword extends AbstractModel private $id; private $name; - public static $_properties = array( + public static $properties = array( 'id', 'name', ); diff --git a/lib/Tmdb/Model/Lists.php b/lib/Tmdb/Model/Lists.php index 8047e44a..e1c13419 100644 --- a/lib/Tmdb/Model/Lists.php +++ b/lib/Tmdb/Model/Lists.php @@ -71,7 +71,7 @@ class Lists extends AbstractModel */ private $posterImage; - public static $_properties = array( + public static $properties = array( 'created_by', 'description', 'favorite_count', diff --git a/lib/Tmdb/Model/Lists/ItemStatus.php b/lib/Tmdb/Model/Lists/ItemStatus.php index 79f5a614..8b8f9524 100644 --- a/lib/Tmdb/Model/Lists/ItemStatus.php +++ b/lib/Tmdb/Model/Lists/ItemStatus.php @@ -33,7 +33,7 @@ class ItemStatus extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'id', 'item_present' ); diff --git a/lib/Tmdb/Model/Lists/ListItem.php b/lib/Tmdb/Model/Lists/ListItem.php index 8591a93e..350c2475 100644 --- a/lib/Tmdb/Model/Lists/ListItem.php +++ b/lib/Tmdb/Model/Lists/ListItem.php @@ -75,7 +75,7 @@ class ListItem extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'backdrop_path', 'id', 'original_title', diff --git a/lib/Tmdb/Model/Lists/Result.php b/lib/Tmdb/Model/Lists/Result.php index 35a7ee71..b9413523 100644 --- a/lib/Tmdb/Model/Lists/Result.php +++ b/lib/Tmdb/Model/Lists/Result.php @@ -33,7 +33,7 @@ class Result extends AbstractModel /** * @var array */ - public static $_properties = array( + public static $properties = array( 'status_code', 'status_message' ); diff --git a/lib/Tmdb/Model/Lists/ResultWithListId.php b/lib/Tmdb/Model/Lists/ResultWithListId.php index 113f6dd5..d28362bc 100644 --- a/lib/Tmdb/Model/Lists/ResultWithListId.php +++ b/lib/Tmdb/Model/Lists/ResultWithListId.php @@ -26,7 +26,7 @@ class ResultWithListId extends Result /** * @var array */ - public static $_properties = array( + public static $properties = array( 'status_code', 'status_message', 'list_id' diff --git a/lib/Tmdb/Model/Movie.php b/lib/Tmdb/Model/Movie.php index 73151b03..ea467361 100644 --- a/lib/Tmdb/Model/Movie.php +++ b/lib/Tmdb/Model/Movie.php @@ -220,7 +220,7 @@ class Movie extends AbstractModel * * @var array */ - public static $_properties = array( + public static $properties = array( 'adult', 'backdrop_path', 'belongs_to_collection', diff --git a/lib/Tmdb/Model/Movie/AccountStates.php b/lib/Tmdb/Model/Movie/AccountStates.php index d48b4e1b..6d64bcc9 100644 --- a/lib/Tmdb/Model/Movie/AccountStates.php +++ b/lib/Tmdb/Model/Movie/AccountStates.php @@ -40,7 +40,7 @@ class AccountStates extends AbstractModel */ private $watchlist; - public static $_properties = array( + public static $properties = array( 'id', 'favorite', 'watchlist', diff --git a/lib/Tmdb/Model/Movie/AlternativeTitle.php b/lib/Tmdb/Model/Movie/AlternativeTitle.php index 4dbb0acf..ae7d8180 100644 --- a/lib/Tmdb/Model/Movie/AlternativeTitle.php +++ b/lib/Tmdb/Model/Movie/AlternativeTitle.php @@ -24,7 +24,7 @@ class AlternativeTitle extends AbstractModel implements CountryFilter private $iso31661; private $title; - public static $_properties = array( + public static $properties = array( 'iso_3166_1', 'title', ); diff --git a/lib/Tmdb/Model/Movie/ListItem.php b/lib/Tmdb/Model/Movie/ListItem.php index 79e09680..c8188f7c 100644 --- a/lib/Tmdb/Model/Movie/ListItem.php +++ b/lib/Tmdb/Model/Movie/ListItem.php @@ -61,7 +61,7 @@ class ListItem extends AbstractModel */ private $posterImage; - public static $_properties = array( + public static $properties = array( 'description', 'favorite_count', 'id', @@ -222,5 +222,4 @@ public function getPosterPath() { return $this->posterPath; } - } diff --git a/lib/Tmdb/Model/Movie/Rating.php b/lib/Tmdb/Model/Movie/Rating.php index 75e60e9b..71af8de6 100644 --- a/lib/Tmdb/Model/Movie/Rating.php +++ b/lib/Tmdb/Model/Movie/Rating.php @@ -25,7 +25,7 @@ class Rating extends AbstractModel */ private $value; - public static $_properties = array( + public static $properties = array( 'value', ); diff --git a/lib/Tmdb/Model/Movie/Release.php b/lib/Tmdb/Model/Movie/Release.php index 28bbd902..16d94c64 100644 --- a/lib/Tmdb/Model/Movie/Release.php +++ b/lib/Tmdb/Model/Movie/Release.php @@ -25,7 +25,7 @@ class Release extends AbstractModel implements CountryFilter private $certification; private $releaseDate; - public static $_properties = array( + public static $properties = array( 'iso_3166_1', 'certification', 'release_date' diff --git a/lib/Tmdb/Model/Network.php b/lib/Tmdb/Model/Network.php index cae40ecf..f7174d3e 100644 --- a/lib/Tmdb/Model/Network.php +++ b/lib/Tmdb/Model/Network.php @@ -21,7 +21,7 @@ class Network extends AbstractModel private $id; private $name; - public static $_properties = array( + public static $properties = array( 'id', 'name', ); diff --git a/lib/Tmdb/Model/Person.php b/lib/Tmdb/Model/Person.php index 9aee9981..d2a8db30 100644 --- a/lib/Tmdb/Model/Person.php +++ b/lib/Tmdb/Model/Person.php @@ -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', diff --git a/lib/Tmdb/Model/Person/AbstractMember.php b/lib/Tmdb/Model/Person/AbstractMember.php index f6726820..a4c79282 100644 --- a/lib/Tmdb/Model/Person/AbstractMember.php +++ b/lib/Tmdb/Model/Person/AbstractMember.php @@ -41,7 +41,7 @@ abstract class AbstractMember extends AbstractModel */ private $profile; - public static $_properties = array( + public static $properties = array( 'id', 'name', 'profile_path' diff --git a/lib/Tmdb/Model/Person/CastMember.php b/lib/Tmdb/Model/Person/CastMember.php index 78d41d13..129bbdd8 100644 --- a/lib/Tmdb/Model/Person/CastMember.php +++ b/lib/Tmdb/Model/Person/CastMember.php @@ -35,7 +35,7 @@ class CastMember extends AbstractMember implements PersonInterface */ private $castId; - public static $_properties = array( + public static $properties = array( 'id', 'cast_id', 'name', diff --git a/lib/Tmdb/Model/Person/CrewMember.php b/lib/Tmdb/Model/Person/CrewMember.php index fc0bf915..bf53811b 100644 --- a/lib/Tmdb/Model/Person/CrewMember.php +++ b/lib/Tmdb/Model/Person/CrewMember.php @@ -30,7 +30,7 @@ class CrewMember extends AbstractMember implements PersonInterface */ private $job; - public static $_properties = array( + public static $properties = array( 'id', 'name', 'department', diff --git a/lib/Tmdb/Model/Person/MovieCredit.php b/lib/Tmdb/Model/Person/MovieCredit.php index 8c97815d..db117427 100644 --- a/lib/Tmdb/Model/Person/MovieCredit.php +++ b/lib/Tmdb/Model/Person/MovieCredit.php @@ -66,7 +66,7 @@ class MovieCredit extends AbstractModel */ private $posterImage; - public static $_properties = array( + public static $properties = array( 'adult', 'character', 'credit_id', @@ -251,5 +251,4 @@ public function getTitle() { return $this->title; } - } diff --git a/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php b/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php index 0ab1369b..b49c0e58 100644 --- a/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php +++ b/lib/Tmdb/Model/Query/Discover/DiscoverMoviesQuery.php @@ -47,7 +47,8 @@ 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 * @return $this @@ -73,7 +74,8 @@ 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 * @return $this @@ -90,7 +92,8 @@ 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 * @return $this @@ -107,7 +110,8 @@ 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 * @return $this @@ -120,7 +124,8 @@ 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 * @return $this @@ -133,7 +138,9 @@ 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'. @@ -217,7 +224,8 @@ 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 * @return $this diff --git a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php index 46660b35..5e2f336f 100644 --- a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php +++ b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php @@ -47,7 +47,8 @@ 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 * @return $this @@ -60,7 +61,8 @@ 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 * @return $this @@ -77,7 +79,8 @@ 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 * @return $this @@ -90,7 +93,8 @@ 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 * @return $this @@ -103,10 +107,13 @@ 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'. + * + * Comma separated indicates an 'AND' query, + * while a pipe (|) separated value indicates an 'OR'. * * @param array|string $genres * @return $this @@ -185,7 +192,8 @@ public function firstAirDateLte($date) /** * 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. diff --git a/lib/Tmdb/Model/Review.php b/lib/Tmdb/Model/Review.php index 44371245..c49f659c 100644 --- a/lib/Tmdb/Model/Review.php +++ b/lib/Tmdb/Model/Review.php @@ -27,7 +27,7 @@ class Review extends AbstractModel private $mediaType; private $url; - public static $_properties = array( + public static $properties = array( 'id', 'author', 'content', @@ -189,5 +189,4 @@ public function getUrl() { return $this->url; } - } 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/Tv.php b/lib/Tmdb/Model/Tv.php index 1bec3145..95ddc93d 100644 --- a/lib/Tmdb/Model/Tv.php +++ b/lib/Tmdb/Model/Tv.php @@ -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', diff --git a/lib/Tmdb/Model/Tv/Episode.php b/lib/Tmdb/Model/Tv/Episode.php index 4815ca1d..c809591e 100644 --- a/lib/Tmdb/Model/Tv/Episode.php +++ b/lib/Tmdb/Model/Tv/Episode.php @@ -107,7 +107,7 @@ class Episode extends AbstractModel * * @var array */ - public static $_properties = array( + public static $properties = array( 'air_date', 'episode_number', 'name', diff --git a/lib/Tmdb/Model/Tv/Network.php b/lib/Tmdb/Model/Tv/Network.php index 0bbe1180..366f9003 100644 --- a/lib/Tmdb/Model/Tv/Network.php +++ b/lib/Tmdb/Model/Tv/Network.php @@ -37,7 +37,7 @@ class Network extends AbstractModel * * @var array */ - public static $_properties = array( + public static $properties = array( 'id', 'name', ); diff --git a/lib/Tmdb/Model/Tv/Season.php b/lib/Tmdb/Model/Tv/Season.php index 166ac925..3bb9e9c2 100644 --- a/lib/Tmdb/Model/Tv/Season.php +++ b/lib/Tmdb/Model/Tv/Season.php @@ -93,7 +93,7 @@ class Season extends AbstractModel * * @var array */ - public static $_properties = array( + public static $properties = array( 'air_date', 'name', 'overview', diff --git a/lib/Tmdb/Repository/AccountRepository.php b/lib/Tmdb/Repository/AccountRepository.php index 8085d79a..19e26247 100644 --- a/lib/Tmdb/Repository/AccountRepository.php +++ b/lib/Tmdb/Repository/AccountRepository.php @@ -24,7 +24,8 @@ 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 */ diff --git a/lib/Tmdb/Repository/AuthenticationRepository.php b/lib/Tmdb/Repository/AuthenticationRepository.php index ed075b0b..809a16b9 100644 --- a/lib/Tmdb/Repository/AuthenticationRepository.php +++ b/lib/Tmdb/Repository/AuthenticationRepository.php @@ -56,11 +56,14 @@ 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 */ diff --git a/lib/Tmdb/Repository/CertificationRepository.php b/lib/Tmdb/Repository/CertificationRepository.php index 31d979af..8738535f 100644 --- a/lib/Tmdb/Repository/CertificationRepository.php +++ b/lib/Tmdb/Repository/CertificationRepository.php @@ -24,7 +24,8 @@ 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 diff --git a/lib/Tmdb/Repository/CollectionRepository.php b/lib/Tmdb/Repository/CollectionRepository.php index 4079f5ad..c38df046 100644 --- a/lib/Tmdb/Repository/CollectionRepository.php +++ b/lib/Tmdb/Repository/CollectionRepository.php @@ -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 diff --git a/lib/Tmdb/Repository/DiscoverRepository.php b/lib/Tmdb/Repository/DiscoverRepository.php index 3d20825f..6d7ec6c6 100644 --- a/lib/Tmdb/Repository/DiscoverRepository.php +++ b/lib/Tmdb/Repository/DiscoverRepository.php @@ -29,7 +29,8 @@ 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 @@ -41,7 +42,9 @@ public function discoverMovies(DiscoverMoviesQuery $query, array $headers = arra $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); @@ -50,7 +53,8 @@ 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 diff --git a/lib/Tmdb/Repository/FindRepository.php b/lib/Tmdb/Repository/FindRepository.php index 9cf26910..e8f538ea 100644 --- a/lib/Tmdb/Repository/FindRepository.php +++ b/lib/Tmdb/Repository/FindRepository.php @@ -33,7 +33,7 @@ class FindRepository extends AbstractRepository 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) ); } diff --git a/lib/Tmdb/Repository/GenreRepository.php b/lib/Tmdb/Repository/GenreRepository.php index 3a8bdff2..96e171a2 100644 --- a/lib/Tmdb/Repository/GenreRepository.php +++ b/lib/Tmdb/Repository/GenreRepository.php @@ -51,7 +51,8 @@ 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 diff --git a/lib/Tmdb/Repository/KeywordRepository.php b/lib/Tmdb/Repository/KeywordRepository.php index b3a6784b..4c854777 100644 --- a/lib/Tmdb/Repository/KeywordRepository.php +++ b/lib/Tmdb/Repository/KeywordRepository.php @@ -39,7 +39,8 @@ public function load($id, array $parameters = array(), array $headers = array()) } /** - * 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 diff --git a/lib/Tmdb/Repository/ListRepository.php b/lib/Tmdb/Repository/ListRepository.php index 04abcc40..1342c5cb 100644 --- a/lib/Tmdb/Repository/ListRepository.php +++ b/lib/Tmdb/Repository/ListRepository.php @@ -71,7 +71,8 @@ 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 @@ -85,7 +86,8 @@ 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 @@ -99,7 +101,8 @@ 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 * @return ItemStatus diff --git a/lib/Tmdb/Repository/MovieRepository.php b/lib/Tmdb/Repository/MovieRepository.php index e733490e..d56571ce 100644 --- a/lib/Tmdb/Repository/MovieRepository.php +++ b/lib/Tmdb/Repository/MovieRepository.php @@ -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 @@ -274,7 +275,8 @@ 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 * @return Movie[] @@ -287,7 +289,8 @@ 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 * @return Movie[] @@ -300,7 +303,8 @@ 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 * @return Movie[] @@ -313,7 +317,10 @@ 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 * @return Movie[] @@ -326,7 +333,8 @@ 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 * @return Movie[] @@ -439,5 +447,4 @@ public function getPeopleFactory() { return $this->peopleFactory; } - } diff --git a/lib/Tmdb/Repository/PeopleRepository.php b/lib/Tmdb/Repository/PeopleRepository.php index 648bb716..c09c87be 100644 --- a/lib/Tmdb/Repository/PeopleRepository.php +++ b/lib/Tmdb/Repository/PeopleRepository.php @@ -73,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 @@ -92,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 diff --git a/lib/Tmdb/Repository/TvEpisodeRepository.php b/lib/Tmdb/Repository/TvEpisodeRepository.php index d573a7b0..74128c78 100644 --- a/lib/Tmdb/Repository/TvEpisodeRepository.php +++ b/lib/Tmdb/Repository/TvEpisodeRepository.php @@ -29,7 +29,8 @@ 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(); @@ -158,7 +179,14 @@ public function getImages($tvShow, $season, $episode, array $parameters = array( $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(); diff --git a/lib/Tmdb/Repository/TvRepository.php b/lib/Tmdb/Repository/TvRepository.php index 8277fea7..a3b55e99 100644 --- a/lib/Tmdb/Repository/TvRepository.php +++ b/lib/Tmdb/Repository/TvRepository.php @@ -26,7 +26,8 @@ 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 $parameters @@ -152,7 +153,8 @@ 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 * @return Tv[] @@ -165,7 +167,8 @@ 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 * @return Tv[] diff --git a/test/Tmdb/Tests/Common/ObjectHydratorTest.php b/test/Tmdb/Tests/Common/ObjectHydratorTest.php index 2de27930..a66bc89d 100644 --- a/test/Tmdb/Tests/Common/ObjectHydratorTest.php +++ b/test/Tmdb/Tests/Common/ObjectHydratorTest.php @@ -46,7 +46,7 @@ class TestModel extends \Tmdb\Model\AbstractModel private $id; private $name; - static $_properties = array('id', 'name'); + static $properties = array('id', 'name'); /** * @param mixed $id @@ -89,5 +89,5 @@ public function getName() class FailingTestModel extends \Tmdb\Model\AbstractModel { - static $_properties = array('lastname'); + static $properties = array('lastname'); } diff --git a/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php b/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php index b19296f0..509cc2a1 100644 --- a/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php +++ b/test/Tmdb/Tests/Factory/Movie/GenericCollectionFactoryTest.php @@ -48,7 +48,7 @@ protected function getFactoryClass() class FakeClass extends AbstractModel { - public static $_properties = array('id'); + public static $properties = array('id'); private $id; From 3de15b1b834e0fb72538e92841c02202d2edd002 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 20:38:31 +0100 Subject: [PATCH 08/12] Adding doctrine cache to the suggest directive in composer.json to indicate cache support, also added an example of how this could be used. --- composer.json | 6 +++++- examples/movies/model/cache/get.php | 32 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 examples/movies/model/cache/get.php 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/movies/model/cache/get.php b/examples/movies/model/cache/get.php new file mode 100644 index 00000000..7b61b290 --- /dev/null +++ b/examples/movies/model/cache/get.php @@ -0,0 +1,32 @@ + + * @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); + +$cachePlugin = new \Guzzle\Plugin\Cache\CachePlugin(array( + 'storage' => new \Guzzle\Plugin\Cache\DefaultCacheStorage( + new \Guzzle\Cache\DoctrineCacheAdapter( + new \Doctrine\Common\Cache\FilesystemCache('/tmp/_php-tmdb-api') + ) + ) +)); + +$client->getHttpClient()->addSubscriber($cachePlugin); + +$repository = new \Tmdb\Repository\MovieRepository($client); +$movie = $repository->load(87421); + +var_dump($movie); From ab4572f4830871ffa1c37cdf8a6eeffa3a4d4e3f Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 20:41:12 +0100 Subject: [PATCH 09/12] Add the HttpClient to the phpdoc to provide auto-completion --- lib/Tmdb/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Tmdb/Client.php b/lib/Tmdb/Client.php index 0fa73452..a2be0d38 100644 --- a/lib/Tmdb/Client.php +++ b/lib/Tmdb/Client.php @@ -285,7 +285,7 @@ public function getCertificationsApi() } /** - * @return HttpClientInterface + * @return HttpClient|HttpClientInterface */ public function getHttpClient() { From a3a298f582f868ef4af8f9a5b8cf9e640aa4ebe4 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 20:54:10 +0100 Subject: [PATCH 10/12] Making sure the last response and requests are available. --- examples/movies/model/cache/{get.php => basic_doctrine_cache.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/movies/model/cache/{get.php => basic_doctrine_cache.php} (100%) diff --git a/examples/movies/model/cache/get.php b/examples/movies/model/cache/basic_doctrine_cache.php similarity index 100% rename from examples/movies/model/cache/get.php rename to examples/movies/model/cache/basic_doctrine_cache.php From 5caa0822d5ee7c8dcecb065552440c484c6efb95 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 22:10:31 +0100 Subject: [PATCH 11/12] Adding default simple implementation for cache, it adheres to the headers sent by TMDB. --- .../model/cache/basic_doctrine_cache.php | 10 +- examples/movies/model/cache/built-in.php | 24 ++++ lib/Tmdb/Client.php | 113 +++++++++++++++++- lib/Tmdb/HttpClient/HttpClient.php | 38 ++++++ 4 files changed, 172 insertions(+), 13 deletions(-) create mode 100644 examples/movies/model/cache/built-in.php diff --git a/examples/movies/model/cache/basic_doctrine_cache.php b/examples/movies/model/cache/basic_doctrine_cache.php index 7b61b290..3d6d3eba 100644 --- a/examples/movies/model/cache/basic_doctrine_cache.php +++ b/examples/movies/model/cache/basic_doctrine_cache.php @@ -16,15 +16,7 @@ $token = new \Tmdb\ApiToken(TMDB_API_KEY); $client = new \Tmdb\Client($token); -$cachePlugin = new \Guzzle\Plugin\Cache\CachePlugin(array( - 'storage' => new \Guzzle\Plugin\Cache\DefaultCacheStorage( - new \Guzzle\Cache\DoctrineCacheAdapter( - new \Doctrine\Common\Cache\FilesystemCache('/tmp/_php-tmdb-api') - ) - ) -)); - -$client->getHttpClient()->addSubscriber($cachePlugin); +$client->setCaching(true); $repository = new \Tmdb\Repository\MovieRepository($client); $movie = $repository->load(87421); 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/lib/Tmdb/Client.php b/lib/Tmdb/Client.php index a2be0d38..a00ce160 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; @@ -70,6 +75,20 @@ 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 * @@ -81,20 +100,67 @@ public function __construct(Token $token, ClientInterface $httpClient = null, $s { $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 Token) { + $apiTokenPlugin = new ApiTokenPlugin($this->getToken()); + $httpClient->addSubscriber($apiTokenPlugin); + } + + if ($this->cacheEnabled && !empty($this->cachePath)) { + if (!class_exists('Doctrine\Common\Cache\FilesystemCache')) { + throw new RuntimeException( + 'Could not find the doctrine cache library, have you added doctrone-cache to your composer.json?' + ); + } + + $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->getClient()->addSubscriber($sessionTokenPlugin); + } } $this->httpClient = new HttpClient($this->getBaseUrl(), array(), $httpClient); } + /** + * Add the token subscriber + * + * @return Token + */ + public function getToken() + { + return $this->token !== null ? $this->token : null; + } + /** * Add the token subscriber * @@ -356,4 +422,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/HttpClient/HttpClient.php b/lib/Tmdb/HttpClient/HttpClient.php index 5792ab36..8618e0c3 100644 --- a/lib/Tmdb/HttpClient/HttpClient.php +++ b/lib/Tmdb/HttpClient/HttpClient.php @@ -199,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; + } } From d6d72210ff33471bcfd80ac6462eafc8e54b7607 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 1 Mar 2014 23:38:50 +0100 Subject: [PATCH 12/12] Adding unit tests for caching --- lib/Tmdb/Client.php | 15 +++++------ test/Tmdb/Tests/ClientTest.php | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/lib/Tmdb/Client.php b/lib/Tmdb/Client.php index a00ce160..0d4c2a74 100644 --- a/lib/Tmdb/Client.php +++ b/lib/Tmdb/Client.php @@ -96,7 +96,7 @@ class Client * @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); @@ -118,16 +118,18 @@ private function constructHttpClient(ClientInterface $httpClient = null) $acceptJsonHeaderPlugin = new AcceptJsonHeaderPlugin(); $httpClient->addSubscriber($acceptJsonHeaderPlugin); - if ($this->getToken() instanceof Token) { + 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( @@ -144,7 +146,7 @@ private function constructHttpClient(ClientInterface $httpClient = null) if ($this->getSessionToken() instanceof SessionToken) { $sessionTokenPlugin = new SessionTokenPlugin($this->getSessionToken()); - $httpClient->getClient()->addSubscriber($sessionTokenPlugin); + $httpClient->addSubscriber($sessionTokenPlugin); } } @@ -405,13 +407,10 @@ public function getSecure() */ 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; } diff --git a/test/Tmdb/Tests/ClientTest.php b/test/Tmdb/Tests/ClientTest.php index e9b877d3..24044844 100644 --- a/test/Tmdb/Tests/ClientTest.php +++ b/test/Tmdb/Tests/ClientTest.php @@ -78,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; + } }