mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-26 20:34:48 +01:00
27 lines
557 B
PHP
27 lines
557 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Tests\Psalm\LaravelPlugin\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
final class Comment extends Model
|
|
{
|
|
/**
|
|
* @psalm-return BelongsTo<Post>
|
|
*/
|
|
public function post(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Post::class);
|
|
}
|
|
|
|
/**
|
|
* Get the owning commentable model.
|
|
*/
|
|
public function commentable(): MorphTo
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|