public function castKey($key, string $default = ""): string
    {
        return is_int($key) || empty($key) ? $default : (string)$key;
    }
public function castKey($key, string $default = ""): string
    {
        return is_int($key) || empty($key) ? $default : (string)$key;
    }
public function castKey ( $ key , string $ default = "" ) : string { return is_int ( $ key ) || empty ( $ key ) ? $ default : ( string ) $ key ; }
The key should be a native string, so it will cast what it can with a fallback.
The goal of this is to normalize associative keys and allowing the developer to
decide if they want to included non-associative keys.

@param mixed $key
@param string $default
@return string
The key should be a native string so it will cast what it can with a fallback . The goal of this is to normalize associative keys and allowing the developer to decide if they want to included non - associative keys .