mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Generics annotations support (#1298)
* option to use generics syntax, default to yes in laravel 9 * rename `use_generics_syntax` to `use_generics_annotations` * update readme and changelog * remove laravel 9 default override * include key type in generics annotations * readme rewording * set `use_generics_annotations` to `true` by default * update tests to reflect `use_generics_annotations` being set to `true` by default * default `use_generics_annotations` setting to true when not set in config Co-authored-by: Markus Podar <[email protected]> --------- Co-authored-by: Markus Podar <[email protected]>
This commit is contained in:
co-authored by
Markus Podar
parent
5d9925bab8
commit
f0e4cf5e78
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenericsSyntaxDisabled\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenericsSyntaxDisabled\Models\Simple
|
||||
*
|
||||
* @property integer $id
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularBelongsToMany
|
||||
* @property-read int|null $regular_belongs_to_many_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularHasMany
|
||||
* @property-read int|null $regular_has_many_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Simple extends Model
|
||||
{
|
||||
// Regular relations
|
||||
public function regularHasMany(): HasMany
|
||||
{
|
||||
return $this->hasMany(Simple::class);
|
||||
}
|
||||
|
||||
public function regularBelongsToMany(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Simple::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user