From 02ca249644e8569604cfa995159c2740f1b6ce12 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sun, 19 Jan 2014 01:35:33 +0100 Subject: [PATCH] Updating docblocks to help IDE auto-completion --- lib/Tmdb/Repository/ChangesRepository.php | 5 ++-- lib/Tmdb/Repository/CollectionRepository.php | 2 +- lib/Tmdb/Repository/CompanyRepository.php | 12 --------- lib/Tmdb/Repository/DiscoverRepository.php | 7 ++--- lib/Tmdb/Repository/GenreRepository.php | 4 +-- lib/Tmdb/Repository/MovieRepository.php | 27 ++++---------------- lib/Tmdb/Repository/PeopleRepository.php | 12 --------- lib/Tmdb/Repository/TvEpisodeRepository.php | 17 ++---------- lib/Tmdb/Repository/TvRepository.php | 6 ++--- lib/Tmdb/Repository/TvSeasonRepository.php | 15 +---------- 10 files changed, 21 insertions(+), 86 deletions(-) diff --git a/lib/Tmdb/Repository/ChangesRepository.php b/lib/Tmdb/Repository/ChangesRepository.php index 2beb7c37..c512292c 100644 --- a/lib/Tmdb/Repository/ChangesRepository.php +++ b/lib/Tmdb/Repository/ChangesRepository.php @@ -14,6 +14,7 @@ use Tmdb\Factory\MovieFactory; use Tmdb\Factory\People\PeopleFactory; +use Tmdb\Model\Collection\People; use Tmdb\Model\Common\GenericCollection; use Tmdb\Model\Movie; use Tmdb\Model\Query\ChangesQuery; @@ -31,7 +32,7 @@ class ChangesRepository extends AbstractRepository { * * @param ChangesQuery $query * @param array $headers - * @return GenericCollection + * @return Movie[] */ public function getMovieChanges(ChangesQuery $query, array $headers = array()) { $data = $this->getApi()->getMovieChanges($query->toArray(), $this->parseHeaders($headers)); @@ -51,7 +52,7 @@ public function getMovieChanges(ChangesQuery $query, array $headers = array()) { * * @param ChangesQuery $query * @param array $headers - * @return GenericCollection + * @return People */ public function getPeopleChanges(ChangesQuery $query, array $headers = array()) { $data = $this->getApi()->getPeopleChanges($query->toArray(), $this->parseHeaders($headers)); diff --git a/lib/Tmdb/Repository/CollectionRepository.php b/lib/Tmdb/Repository/CollectionRepository.php index d4eda989..9e469922 100644 --- a/lib/Tmdb/Repository/CollectionRepository.php +++ b/lib/Tmdb/Repository/CollectionRepository.php @@ -60,7 +60,7 @@ public function getApi() * @param $id * @param array $parameters * @param array $headers - * @return Images + * @return ApiCollection\Images */ public function getImages($id, array $parameters = array(), array $headers = array()) { diff --git a/lib/Tmdb/Repository/CompanyRepository.php b/lib/Tmdb/Repository/CompanyRepository.php index f2316f64..b81e30b2 100644 --- a/lib/Tmdb/Repository/CompanyRepository.php +++ b/lib/Tmdb/Repository/CompanyRepository.php @@ -31,18 +31,6 @@ public function load($id, array $parameters = array(), array $headers = array()) return CompanyFactory::create($data); } - /** - * If you obtained an person model which is not completely hydrated, you can use this function. - * - * @param Company $company - * @param array $parameters - * @param array $headers - * @return Company - */ - public function refresh(Company $company, array $parameters = array(), array $headers = array()) { - return $this->load($company->getId(), $parameters, $headers); - } - /** * Return the related API class * diff --git a/lib/Tmdb/Repository/DiscoverRepository.php b/lib/Tmdb/Repository/DiscoverRepository.php index 693591da..4efde2cf 100644 --- a/lib/Tmdb/Repository/DiscoverRepository.php +++ b/lib/Tmdb/Repository/DiscoverRepository.php @@ -15,9 +15,10 @@ use Tmdb\Exception\RuntimeException; use Tmdb\Factory\MovieFactory; use Tmdb\Factory\TvFactory; -use Tmdb\Model\Common\GenericCollection; +use Tmdb\Model\Movie; use Tmdb\Model\Query\Discover\DiscoverMoviesQuery; use Tmdb\Model\Query\Discover\DiscoverTvQuery; +use Tmdb\Model\Tv; class DiscoverRepository extends AbstractRepository { /** @@ -26,7 +27,7 @@ class DiscoverRepository extends AbstractRepository { * @param DiscoverMoviesQuery $query * @param array $headers * @throws RuntimeException when certification_country is set but certification.lte is not given - * @return GenericCollection + * @return Movie[] */ public function discoverMovies(DiscoverMoviesQuery $query, array $headers = array()) { $query = $query->toArray(); @@ -45,7 +46,7 @@ public function discoverMovies(DiscoverMoviesQuery $query, array $headers = arra * * @param DiscoverTvQuery $query * @param array $headers - * @return GenericCollection + * @return Tv[] */ public function discoverTv(DiscoverTvQuery $query, array $headers = array()) { $data = $this->getApi()->discoverTv($query->toArray(), $this->parseHeaders($headers)); diff --git a/lib/Tmdb/Repository/GenreRepository.php b/lib/Tmdb/Repository/GenreRepository.php index 5351afb1..c2ba09d8 100644 --- a/lib/Tmdb/Repository/GenreRepository.php +++ b/lib/Tmdb/Repository/GenreRepository.php @@ -34,7 +34,7 @@ public function load($id, array $parameters = array(), array $headers = array()) * * @param array $parameters * @param array $headers - * @return GenericCollection + * @return Genre[] */ public function loadCollection(array $parameters = array(), array $headers = array()) { @@ -47,7 +47,7 @@ public function loadCollection(array $parameters = array(), array $headers = arr * Create an collection of an array * * @param $data - * @return GenericCollection + * @return Genre[] */ private function createCollection($data){ $collection = new GenericCollection(); diff --git a/lib/Tmdb/Repository/MovieRepository.php b/lib/Tmdb/Repository/MovieRepository.php index 71826fd5..feb12b17 100644 --- a/lib/Tmdb/Repository/MovieRepository.php +++ b/lib/Tmdb/Repository/MovieRepository.php @@ -56,21 +56,6 @@ public function load($id, array $parameters = array(), array $headers = array()) return MovieFactory::create($data); } - /** - * If you obtained an movie model which is not completely hydrated, you can use this function. - * - * @todo store the previous given parameters so the same conditions apply to a refresh, and merge the new set - * - * @param Movie $movie - * @param array $parameters - * @param array $headers - * @return Movie - */ - public function refresh(Movie $movie, array $parameters = array(), array $headers = array()) - { - return $this->load($movie->getId(), $parameters, $headers); - } - /** * Return the Movies API Class * @@ -98,7 +83,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 - * @return GenericCollection + * @return Movie[] */ public function getUpcoming(array $options = array()) { @@ -111,7 +96,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 - * @return GenericCollection + * @return Movie[] */ public function getNowPlaying(array $options = array()) { @@ -124,7 +109,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 - * @return GenericCollection + * @return Movie[] */ public function getPopular(array $options = array()) { @@ -137,7 +122,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 - * @return GenericCollection + * @return Movie[] */ public function getTopRated(array $options = array()) { @@ -149,10 +134,8 @@ public function getTopRated(array $options = array()) /** * Create an collection of an array * - * @todo Allow an array of Movie objects to pass ( custom collection ) - * * @param $data - * @return GenericCollection + * @return Movie[] */ private function createCollection($data){ $collection = new GenericCollection(); diff --git a/lib/Tmdb/Repository/PeopleRepository.php b/lib/Tmdb/Repository/PeopleRepository.php index c0251730..600a6d29 100644 --- a/lib/Tmdb/Repository/PeopleRepository.php +++ b/lib/Tmdb/Repository/PeopleRepository.php @@ -46,18 +46,6 @@ public function load($id, array $parameters = array(), array $headers = array()) return PeopleFactory::create($data); } - /** - * If you obtained an person model which is not completely hydrated, you can use this function. - * - * @param Person $person - * @param array $parameters - * @param array $headers - * @return Person - */ - public function refresh(Person $person, array $parameters = array(), array $headers = array()) { - return $this->load($person->getId(), $parameters, $headers); - } - /** * Return the related API class * diff --git a/lib/Tmdb/Repository/TvEpisodeRepository.php b/lib/Tmdb/Repository/TvEpisodeRepository.php index 8d8d6ddd..37e41416 100644 --- a/lib/Tmdb/Repository/TvEpisodeRepository.php +++ b/lib/Tmdb/Repository/TvEpisodeRepository.php @@ -35,7 +35,7 @@ class TvEpisodeRepository extends AbstractRepository { * @param $parameters * @param $headers * @throws RuntimeException - * @return Season + * @return Episode */ public function load($tvShow, $season, $episode, array $parameters = array(), array $headers = array()) { @@ -70,19 +70,6 @@ public function load($tvShow, $season, $episode, array $parameters = array(), ar return TvEpisodeFactory::create($data); } - /** - * If you obtained an episode model which is not completely hydrated, you can use this function. - * - * @param Episode $episode - * @param array $parameters - * @param array $headers - * @return Season - */ - public function refresh(Episode $episode, array $parameters = array(), array $headers = array()) - { - return $this->load($episode->getId(), $parameters, $headers); - } - /** * Return the Seasons API Class * @@ -97,7 +84,7 @@ public function getApi() * Create an collection of an array * * @param $data - * @return GenericCollection + * @return Episode[] */ private function createCollection($data){ $collection = new GenericCollection(); diff --git a/lib/Tmdb/Repository/TvRepository.php b/lib/Tmdb/Repository/TvRepository.php index 64740f4e..a4e7b74d 100644 --- a/lib/Tmdb/Repository/TvRepository.php +++ b/lib/Tmdb/Repository/TvRepository.php @@ -79,7 +79,7 @@ public function getApi() * Get the list of popular tvs on The Tv Database. This list refreshes every day. * * @param array $options - * @return GenericCollection + * @return Tv[] */ public function getPopular(array $options = array()) { @@ -92,7 +92,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 - * @return GenericCollection + * @return Tv[] */ public function getTopRated(array $options = array()) { @@ -107,7 +107,7 @@ public function getTopRated(array $options = array()) * @todo Allow an array of Tv objects to pass ( custom collection ) * * @param $data - * @return GenericCollection + * @return Tv[] */ private function createCollection($data){ $collection = new GenericCollection(); diff --git a/lib/Tmdb/Repository/TvSeasonRepository.php b/lib/Tmdb/Repository/TvSeasonRepository.php index 26670469..09b69b9e 100644 --- a/lib/Tmdb/Repository/TvSeasonRepository.php +++ b/lib/Tmdb/Repository/TvSeasonRepository.php @@ -64,19 +64,6 @@ public function load($tvShow, $season, array $parameters = array(), array $heade return TvSeasonFactory::create($data); } - /** - * If you obtained an season model which is not completely hydrated, you can use this function. - * - * @param Season $season - * @param array $parameters - * @param array $headers - * @return Season - */ - public function refresh(Season $season, array $parameters = array(), array $headers = array()) - { - return $this->load($season->getId(), $parameters, $headers); - } - /** * Return the Seasons API Class * @@ -93,7 +80,7 @@ public function getApi() * @todo Allow an array of Season objects to pass ( custom collection ) * * @param $data - * @return GenericCollection + * @return Season[] */ private function createCollection($data){ $collection = new GenericCollection();