@@ -122,7 +122,7 @@ public function getDefaultImage()
122122 *
123123 * @param string|false $image
124124 *
125- * @return self
125+ * @return \Arcanedev\Gravatar\Gravatar
126126 *
127127 * @throws \Arcanedev\Gravatar\Exceptions\InvalidImageUrlException
128128 */
@@ -131,12 +131,9 @@ public function setDefaultImage($image)
131131 if ($ image !== false ) {
132132 $ this ->cachedParams = null ;
133133
134- if (in_array (strtolower ($ image ), $ this ->supportedImages )) {
135- $ image = strtolower ($ image );
136- }
137- else {
138- $ this ->checkImageUrl ($ image );
139- }
134+ $ image = in_array (strtolower ($ image ), $ this ->supportedImages )
135+ ? strtolower ($ image )
136+ : $ this ->checkImageUrl ($ image );
140137 }
141138
142139 $ this ->defaultImage = $ image ;
@@ -159,7 +156,7 @@ public function getSize()
159156 *
160157 * @param integer $size - The avatar size to use, must be less than 512 and greater than 0.
161158 *
162- * @return self
159+ * @return \Arcanedev\Gravatar\Gravatar
163160 *
164161 * @throws \Arcanedev\Gravatar\Exceptions\InvalidImageSizeException
165162 */
@@ -201,7 +198,7 @@ public function getRating()
201198 *
202199 * @param string $rating
203200 *
204- * @return self
201+ * @return \Arcanedev\Gravatar\Gravatar
205202 *
206203 * @throws \Arcanedev\Gravatar\Exceptions\InvalidImageRatingException
207204 */
@@ -310,7 +307,7 @@ public function image($email, $alt = null, $attributes = [], $rating = null)
310307 /**
311308 * Enable the use of the secure protocol for image URLs.
312309 *
313- * @return self
310+ * @return \Arcanedev\Gravatar\Gravatar
314311 */
315312 public function enableSecure ()
316313 {
@@ -322,7 +319,7 @@ public function enableSecure()
322319 /**
323320 * Disable the use of the secure protocol for image URLs.
324321 *
325- * @return self
322+ * @return \Arcanedev\Gravatar\Gravatar
326323 */
327324 public function disableSecure ()
328325 {
@@ -368,6 +365,8 @@ public function hashEmail($email)
368365 *
369366 * @param string $image
370367 *
368+ * @return string
369+ *
371370 * @throws \Arcanedev\Gravatar\Exceptions\InvalidImageUrlException
372371 */
373372 private function checkImageUrl ($ image )
@@ -377,6 +376,8 @@ private function checkImageUrl($image)
377376 'The default image specified is not a recognized gravatar "default" and is not a valid URL '
378377 );
379378 }
379+
380+ return $ image ;
380381 }
381382
382383 /* ------------------------------------------------------------------------------------------------
0 commit comments