Skip to content

Commit

Permalink
Run Rector, PHPStan, and Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho committed Nov 14, 2024
1 parent 1be4721 commit 8b18c0f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/Models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Item extends Model
use HasFactory;

/**
* @return BelongsToMany<Photo>
* @return BelongsToMany<Photo, $this>
*/
public function photos(): BelongsToMany
{
Expand All @@ -31,7 +31,7 @@ public function photos(): BelongsToMany
}

/**
* @return HasMany<PhotoItem>
* @return HasMany<PhotoItem, $this>
*/
public function photoItems(): HasMany
{
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ protected function casts(): array
}

/**
* @return BelongsTo<User, Photo>
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}

/**
* @return BelongsToMany<Item>
* @return BelongsToMany<Item, $this>
*/
public function items(): BelongsToMany
{
Expand All @@ -54,7 +54,7 @@ public function items(): BelongsToMany
}

/**
* @return HasMany<PhotoItem>
* @return HasMany<PhotoItem, $this>
*/
public function photoItems(): HasMany
{
Expand Down
6 changes: 3 additions & 3 deletions app/Models/PhotoItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ protected function casts(): array
}

/**
* @return BelongsTo<Item, PhotoItem>
* @return BelongsTo<Item, $this>
*/
public function item(): BelongsTo
{
return $this->belongsTo(Item::class);
}

/**
* @return BelongsTo<Photo, PhotoItem>
* @return BelongsTo<Photo, $this>
*/
public function photo(): BelongsTo
{
return $this->belongsTo(Photo::class);
}

/**
* @return BelongsToMany<Tag>
* @return BelongsToMany<Tag, $this>
*/
public function tags(): BelongsToMany
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/PhotoItemTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class PhotoItemTag extends Pivot
public $incrementing = true;

/**
* @return BelongsTo<PhotoItem, PhotoItemTag>
* @return BelongsTo<PhotoItem, $this>
*/
public function photoItem(): BelongsTo
{
return $this->belongsTo(PhotoItem::class);
}

/**
* @return BelongsTo<Tag, PhotoItemTag>
* @return BelongsTo<Tag, $this>
*/
public function tag(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class Tag extends Model
protected $guarded = [];

/**
* @return BelongsTo<TagType, Tag>
* @return BelongsTo<TagType, $this>
*/
public function type(): BelongsTo
{
return $this->belongsTo(TagType::class, 'tag_type_id');
}

/**
* @return HasMany<PhotoItemTag>
* @return HasMany<PhotoItemTag, $this>
*/
public function photoItemTags(): HasMany
{
Expand Down
9 changes: 5 additions & 4 deletions app/Models/TagShortcut.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Models;

use Closure;
use Database\Factories\TagShortcutFactory;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
Expand All @@ -21,7 +22,7 @@ class TagShortcut extends Model
use HasFactory;

/**
* @return array<string, callable>
* @return array<string, Closure>
*/
public static function commonEagerLoads(): array
{
Expand All @@ -33,15 +34,15 @@ public static function commonEagerLoads(): array
}

/**
* @return BelongsTo<User, TagShortcut>
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}

/**
* @return BelongsToMany<Item>
* @return BelongsToMany<Item, $this>
*/
public function items(): BelongsToMany
{
Expand All @@ -52,7 +53,7 @@ public function items(): BelongsToMany
}

/**
* @return HasMany<TagShortcutItem>
* @return HasMany<TagShortcutItem, $this>
*/
public function tagShortcutItems(): HasMany
{
Expand Down
8 changes: 4 additions & 4 deletions app/Models/TagShortcutItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ protected function casts(): array
}

/**
* @return BelongsTo<TagShortcut, TagShortcutItem>
* @return BelongsTo<TagShortcut, $this>
*/
public function tagShortcut(): BelongsTo
{
return $this->belongsTo(TagShortcut::class);
}

/**
* @return BelongsTo<Item, TagShortcutItem>
* @return BelongsTo<Item, $this>
*/
public function item(): BelongsTo
{
return $this->belongsTo(Item::class);
}

/**
* @return BelongsToMany<Tag>
* @return BelongsToMany<Tag, $this>
*/
public function tags(): BelongsToMany
{
Expand All @@ -72,7 +72,7 @@ public function tags(): BelongsToMany
}

/**
* @return HasMany<TagShortcutItemTag>
* @return HasMany<TagShortcutItemTag, $this>
*/
public function tagShortcutItemTags(): HasMany
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/TagShortcutItemTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class TagShortcutItemTag extends Pivot
public $incrementing = true;

/**
* @return BelongsTo<TagShortcutItem, TagShortcutItemTag>
* @return BelongsTo<TagShortcutItem, $this>
*/
public function tagShortcutItem(): BelongsTo
{
return $this->belongsTo(TagShortcutItem::class);
}

/**
* @return BelongsTo<Tag, TagShortcutItemTag>
* @return BelongsTo<Tag, $this>
*/
public function tag(): BelongsTo
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/TeamInvitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TeamInvitation extends JetstreamTeamInvitation
/**
* Get the team that the invitation belongs to.
*
* @return BelongsTo<Team, TeamInvitation>
* @return BelongsTo<Team, $this>
*/
public function team(): BelongsTo
{
Expand Down
4 changes: 2 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ protected function defaultProfilePhotoUrl(): string
}

/**
* @return HasMany<Photo>
* @return HasMany<Photo, $this>
*/
public function photos(): HasMany
{
return $this->hasMany(Photo::class);
}

/**
* @return HasMany<TagShortcut>
* @return HasMany<TagShortcut, $this>
*/
public function tagShortcuts(): HasMany
{
Expand Down

0 comments on commit 8b18c0f

Please sign in to comment.