status === self::STATUS_ALLOWED; } public function isDenied(): bool { return $this->status === self::STATUS_DENIED; } public function isPending(): bool { return $this->status === self::STATUS_PENDING; } public function isUndefined(): bool { return $this->status === self::STATUS_UNDEFINED; } public function isLocked(): bool { return $this->lockedBy !== null; } // Conversion public function toArray(): array { return array_filter([ 'status' => $this->status, 'reason' => $this->reason, 'locked_by' => $this->lockedBy?->name, 'key' => $this->key, 'scope' => $this->scope, 'training_url' => $this->trainingUrl, ], fn ($v) => $v !== null); } }