Skip to content

Commit 379ff34

Browse files
authored
Typehint mutator profile_photo_url attribute function return (#1396)
We need to typehint mutator function return to let IDE Helper package know the type of the attribute. barryvdh/laravel-ide-helper#1315 (comment) Then PHPStan will not throw error on undefined profile_photo_url property.
1 parent d02086d commit 379ff34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/HasProfilePhoto.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function deleteProfilePhoto()
5959
*/
6060
public function profilePhotoUrl(): Attribute
6161
{
62-
return Attribute::get(function () {
62+
return Attribute::get(function (): string {
6363
return $this->profile_photo_path
6464
? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)
6565
: $this->defaultProfilePhotoUrl();

0 commit comments

Comments
 (0)