Skip to content

Commit bf84596

Browse files
committed
Merge pull request #98 from sirikkoster/2.0
Update Image.php
2 parents 3bba92f + fc3c3b6 commit bf84596

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lib/Tmdb/Model/Image.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -224,21 +224,10 @@ public function getMedia()
224224

225225
/**
226226
* Return the file path when casted to string
227-
*
228-
* @throws \Exception when the filepath is empty.
229-
* @return mixed
227+
* @return string
230228
*/
231229
public function __toString()
232230
{
233-
$filePath = $this->getFilePath();
234-
235-
if (empty($filePath)) {
236-
throw new \Exception(sprintf(
237-
'Trying to convert an instance of "%s" into an string, but there was no filePath found.',
238-
get_class($this)
239-
));
240-
}
241-
242-
return $this->getFilePath();
231+
return (string)$this->getFilePath();
243232
}
244233
}

0 commit comments

Comments
 (0)