Skip to content

Commit

Permalink
Merge pull request #31 from RobinHoutevelts/patch-rating-as-float
Browse files Browse the repository at this point in the history
Fix type casting
  • Loading branch information
Jérôme Poskin committed Dec 21, 2015
2 parents 2e6b98f + 905354d commit b21f619
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Moinax/TvDb/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Banner
public $language = '';

/**
* @var string
* @var float
*/
public $rating = '';

Expand Down Expand Up @@ -86,7 +86,7 @@ public function __construct($data)
$this->type2 = (string)$data->BannerType2;
$this->colors = (array)$data->Colors;
$this->language = (string)$data->Language;
$this->rating = (string)$data->Rating;
$this->rating = (float)$data->Rating;
$this->ratingCount = (int)$data->RatingCount;
$this->seriesName = (string)$data->SeriesName;
$this->thumbnailPath = (string)$data->ThumbnailPath;
Expand Down
4 changes: 2 additions & 2 deletions src/Moinax/TvDb/Episode.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Episode
public $overview = '';

/**
* @var string
* @var float
*/
public $rating = '';

Expand Down Expand Up @@ -115,7 +115,7 @@ public function __construct($data)
$this->imdbId = (string)$data->IMDB_ID;
$this->language = (string) $data->Language;
$this->overview = (string)$data->Overview;
$this->rating = (string)$data->Rating;
$this->rating = (float)$data->Rating;
$this->ratingCount = (int)$data->RatingCount;
$this->lastUpdated = \DateTime::createFromFormat('U', (int)$data->lastupdated);
$this->writers = (array)Client::removeEmptyIndexes(explode('|', (string)$data->Writer));
Expand Down
6 changes: 3 additions & 3 deletions src/Moinax/TvDb/Serie.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Serie
public $network = '';

/**
* @var string
* @var float
*/
public $rating = '';

Expand Down Expand Up @@ -155,8 +155,8 @@ public function __construct($data)
$this->contentRating = (string)$data->ContentRating;
$this->genres = (array)Client::removeEmptyIndexes(explode('|', (string)$data->Genre));
$this->network = (string)$data->Network;
$this->rating = (string)$data->Rating;
$this->ratingCount = (string)$data->RatingCount;
$this->rating = (float)$data->Rating;
$this->ratingCount = (int)$data->RatingCount;
$this->runtime = (int)$data->Runtime;
$this->status = (string)$data->Status;
$this->added = new \DateTime((string)$data->added);
Expand Down

0 comments on commit b21f619

Please sign in to comment.