ref = (int) $array['ref']; $hasRole = isset($array['role']); assert($hasRole); $instance->role = (string) $array['role']; $instance->completeFromArray($array); return $instance; } public function isSame(Member $other): bool { return ($this->ref === $other->ref); } }