mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* Add support for protected Attribute accessors * Fix formatting * Prevent accessors methods marked as private from being added * Exclude specific accessors based on trait instead of class * Add changelog entry * Add clarifying comment * Fix accessor attributes not working on PHP < 8.1 * Reintroduce method variable to reduce PR clutter * Change variable name to reduce PR clutter * Update CHANGELOG.md --------- Co-authored-by: Barry vd. Heuvel <[email protected]> Co-authored-by: Barry vd. Heuvel <[email protected]>
111 lines
2.1 KiB
PHP
111 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter\Models;
|
|
|
|
use DateTime;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Simple extends Model
|
|
{
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getAttributeWithIntReturnPhpdocAttribute()
|
|
{
|
|
}
|
|
|
|
public function getAttributeWithIntReturnTypeAttribute(): int
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getAttributeWithIntReturnTypeAndPhpdocAttribute(): int
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getAttributeWithIntReturnTypeAndButPhpdocStringAttribute(): int
|
|
{
|
|
}
|
|
|
|
public function getAttributeWithoutTypeAttribute()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return \what|\ever|\we-write/here
|
|
*/
|
|
public function getAttributeTakesPhpdocLiteralAttribute()
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnTypeIntOrNullAttribute(): ?int
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsImportedClassAttribute(): DateTime
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsFqnClassAttribute(): \Illuminate\Support\Facades\Date
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsArrayAttribute(): array
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsNullableArrayAttribute(): ?array
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsStdClassAttribute(): \stdClass
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsNullableStdClassAttribute(): ?\stdClass
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsBoolAttribute(): bool
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsNullableBoolAttribute(): ?bool
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsFloatAttribute(): bool
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsNullableFloatAttribute(): ?bool
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsCallableAttribute(): callable
|
|
{
|
|
}
|
|
|
|
public function getAttributeReturnsNullableCallableAttribute(): ?callable
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Doesn't make sense, but…
|
|
*/
|
|
public function getAttributeReturnsVoidAttribute(): void
|
|
{
|
|
}
|
|
|
|
private function getInvalidAccessModifierAttribute()
|
|
{
|
|
}
|
|
}
|