Skip to content

Commit

Permalink
Renaming any image related methods to be more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 8, 2014
1 parent eb2a91a commit 8ad49a0
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions lib/Tmdb/Factory/CollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public function create(array $data = array())
}

if (array_key_exists('backdrop_path', $data)) {
$collection->setBackdrop($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']));
}

if (array_key_exists('poster_path', $data)) {
$collection->setPoster($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
$collection->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
}

return $this->hydrate($collection, $data);
Expand Down
2 changes: 1 addition & 1 deletion lib/Tmdb/Factory/CompanyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function create(array $data = array())
$company = new Company();

if (array_key_exists('logo_path', $data)) {
$company->setLogo($this->getImageFactory()->createFromPath($data['logo_path'], 'logo_path'));
$company->setLogoImage($this->getImageFactory()->createFromPath($data['logo_path'], 'logo_path'));
}

return $this->hydrate(new Company(), $data);
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Factory/MovieFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ public function create(array $data = array())

/** Images */
if (array_key_exists('backdrop_path', $data)) {
$movie->setBackdrop($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path'));
$movie->setBackdropImage($this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path'));
}

if (array_key_exists('images', $data)) {
$movie->setImages($this->getImageFactory()->createCollectionFromMovie($data['images']));
}

if (array_key_exists('poster_path', $data)) {
$movie->setPoster($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
$movie->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
}

/** Keywords */
Expand Down
2 changes: 1 addition & 1 deletion lib/Tmdb/Factory/PeopleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function create(array $data = array(), Person\AbstractMember $person = nu
}

if (array_key_exists('profile_path', $data)) {
$person->setProfile($this->getImageFactory()->createFromPath($data['profile_path'], 'profile_path'));
$person->setProfileImage($this->getImageFactory()->createFromPath($data['profile_path'], 'profile_path'));
}

if ($person instanceof Person) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Tmdb/Factory/TvEpisodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function create(array $data = array())
}

if (array_key_exists('still_path', $data)) {
$tvEpisode->setStill($this->getImageFactory()->createFromPath($data['still_path'], 'still_path'));
$tvEpisode->setStillImage($this->getImageFactory()->createFromPath($data['still_path'], 'still_path'));
}

return $this->hydrate($tvEpisode, $data);
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Factory/TvFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ public function create(array $data = array())
}

if (array_key_exists('backdrop_path', $data)) {
$tvShow->setBackdrop($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->setPoster($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
$tvShow->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
}

/** Translations */
Expand Down
2 changes: 1 addition & 1 deletion lib/Tmdb/Factory/TvSeasonFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function create(array $data = array())
}

if (array_key_exists('poster_path', $data)) {
$tvSeason->setPoster($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
$tvSeason->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
}

/** Episodes */
Expand Down
8 changes: 4 additions & 4 deletions lib/Tmdb/Model/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct()
* @param \Tmdb\Model\Image\BackdropImage $backdrop
* @return $this
*/
public function setBackdrop(BackdropImage $backdrop)
public function setBackdropImage(BackdropImage $backdrop)
{
$this->backdrop = $backdrop;
return $this;
Expand All @@ -91,7 +91,7 @@ public function setBackdrop(BackdropImage $backdrop)
/**
* @return \Tmdb\Model\Image\BackdropImage
*/
public function getBackdrop()
public function getBackdropImage()
{
return $this->backdrop;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ public function getParts()
* @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPoster(PosterImage $poster)
public function setPosterImage(PosterImage $poster)
{
$this->poster = $poster;
return $this;
Expand All @@ -217,7 +217,7 @@ public function setPoster(PosterImage $poster)
/**
* @return \Tmdb\Model\Image\PosterImage
*/
public function getPoster()
public function getPosterImage()
{
return $this->poster;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Model/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getId()
* @param LogoImage $logo
* @return $this
*/
public function setLogo(LogoImage $logo)
public function setLogoImage(LogoImage $logo)
{
$this->logo = $logo;
return $this;
Expand All @@ -125,7 +125,7 @@ public function setLogo(LogoImage $logo)
/**
* @return LogoImage
*/
public function getLogo()
public function getLogoImage()
{
return $this->logo;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Tmdb/Model/Movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ public function getTranslations()
* @param \Tmdb\Model\Image $backdrop
* @return $this
*/
public function setBackdrop($backdrop)
public function setBackdropImage($backdrop)
{
$this->backdrop = $backdrop;
return $this;
Expand All @@ -869,7 +869,7 @@ public function setBackdrop($backdrop)
/**
* @return \Tmdb\Model\Image
*/
public function getBackdrop()
public function getBackdropImage()
{
return $this->backdrop;
}
Expand All @@ -878,7 +878,7 @@ public function getBackdrop()
* @param \Tmdb\Model\Image $poster
* @return $this
*/
public function setPoster($poster)
public function setPosterImage($poster)
{
$this->poster = $poster;
return $this;
Expand All @@ -887,7 +887,7 @@ public function setPoster($poster)
/**
* @return \Tmdb\Model\Image
*/
public function getPoster()
public function getPosterImage()
{
return $this->poster;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Model/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function getProfilePath()
* @param ProfileImage $profile
* @return $this
*/
public function setProfile(ProfileImage $profile)
public function setProfileImage(ProfileImage $profile)
{
$this->profile = $profile;
return $this;
Expand All @@ -392,7 +392,7 @@ public function setProfile(ProfileImage $profile)
/**
* @return ProfileImage
*/
public function getProfile()
public function getProfileImage()
{
return $this->profile;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Model/Person/AbstractMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getProfilePath()
* @param Image\ProfileImage $profile
* @return $this
*/
public function setProfile($profile = null)
public function setProfileImage($profile = null)
{
$this->profile = $profile;
return $this;
Expand All @@ -110,7 +110,7 @@ public function setProfile($profile = null)
/**
* @return Image\ProfileImage|null
*/
public function getProfile()
public function getProfileImage()
{
return $this->profile;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Tmdb/Model/Tv.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ public function getCredits()
* @param \Tmdb\Model\Image\BackdropImage $backdrop
* @return $this
*/
public function setBackdrop(BackdropImage $backdrop)
public function setBackdropImage(BackdropImage $backdrop)
{
$this->backdrop = $backdrop;
return $this;
Expand All @@ -736,7 +736,7 @@ public function setBackdrop(BackdropImage $backdrop)
/**
* @return \Tmdb\Model\Image\BackdropImage
*/
public function getBackdrop()
public function getBackdropImage()
{
return $this->backdrop;
}
Expand All @@ -745,7 +745,7 @@ public function getBackdrop()
* @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPoster(PosterImage $poster)
public function setPosterImage(PosterImage $poster)
{
$this->poster = $poster;
return $this;
Expand All @@ -754,7 +754,7 @@ public function setPoster(PosterImage $poster)
/**
* @return \Tmdb\Model\Image\PosterImage
*/
public function getPoster()
public function getPosterImage()
{
return $this->poster;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Model/Tv/Episode.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function getImages()
* @param StillImage $still
* @return $this
*/
public function setStill($still)
public function setStillImage($still)
{
$this->still = $still;
return $this;
Expand All @@ -377,7 +377,7 @@ public function setStill($still)
/**
* @return StillImage
*/
public function getStill()
public function getStillImage()
{
return $this->still;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Tmdb/Model/Tv/Season.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function getImages()
* @param \Tmdb\Model\Image\PosterImage $poster
* @return $this
*/
public function setPoster($poster)
public function setPosterImage($poster)
{
$this->poster = $poster;
return $this;
Expand All @@ -301,7 +301,7 @@ public function setPoster($poster)
/**
* @return \Tmdb\Model\Image\PosterImage
*/
public function getPoster()
public function getPosterImage()
{
return $this->poster;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Tmdb/Tests/Factory/CollectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public function shouldBeAbleToCreateCollection()
*/
public function shouldBeFunctional()
{
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->collection->getBackdrop());
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->collection->getBackdropImage());
$this->assertEquals('/qCECROwx3TRUEgoZv2Mz2D723QC.jpg', $this->collection->getBackdropPath());
$this->assertEquals(10, $this->collection->getId());
$this->assertEquals('external', $this->collection->getOverview());
$this->assertInstanceOf('Tmdb\Model\Collection\Images', $this->collection->getImages());
$this->assertEquals('Star Wars Collection', $this->collection->getName());
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $this->collection->getParts());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->collection->getPoster());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->collection->getPosterImage());
$this->assertEquals('/ghd5zOQnDaDW1mxO7R5fXXpZMu.jpg', $this->collection->getPosterPath());
}

Expand Down
2 changes: 1 addition & 1 deletion test/Tmdb/Tests/Factory/CompanyFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function shouldConstructCompany()
$company = $factory->create($this->data);

$this->assertInstanceOf('Tmdb\Model\Company', $company);
$this->assertInstanceOf('Tmdb\Model\Image\LogoImage', $company->getLogo());
$this->assertInstanceOf('Tmdb\Model\Image\LogoImage', $company->getLogoImage());

$this->assertEquals(null, $company->getDescription());
$this->assertEquals('San Francisco, California', $company->getHeadquarters());
Expand Down
8 changes: 4 additions & 4 deletions test/Tmdb/Tests/Factory/MovieFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function shouldBeFunctional()
{
$this->assertEquals(false, $this->movie->getAdult());
$this->assertEquals('/7DlIoyQ3ecGMklVWyKsneZmVnsi.jpg', $this->movie->getBackdropPath());
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->movie->getBackdrop());
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->movie->getBackdropImage());
$this->assertEquals(true, is_array($this->movie->getBelongsToCollection()));
$this->assertEquals(true, is_int($this->movie->getBudget()));
$this->assertInstanceOf('Tmdb\Model\Collection\Genres', $this->movie->getGenres());
Expand All @@ -83,7 +83,7 @@ public function shouldBeFunctional()
$this->assertEquals('Riddick', $this->movie->getOriginalTitle());
$this->assertEquals('Betrayed by his own kind and left for dead on a desolate planet, Riddick fights for survival against alien predators and becomes more powerful and dangerous than ever before. Soon bounty hunters from throughout the galaxy descend on Riddick only to find themselves pawns in his greater scheme for revenge. With his enemies right where he wants them, Riddick unleashes a vicious attack of vengeance before returning to his home planet of Furya to save it from destruction.', $this->movie->getOverview());
$this->assertEquals(93.491722439366, $this->movie->getPopularity());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->movie->getPoster());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->movie->getPosterImage());
$this->assertEquals('/1NfhdnQAEqcBRCulEhOFSkRrrLv.jpg', $this->movie->getPosterPath());
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $this->movie->getProductionCompanies());
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $this->movie->getProductionCountries());
Expand Down Expand Up @@ -135,10 +135,10 @@ public function shouldGetProfileImages()
*/
foreach($cast as $c) {
if ($c->hasProfileImage()) {
$filePath = $c->getProfile()->getFilePath();
$filePath = $c->getProfileImage()->getFilePath();
$this->assertEquals(false, empty($filePath));
}else{
$this->assertEquals(null, $c->getProfile());
$this->assertEquals(null, $c->getProfileImage());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/Tmdb/Tests/Factory/PeopleFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function shouldConstructPerson()
$this->assertInstanceOf('Tmdb\Model\Person', $this->person);

$this->assertInstanceOf('Tmdb\Model\Collection\Images', $this->person->getImages());
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $this->person->getProfile());
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $this->person->getProfileImage());
}

/**
Expand Down Expand Up @@ -127,7 +127,7 @@ public function shouldBeFunctional()
$this->assertEquals('Blue Island, Illinois, USA', $this->person->getPlaceOfBirth());
//@todo
//$this->assertEquals(1.99498054250796, $this->person->getPopularity());
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $this->person->getProfile());
$this->assertInstanceOf('Tmdb\Model\Image\ProfileImage', $this->person->getProfileImage());
$this->assertEquals('/h9YwlLHANaQzaTVkVwxnxLbvCY4.jpg', $this->person->getProfilePath());
$this->assertInstanceOf('Tmdb\Model\Collection\Images', $this->person->getImages());
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $this->person->getChanges());
Expand Down
2 changes: 1 addition & 1 deletion test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function shouldConstructTvEpisode()
$this->assertInstanceOf('Tmdb\Model\Collection\Credits', $this->episode->getCredits());
$this->assertInstanceOf('Tmdb\Model\Tv\ExternalIds', $this->episode->getExternalIds());
$this->assertInstanceOf('Tmdb\Model\Collection\Images', $this->episode->getImages());
$this->assertInstanceOf('Tmdb\Model\Image\StillImage', $this->episode->getStill());
$this->assertInstanceOf('Tmdb\Model\Image\StillImage', $this->episode->getStillImage());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/Tmdb/Tests/Factory/TvFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function shouldConstructTv()
$this->assertInstanceOf('Tmdb\Model\Tv', $this->tv);

$this->assertInstanceOf('\DateTime', $this->tv->getLastAirDate());
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->tv->getBackdrop());
$this->assertInstanceOf('Tmdb\Model\Image\BackdropImage', $this->tv->getBackdropImage());
$this->assertInstanceOf('Tmdb\Model\Collection\Genres', $this->tv->getGenres());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->tv->getPoster());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->tv->getPosterImage());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function shouldConstructTvSeason()
$this->assertInstanceOf('Tmdb\Model\Tv\ExternalIds', $this->season->getExternalIds());
$this->assertInstanceOf('Tmdb\Model\Collection\Images', $this->season->getImages());
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $this->season->getEpisodes());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->season->getPoster());
$this->assertInstanceOf('Tmdb\Model\Image\PosterImage', $this->season->getPosterImage());
}

/**
Expand Down

0 comments on commit 8ad49a0

Please sign in to comment.