public static function getInt(array $array, $key, int $default = 0) : int
    {
        $key = (string) $key;

        if ($array[$key] ?? 0) {
            return (int) $array[$key];
        }

        return $default;
    }