mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
[Model] Simplify full namespaces for already included resources (#954)
* Fixed #565 by using the imported class name if present. Fixed a bug where cast type was not properly added when the return type was found via phpdoc. * Fixed errors with phpdocumentor/type-resolver:1.0
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
||||
|
||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Casts\CastType;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\{
|
||||
Builder as EloquentBuilder,
|
||||
Collection,
|
||||
SoftDeletes
|
||||
};
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Query\Builder as QueryBuilder;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $casts = [
|
||||
'char_not_nullable' => CastType::class,
|
||||
];
|
||||
|
||||
public function posts(): HasMany
|
||||
{
|
||||
return $this->hasMany(Post::class);
|
||||
}
|
||||
|
||||
public function scopeNull($query, string $unusedParam)
|
||||
{
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user