From 56c161e24afef8f80f9437972903adf348f5bb5d Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sun, 23 Feb 2014 01:56:50 +0100 Subject: [PATCH] Allow search queries to be left empty, leave the responsibility to meet minimum parameters up to the end-user. --- lib/Tmdb/Repository/SearchRepository.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Tmdb/Repository/SearchRepository.php b/lib/Tmdb/Repository/SearchRepository.php index 3b5d8ceb..176fba57 100644 --- a/lib/Tmdb/Repository/SearchRepository.php +++ b/lib/Tmdb/Repository/SearchRepository.php @@ -94,7 +94,7 @@ public function __construct(Client $client) * * @return ResultCollection|Movie[] */ - public function searchMovie($query, MovieSearchQuery $parameters, array $headers = array()) { + public function searchMovie($query, MovieSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchMovies($query, $parameters->toArray(), $headers); return $this->getMovieFactory()->createResultCollection($data); @@ -107,7 +107,7 @@ public function searchMovie($query, MovieSearchQuery $parameters, array $headers * * @return ResultCollection|Collection[] */ - public function searchCollection($query, CollectionSearchQuery $parameters, array $headers = array()) { + public function searchCollection($query, CollectionSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchCollection($query, $parameters->toArray(), $headers); return $this->getCollectionFactory()->createResultCollection($data); @@ -120,7 +120,7 @@ public function searchCollection($query, CollectionSearchQuery $parameters, arra * * @return ResultCollection|Tv[] */ - public function searchTv($query, TvSearchQuery $parameters, array $headers = array()) { + public function searchTv($query, TvSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchTv($query, $parameters->toArray(), $headers); return $this->getTvFactory()->createResultCollection($data); @@ -133,7 +133,7 @@ public function searchTv($query, TvSearchQuery $parameters, array $headers = arr * * @return ResultCollection|Person[] */ - public function searchPerson($query, PersonSearchQuery $parameters, array $headers = array()) { + public function searchPerson($query, PersonSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchPersons($query, $parameters->toArray(), $headers); return $this->getPeopleFactory()->createResultCollection($data); @@ -147,7 +147,7 @@ public function searchPerson($query, PersonSearchQuery $parameters, array $heade * @todo fix return docblock * @return ResultCollection */ - public function searchList($query, ListSearchQuery $parameters, array $headers = array()) { + public function searchList($query, ListSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchList($query, $parameters->toArray(), $headers); return $this->getListitemFactory()->createResultCollection($data); @@ -160,7 +160,7 @@ public function searchList($query, ListSearchQuery $parameters, array $headers = * * @return ResultCollection|Company[] */ - public function searchCompany($query, CompanySearchQuery $parameters, array $headers = array()) { + public function searchCompany($query, CompanySearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchTv($query, $parameters->toArray(), $headers); return $this->getCompanyFactory()->createResultCollection($data); @@ -174,7 +174,7 @@ public function searchCompany($query, CompanySearchQuery $parameters, array $hea * * @return ResultCollection|Keyword[] */ - public function searchKeyword($query, KeywordSearchQuery $parameters, array $headers = array()) { + public function searchKeyword($query, KeywordSearchQuery $parameters = null, array $headers = array()) { $data = $this->getApi()->searchKeyword($query, $parameters->toArray(), $headers); return $this->getKeywordFactory()->createResultCollection($data);