true, 'type' => $this->get_property_type($property), ); } foreach ($optional_properties as $property) { $args[$property] = array( 'required' => false, 'type' => $this->get_property_type($property), ); } return $args; } /** * Determines the type of a property. * * @param string $property The property name. * @return string The type of the property. */ private function get_property_type(string $property): string { $types = array( 'provider' => 'string', 'user_id' => 'integer', 'login_nonce' => 'string', 'redirect_to' => 'string', 'two-factor-totp-authcode' => 'string', 'key' => 'string', ); return $types[$property] ?? 'string'; } }