Infer return type from reflection if no phpdoc given

This commit is contained in:
Markus Podar
2020-04-01 22:44:26 +02:00
parent 18588eacf3
commit b72689755b
3 changed files with 153 additions and 13 deletions
@@ -47,11 +47,58 @@ class Simple extends Model
{
}
public function getAttributeReturnsImportedClass(): DateTime
public function getAttributeReturnsImportedClassAttribute(): DateTime
{
}
public function getAttributeReturnsFqnClass(): \Illuminate\Support\Facades\Date
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
{
}
}