Add phpstan level 7(#544)

This commit is contained in:
Saeed Vaziry
2025-03-12 13:31:10 +01:00
committed by GitHub
parent c22bb1fa80
commit 493cbb0849
437 changed files with 4505 additions and 2193 deletions

View File

@ -4,6 +4,9 @@
trait Enum
{
/**
* @return array<string, mixed>
*/
public static function all(): array
{
$reflection = new \ReflectionClass(self::class);

View File

@ -8,6 +8,9 @@
trait HasProjectThroughServer
{
/**
* @return HasOneThrough<Project, Server, $this>
*/
public function project(): HasOneThrough
{
return $this->hasOneThrough(

View File

@ -21,7 +21,7 @@ public function getUpdatedAtByTimezoneAttribute(): string
return $this->getDateTimeByTimezone($this->updated_at);
}
public function getDateTimeByTimezone(?Carbon $value = null): ?string
public function getDateTimeByTimezone(?Carbon $value = null): string
{
if ($value && auth()->user() && auth()->user()->timezone) {
try {
@ -30,6 +30,6 @@ public function getDateTimeByTimezone(?Carbon $value = null): ?string
}
}
return $value;
return $value ?? '';
}
}